2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8 /** @file airport_defaults.h Tables with default values for airports and airport tiles. */
10 #ifndef AIRPORT_DEFAULTS_H
11 #define AIRPORT_DEFAULTS_H
14 * Definition of an airport tiles layout.
15 * @param x offset x of this tile
16 * @param y offset y of this tile
17 * @param m StationGfx of the tile
19 * @see AirportTileTable
21 #define MK(x, y, m) {{x, y}, m}
24 * Terminator of airport tiles layout definition
26 #define MKEND {{-0x80, 0}, 0}
28 /** Tiles for Country Airfield (small) */
29 static const AirportTileTable _tile_table_country_0
[] = {
30 MK(0, 0, APT_SMALL_BUILDING_1
),
31 MK(1, 0, APT_SMALL_BUILDING_2
),
32 MK(2, 0, APT_SMALL_BUILDING_3
),
33 MK(3, 0, APT_SMALL_DEPOT_SE
),
34 MK(0, 1, APT_GRASS_FENCE_NE_FLAG
),
35 MK(1, 1, APT_GRASS_1
),
36 MK(2, 1, APT_GRASS_2
),
37 MK(3, 1, APT_GRASS_FENCE_SW
),
38 MK(0, 2, APT_RUNWAY_SMALL_FAR_END
),
39 MK(1, 2, APT_RUNWAY_SMALL_MIDDLE
),
40 MK(2, 2, APT_RUNWAY_SMALL_MIDDLE
),
41 MK(3, 2, APT_RUNWAY_SMALL_NEAR_END
),
45 static const AirportTileTable
* const _tile_table_country
[] = {
46 _tile_table_country_0
,
49 /** Tiles for Commuter Airfield (small) */
50 static const AirportTileTable _tile_table_commuter_0
[] = {
52 MK(1, 0, APT_BUILDING_3
),
53 MK(2, 0, APT_HELIPAD_2_FENCE_NW
),
54 MK(3, 0, APT_HELIPAD_2_FENCE_NW
),
55 MK(4, 0, APT_DEPOT_SE
),
56 MK(0, 1, APT_APRON_FENCE_NE
),
60 MK(4, 1, APT_APRON_FENCE_SW
),
61 MK(0, 2, APT_APRON_FENCE_NE
),
65 MK(4, 2, APT_APRON_FENCE_SW
),
66 MK(0, 3, APT_RUNWAY_END_FENCE_SE
),
67 MK(1, 3, APT_RUNWAY_2
),
68 MK(2, 3, APT_RUNWAY_2
),
69 MK(3, 3, APT_RUNWAY_2
),
70 MK(4, 3, APT_RUNWAY_END_FENCE_SE
),
74 static const AirportTileTable
* const _tile_table_commuter
[] = {
75 _tile_table_commuter_0
,
78 /** Tiles for City Airport (large) */
79 static const AirportTileTable _tile_table_city_0
[] = {
80 MK(0, 0, APT_BUILDING_1
),
81 MK(1, 0, APT_APRON_FENCE_NW
),
82 MK(2, 0, APT_STAND_1
),
83 MK(3, 0, APT_APRON_FENCE_NW
),
84 MK(4, 0, APT_APRON_FENCE_NW
),
85 MK(5, 0, APT_DEPOT_SE
),
86 MK(0, 1, APT_BUILDING_2
),
88 MK(2, 1, APT_ROUND_TERMINAL
),
89 MK(3, 1, APT_STAND_PIER_NE
),
91 MK(5, 1, APT_APRON_FENCE_SW
),
92 MK(0, 2, APT_BUILDING_3
),
94 MK(2, 2, APT_PIER_NW_NE
),
95 MK(3, 2, APT_APRON_S
),
96 MK(4, 2, APT_APRON_HOR
),
97 MK(5, 2, APT_APRON_N_FENCE_SW
),
98 MK(0, 3, APT_RADIO_TOWER_FENCE_NE
),
99 MK(1, 3, APT_APRON_W
),
100 MK(2, 3, APT_APRON_VER_CROSSING_S
),
101 MK(3, 3, APT_APRON_HOR_CROSSING_E
),
102 MK(4, 3, APT_ARPON_N
),
103 MK(5, 3, APT_TOWER_FENCE_SW
),
104 MK(0, 4, APT_EMPTY_FENCE_NE
),
105 MK(1, 4, APT_APRON_S
),
106 MK(2, 4, APT_APRON_HOR_CROSSING_W
),
107 MK(3, 4, APT_APRON_VER_CROSSING_N
),
108 MK(4, 4, APT_APRON_E
),
109 MK(5, 4, APT_RADAR_GRASS_FENCE_SW
),
110 MK(0, 5, APT_RUNWAY_END_FENCE_SE
),
111 MK(1, 5, APT_RUNWAY_1
),
112 MK(2, 5, APT_RUNWAY_2
),
113 MK(3, 5, APT_RUNWAY_3
),
114 MK(4, 5, APT_RUNWAY_4
),
115 MK(5, 5, APT_RUNWAY_END_FENCE_SE
),
119 static const AirportTileTable
* const _tile_table_city
[] = {
123 /** Tiles for Metropolitain Airport (large) - 2 runways */
124 static const AirportTileTable _tile_table_metropolitan_0
[] = {
125 MK(0, 0, APT_BUILDING_1
),
126 MK(1, 0, APT_APRON_FENCE_NW
),
127 MK(2, 0, APT_STAND_1
),
128 MK(3, 0, APT_APRON_FENCE_NW
),
129 MK(4, 0, APT_APRON_FENCE_NW
),
130 MK(5, 0, APT_DEPOT_SE
),
131 MK(0, 1, APT_BUILDING_2
),
133 MK(2, 1, APT_ROUND_TERMINAL
),
134 MK(3, 1, APT_STAND_PIER_NE
),
136 MK(5, 1, APT_APRON_FENCE_SW
),
137 MK(0, 2, APT_BUILDING_3
),
139 MK(2, 2, APT_PIER_NW_NE
),
140 MK(3, 2, APT_APRON_S
),
141 MK(4, 2, APT_APRON_HOR
),
142 MK(5, 2, APT_APRON_N_FENCE_SW
),
143 MK(0, 3, APT_RADAR_FENCE_NE
),
148 MK(5, 3, APT_TOWER_FENCE_SW
),
149 MK(0, 4, APT_RUNWAY_END
),
150 MK(1, 4, APT_RUNWAY_5
),
151 MK(2, 4, APT_RUNWAY_5
),
152 MK(3, 4, APT_RUNWAY_5
),
153 MK(4, 4, APT_RUNWAY_5
),
154 MK(5, 4, APT_RUNWAY_END
),
155 MK(0, 5, APT_RUNWAY_END_FENCE_SE
),
156 MK(1, 5, APT_RUNWAY_2
),
157 MK(2, 5, APT_RUNWAY_2
),
158 MK(3, 5, APT_RUNWAY_2
),
159 MK(4, 5, APT_RUNWAY_2
),
160 MK(5, 5, APT_RUNWAY_END_FENCE_SE
),
164 static const AirportTileTable
* const _tile_table_metropolitan
[] = {
165 _tile_table_metropolitan_0
,
168 /** Tiles for International Airport (large) - 2 runways */
169 static const AirportTileTable _tile_table_international_0
[] = {
170 MK(0, 0, APT_RUNWAY_END_FENCE_NW
),
171 MK(1, 0, APT_RUNWAY_FENCE_NW
),
172 MK(2, 0, APT_RUNWAY_FENCE_NW
),
173 MK(3, 0, APT_RUNWAY_FENCE_NW
),
174 MK(4, 0, APT_RUNWAY_FENCE_NW
),
175 MK(5, 0, APT_RUNWAY_FENCE_NW
),
176 MK(6, 0, APT_RUNWAY_END_FENCE_NW
),
177 MK(0, 1, APT_RADIO_TOWER_FENCE_NE
),
183 MK(6, 1, APT_DEPOT_SE
),
184 MK(0, 2, APT_BUILDING_3
),
187 MK(3, 2, APT_BUILDING_2
),
190 MK(6, 2, APT_APRON_FENCE_SW
),
191 MK(0, 3, APT_DEPOT_SE
),
194 MK(3, 3, APT_BUILDING_2
),
197 MK(6, 3, APT_HELIPAD_1
),
198 MK(0, 4, APT_APRON_FENCE_NE
),
204 MK(6, 4, APT_HELIPAD_1
),
205 MK(0, 5, APT_APRON_FENCE_NE
),
211 MK(6, 5, APT_RADAR_FENCE_SW
),
212 MK(0, 6, APT_RUNWAY_END_FENCE_SE
),
213 MK(1, 6, APT_RUNWAY_2
),
214 MK(2, 6, APT_RUNWAY_2
),
215 MK(3, 6, APT_RUNWAY_2
),
216 MK(4, 6, APT_RUNWAY_2
),
217 MK(5, 6, APT_RUNWAY_2
),
218 MK(6, 6, APT_RUNWAY_END_FENCE_SE
),
222 static const AirportTileTable
* const _tile_table_international
[] = {
223 _tile_table_international_0
,
226 /** Tiles for International Airport (large) - 2 runways */
227 static const AirportTileTable _tile_table_intercontinental_0
[] = {
228 MK(0, 0, APT_RADAR_FENCE_NE
),
229 MK(1, 0, APT_RUNWAY_END_FENCE_NE_NW
),
230 MK(2, 0, APT_RUNWAY_FENCE_NW
),
231 MK(3, 0, APT_RUNWAY_FENCE_NW
),
232 MK(4, 0, APT_RUNWAY_FENCE_NW
),
233 MK(5, 0, APT_RUNWAY_FENCE_NW
),
234 MK(6, 0, APT_RUNWAY_FENCE_NW
),
235 MK(7, 0, APT_RUNWAY_FENCE_NW
),
236 MK(8, 0, APT_RUNWAY_END_FENCE_NW_SW
),
237 MK(0, 1, APT_RUNWAY_END_FENCE_NE_NW
),
238 MK(1, 1, APT_RUNWAY_2
),
239 MK(2, 1, APT_RUNWAY_2
),
240 MK(3, 1, APT_RUNWAY_2
),
241 MK(4, 1, APT_RUNWAY_2
),
242 MK(5, 1, APT_RUNWAY_2
),
243 MK(6, 1, APT_RUNWAY_2
),
244 MK(7, 1, APT_RUNWAY_END_FENCE_SE_SW
),
245 MK(8, 1, APT_APRON_FENCE_NE_SW
),
246 MK(0, 2, APT_APRON_FENCE_NE_SW
),
248 MK(2, 2, APT_APRON_FENCE_NE
),
253 MK(7, 2, APT_RADIO_TOWER_FENCE_NE
),
254 MK(8, 2, APT_APRON_FENCE_NE_SW
),
255 MK(0, 3, APT_APRON_FENCE_NE
),
256 MK(1, 3, APT_APRON_HALF_EAST
),
257 MK(2, 3, APT_APRON_FENCE_NE
),
259 MK(4, 3, APT_HELIPAD_2
),
260 MK(5, 3, APT_HELIPAD_2
),
262 MK(7, 3, APT_APRON_FENCE_NW
),
263 MK(8, 3, APT_APRON_FENCE_SW
),
264 MK(0, 4, APT_APRON_FENCE_NE
),
268 MK(4, 4, APT_BUILDING_1
),
271 MK(7, 4, APT_LOW_BUILDING
),
272 MK(8, 4, APT_DEPOT_SE
),
273 MK(0, 5, APT_DEPOT_SE
),
274 MK(1, 5, APT_LOW_BUILDING
),
277 MK(4, 5, APT_BUILDING_2
),
281 MK(8, 5, APT_APRON_FENCE_SW
),
282 MK(0, 6, APT_APRON_FENCE_NE
),
286 MK(4, 6, APT_BUILDING_3
),
290 MK(8, 6, APT_APRON_FENCE_SW
),
291 MK(0, 7, APT_APRON_FENCE_NE
),
292 MK(1, 7, APT_APRON_FENCE_SE
),
295 MK(4, 7, APT_ROUND_TERMINAL
),
297 MK(6, 7, APT_APRON_FENCE_SW
),
298 MK(7, 7, APT_APRON_HALF_WEST
),
299 MK(8, 7, APT_APRON_FENCE_SW
),
300 MK(0, 8, APT_APRON_FENCE_NE
),
301 MK(1, 8, APT_GRASS_FENCE_NE_FLAG_2
),
302 MK(2, 8, APT_APRON_FENCE_NE
),
306 MK(6, 8, APT_APRON_FENCE_SW
),
308 MK(8, 8, APT_APRON_FENCE_NE_SW
),
309 MK(0, 9, APT_APRON_FENCE_NE
),
310 MK(1, 9, APT_RUNWAY_END_FENCE_NE_NW
),
311 MK(2, 9, APT_RUNWAY_FENCE_NW
),
312 MK(3, 9, APT_RUNWAY_FENCE_NW
),
313 MK(4, 9, APT_RUNWAY_FENCE_NW
),
314 MK(5, 9, APT_RUNWAY_FENCE_NW
),
315 MK(6, 9, APT_RUNWAY_FENCE_NW
),
316 MK(7, 9, APT_RUNWAY_FENCE_NW
),
317 MK(8, 9, APT_RUNWAY_END_FENCE_SE_SW
),
318 MK(0, 10, APT_RUNWAY_END_FENCE_NE_SE
),
319 MK(1, 10, APT_RUNWAY_2
),
320 MK(2, 10, APT_RUNWAY_2
),
321 MK(3, 10, APT_RUNWAY_2
),
322 MK(4, 10, APT_RUNWAY_2
),
323 MK(5, 10, APT_RUNWAY_2
),
324 MK(6, 10, APT_RUNWAY_2
),
325 MK(7, 10, APT_RUNWAY_END_FENCE_SE_SW
),
326 MK(8, 10, APT_EMPTY
),
330 static const AirportTileTable
* const _tile_table_intercontinental
[] = {
331 _tile_table_intercontinental_0
,
334 /** Tiles for Heliport */
335 static const AirportTileTable _tile_table_heliport_0
[] = {
336 MK(0, 0, APT_HELIPORT
),
340 static const AirportTileTable
* const _tile_table_heliport
[] = {
341 _tile_table_heliport_0
,
344 /** Tiles for Helidepot */
345 static const AirportTileTable _tile_table_helidepot_0
[] = {
346 MK(0, 0, APT_LOW_BUILDING_FENCE_N
),
347 MK(1, 0, APT_DEPOT_SE
),
348 MK(0, 1, APT_HELIPAD_2_FENCE_NE_SE
),
349 MK(1, 1, APT_APRON_FENCE_SE_SW
),
353 static const AirportTileTable
* const _tile_table_helidepot
[] = {
354 _tile_table_helidepot_0
,
357 /** Tiles for Helistation */
358 static const AirportTileTable _tile_table_helistation_0
[] = {
359 MK(0, 0, APT_DEPOT_SE
),
360 MK(1, 0, APT_LOW_BUILDING_FENCE_NW
),
361 MK(2, 0, APT_HELIPAD_3_FENCE_NW
),
362 MK(3, 0, APT_HELIPAD_3_FENCE_NW_SW
),
363 MK(0, 1, APT_APRON_FENCE_NE_SE
),
364 MK(1, 1, APT_APRON_FENCE_SE
),
365 MK(2, 1, APT_APRON_FENCE_SE
),
366 MK(3, 1, APT_HELIPAD_3_FENCE_SE_SW
),
370 static const AirportTileTable
* const _tile_table_helistation
[] = {
371 _tile_table_helistation_0
,
374 static const Direction _default_airports_rotation
[] = {
381 /** General AirportSpec definition. */
382 #define AS_GENERIC(fsm, att, rot, att_len, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, enabled) \
383 {fsm, att, rot, att_len, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, class_id, preview, maint_cost, enabled, GRFFileProps(AT_INVALID)}
385 /** AirportSpec definition for airports without any depot. */
386 #define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \
387 AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), nullptr, 0, \
388 size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true)
390 /** AirportSpec definition for airports with at least one depot. */
391 #define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \
392 AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), _airport_depots_##ap_name, lengthof(_airport_depots_##ap_name), \
393 size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true)
395 /* The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level */
396 extern const AirportSpec _origin_airport_specs
[] = {
397 AS(country
, 4, 3, 0, 1959, 4, 3, 7, ATP_TTDP_SMALL
, APC_SMALL
, STR_AIRPORT_SMALL
, SPR_AIRPORT_PREVIEW_SMALL
),
398 AS(city
, 6, 6, 1955, MAX_YEAR
, 5, 5, 24, ATP_TTDP_LARGE
, APC_LARGE
, STR_AIRPORT_CITY
, SPR_AIRPORT_PREVIEW_LARGE
),
399 AS_ND(heliport
, 1, 1, 1963, MAX_YEAR
, 4, 1, 4, ATP_TTDP_HELIPORT
, APC_HELIPORT
, STR_AIRPORT_HELIPORT
, SPR_AIRPORT_PREVIEW_HELIPORT
),
400 AS(metropolitan
, 6, 6, 1980, MAX_YEAR
, 6, 8, 28, ATP_TTDP_LARGE
, APC_LARGE
, STR_AIRPORT_METRO
, SPR_AIRPORT_PREVIEW_METROPOLITAN
),
401 AS(international
, 7, 7, 1990, MAX_YEAR
, 8, 17, 42, ATP_TTDP_LARGE
, APC_HUB
, STR_AIRPORT_INTERNATIONAL
, SPR_AIRPORT_PREVIEW_INTERNATIONAL
),
402 AS(commuter
, 5, 4, 1983, MAX_YEAR
, 4, 4, 20, ATP_TTDP_SMALL
, APC_SMALL
, STR_AIRPORT_COMMUTER
, SPR_AIRPORT_PREVIEW_COMMUTER
),
403 AS(helidepot
, 2, 2, 1976, MAX_YEAR
, 4, 2, 7, ATP_TTDP_SMALL
, APC_HELIPORT
, STR_AIRPORT_HELIDEPOT
, SPR_AIRPORT_PREVIEW_HELIDEPOT
),
404 AS(intercontinental
, 9, 11, 2002, MAX_YEAR
, 10, 25, 72, ATP_TTDP_LARGE
, APC_HUB
, STR_AIRPORT_INTERCONTINENTAL
, SPR_AIRPORT_PREVIEW_INTERCONTINENTAL
),
405 AS(helistation
, 4, 2, 1980, MAX_YEAR
, 4, 3, 14, ATP_TTDP_SMALL
, APC_HELIPORT
, STR_AIRPORT_HELISTATION
, SPR_AIRPORT_PREVIEW_HELISTATION
),
406 AS_GENERIC(&_airportfta_oilrig
, nullptr, _default_airports_rotation
, 0, nullptr, 0, 1, 1, 0, 4, 0, 0, 0, ATP_TTDP_OILRIG
, APC_HELIPORT
, STR_NULL
, 0, false),
409 assert_compile(NEW_AIRPORT_OFFSET
== lengthof(_origin_airport_specs
));
411 const AirportSpec
AirportSpec::dummy
= AS_GENERIC(&_airportfta_dummy
, nullptr, _default_airports_rotation
, 0, nullptr, 0, 0, 0, 0, 0, MIN_YEAR
, MIN_YEAR
, 0, ATP_TTDP_LARGE
, APC_BEGIN
, STR_NULL
, 0, false);
417 #endif /* AIRPORT_DEFAULTS_H */