4 |
4 |
5 #include "stdafx.h" |
5 #include "stdafx.h" |
6 #include "openttd.h" |
6 #include "openttd.h" |
7 #include "bridge_map.h" |
7 #include "bridge_map.h" |
8 #include "debug.h" |
8 #include "debug.h" |
9 #include "functions.h" |
|
10 #include "station_map.h" |
9 #include "station_map.h" |
11 #include "table/sprites.h" |
|
12 #include "table/strings.h" |
|
13 #include "map.h" |
|
14 #include "tile.h" |
|
15 #include "station.h" |
10 #include "station.h" |
16 #include "gfx.h" |
|
17 #include "window.h" |
|
18 #include "viewport.h" |
|
19 #include "command.h" |
|
20 #include "town.h" |
11 #include "town.h" |
21 #include "vehicle.h" |
|
22 #include "news.h" |
12 #include "news.h" |
23 #include "saveload.h" |
13 #include "saveload.h" |
24 #include "economy.h" |
14 #include "player_func.h" |
25 #include "player.h" |
|
26 #include "airport.h" |
15 #include "airport.h" |
27 #include "sprite.h" |
16 #include "sprite.h" |
28 #include "depot.h" |
17 #include "depot.h" |
29 #include "train.h" |
18 #include "train.h" |
30 #include "water_map.h" |
19 #include "water_map.h" |
31 #include "industry_map.h" |
20 #include "industry_map.h" |
32 #include "newgrf_callbacks.h" |
21 #include "newgrf_callbacks.h" |
33 #include "newgrf_station.h" |
22 #include "newgrf_station.h" |
34 #include "yapf/yapf.h" |
23 #include "yapf/yapf.h" |
35 #include "date.h" |
|
36 #include "helpers.hpp" |
|
37 #include "cargotype.h" |
24 #include "cargotype.h" |
38 #include "roadveh.h" |
25 #include "roadveh.h" |
|
26 #include "station_gui.h" |
|
27 #include "zoom_func.h" |
|
28 #include "functions.h" |
|
29 #include "window_func.h" |
|
30 #include "date_func.h" |
|
31 #include "variables.h" |
|
32 #include "settings_type.h" |
|
33 #include "command_func.h" |
|
34 |
|
35 #include "table/sprites.h" |
|
36 #include "table/strings.h" |
39 |
37 |
40 Station::Station(TileIndex tile) |
38 Station::Station(TileIndex tile) |
41 { |
39 { |
42 DEBUG(station, cDebugCtorLevel, "I+%3d", index); |
40 DEBUG(station, cDebugCtorLevel, "I+%3d", index); |
43 |
41 |
64 */ |
62 */ |
65 Station::~Station() |
63 Station::~Station() |
66 { |
64 { |
67 DEBUG(station, cDebugCtorLevel, "I-%3d", index); |
65 DEBUG(station, cDebugCtorLevel, "I-%3d", index); |
68 |
66 |
69 DeleteName(this->string_id); |
67 free(this->name); |
70 free(this->speclist); |
68 free(this->speclist); |
71 |
69 |
72 if (CleaningPool()) return; |
70 if (CleaningPool()) return; |
73 |
71 |
74 while (!loading_vehicles.empty()) { |
72 while (!loading_vehicles.empty()) { |
131 } |
129 } |
132 |
130 |
133 void Station::MarkDirty() const |
131 void Station::MarkDirty() const |
134 { |
132 { |
135 if (sign.width_1 != 0) { |
133 if (sign.width_1 != 0) { |
136 InvalidateWindowWidget(WC_STATION_VIEW, index, 1); |
134 InvalidateWindowWidget(WC_STATION_VIEW, index, SVW_CAPTION); |
137 |
135 |
138 /* We use ZOOM_LVL_MAX here, as every viewport can have an other zoom, |
136 /* We use ZOOM_LVL_MAX here, as every viewport can have an other zoom, |
139 * and there is no way for us to know which is the biggest. So make the |
137 * and there is no way for us to know which is the biggest. So make the |
140 * biggest area dirty, and we are safe for sure. */ |
138 * biggest area dirty, and we are safe for sure. */ |
141 MarkAllViewportsDirty( |
139 MarkAllViewportsDirty( |