1 /* $Id: airport_defaults.h 23415 2011-12-03 23:40:46Z michi_cc $ */
4 * This file is part of OpenTTD.
5 * 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.
6 * 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.
7 * 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/>.
10 /** @file airport_defaults.h Tables with default values for airports and airport tiles. */
12 #ifndef AIRPORT_DEFAULTS_H
13 #define AIRPORT_DEFAULTS_H
16 * Definition of an airport tiles layout.
17 * @param x offset x of this tile
18 * @param y offset y of this tile
19 * @param m StationGfx of the tile
21 * @see AirportTileTable
23 #define MK(x, y, m) {{x, y}, m}
26 * Terminator of airport tiles layout definition
28 #define MKEND {{-0x80, 0}, 0}
30 /** Tiles for Country Airfield (small) */
31 static const AirportTileTable _tile_table_country_0
[] = {
32 MK(0, 0, APT_SMALL_BUILDING_1
),
33 MK(1, 0, APT_SMALL_BUILDING_2
),
34 MK(2, 0, APT_SMALL_BUILDING_3
),
35 MK(3, 0, APT_SMALL_DEPOT_SE
),
36 MK(0, 1, APT_GRASS_FENCE_NE_FLAG
),
37 MK(1, 1, APT_GRASS_1
),
38 MK(2, 1, APT_GRASS_2
),
39 MK(3, 1, APT_GRASS_FENCE_SW
),
40 MK(0, 2, APT_RUNWAY_SMALL_FAR_END
),
41 MK(1, 2, APT_RUNWAY_SMALL_MIDDLE
),
42 MK(2, 2, APT_RUNWAY_SMALL_MIDDLE
),
43 MK(3, 2, APT_RUNWAY_SMALL_NEAR_END
),
47 static const AirportTileTable
* const _tile_table_country
[] = {
48 _tile_table_country_0
,
51 /** Tiles for Commuter Airfield (small) */
52 static const AirportTileTable _tile_table_commuter_0
[] = {
54 MK(1, 0, APT_BUILDING_3
),
55 MK(2, 0, APT_HELIPAD_2_FENCE_NW
),
56 MK(3, 0, APT_HELIPAD_2_FENCE_NW
),
57 MK(4, 0, APT_DEPOT_SE
),
58 MK(0, 1, APT_APRON_FENCE_NE
),
62 MK(4, 1, APT_APRON_FENCE_SW
),
63 MK(0, 2, APT_APRON_FENCE_NE
),
67 MK(4, 2, APT_APRON_FENCE_SW
),
68 MK(0, 3, APT_RUNWAY_END_FENCE_SE
),
69 MK(1, 3, APT_RUNWAY_2
),
70 MK(2, 3, APT_RUNWAY_2
),
71 MK(3, 3, APT_RUNWAY_2
),
72 MK(4, 3, APT_RUNWAY_END_FENCE_SE
),
76 static const AirportTileTable
* const _tile_table_commuter
[] = {
77 _tile_table_commuter_0
,
80 /** Tiles for City Airport (large) */
81 static const AirportTileTable _tile_table_city_0
[] = {
82 MK(0, 0, APT_BUILDING_1
),
83 MK(1, 0, APT_APRON_FENCE_NW
),
84 MK(2, 0, APT_STAND_1
),
85 MK(3, 0, APT_APRON_FENCE_NW
),
86 MK(4, 0, APT_APRON_FENCE_NW
),
87 MK(5, 0, APT_DEPOT_SE
),
88 MK(0, 1, APT_BUILDING_2
),
90 MK(2, 1, APT_ROUND_TERMINAL
),
91 MK(3, 1, APT_STAND_PIER_NE
),
93 MK(5, 1, APT_APRON_FENCE_SW
),
94 MK(0, 2, APT_BUILDING_3
),
96 MK(2, 2, APT_PIER_NW_NE
),
97 MK(3, 2, APT_APRON_S
),
98 MK(4, 2, APT_APRON_HOR
),
99 MK(5, 2, APT_APRON_N_FENCE_SW
),
100 MK(0, 3, APT_RADIO_TOWER_FENCE_NE
),
101 MK(1, 3, APT_APRON_W
),
102 MK(2, 3, APT_APRON_VER_CROSSING_S
),
103 MK(3, 3, APT_APRON_HOR_CROSSING_E
),
104 MK(4, 3, APT_ARPON_N
),
105 MK(5, 3, APT_TOWER_FENCE_SW
),
106 MK(0, 4, APT_EMPTY_FENCE_NE
),
107 MK(1, 4, APT_APRON_S
),
108 MK(2, 4, APT_APRON_HOR_CROSSING_W
),
109 MK(3, 4, APT_APRON_VER_CROSSING_N
),
110 MK(4, 4, APT_APRON_E
),
111 MK(5, 4, APT_RADAR_GRASS_FENCE_SW
),
112 MK(0, 5, APT_RUNWAY_END_FENCE_SE
),
113 MK(1, 5, APT_RUNWAY_1
),
114 MK(2, 5, APT_RUNWAY_2
),
115 MK(3, 5, APT_RUNWAY_3
),
116 MK(4, 5, APT_RUNWAY_4
),
117 MK(5, 5, APT_RUNWAY_END_FENCE_SE
),
121 static const AirportTileTable
* const _tile_table_city
[] = {
125 /** Tiles for Metropolitain Airport (large) - 2 runways */
126 static const AirportTileTable _tile_table_metropolitan_0
[] = {
127 MK(0, 0, APT_BUILDING_1
),
128 MK(1, 0, APT_APRON_FENCE_NW
),
129 MK(2, 0, APT_STAND_1
),
130 MK(3, 0, APT_APRON_FENCE_NW
),
131 MK(4, 0, APT_APRON_FENCE_NW
),
132 MK(5, 0, APT_DEPOT_SE
),
133 MK(0, 1, APT_BUILDING_2
),
135 MK(2, 1, APT_ROUND_TERMINAL
),
136 MK(3, 1, APT_STAND_PIER_NE
),
138 MK(5, 1, APT_APRON_FENCE_SW
),
139 MK(0, 2, APT_BUILDING_3
),
141 MK(2, 2, APT_PIER_NW_NE
),
142 MK(3, 2, APT_APRON_S
),
143 MK(4, 2, APT_APRON_HOR
),
144 MK(5, 2, APT_APRON_N_FENCE_SW
),
145 MK(0, 3, APT_RADAR_FENCE_NE
),
150 MK(5, 3, APT_TOWER_FENCE_SW
),
151 MK(0, 4, APT_RUNWAY_END
),
152 MK(1, 4, APT_RUNWAY_5
),
153 MK(2, 4, APT_RUNWAY_5
),
154 MK(3, 4, APT_RUNWAY_5
),
155 MK(4, 4, APT_RUNWAY_5
),
156 MK(5, 4, APT_RUNWAY_END
),
157 MK(0, 5, APT_RUNWAY_END_FENCE_SE
),
158 MK(1, 5, APT_RUNWAY_2
),
159 MK(2, 5, APT_RUNWAY_2
),
160 MK(3, 5, APT_RUNWAY_2
),
161 MK(4, 5, APT_RUNWAY_2
),
162 MK(5, 5, APT_RUNWAY_END_FENCE_SE
),
166 static const AirportTileTable
* const _tile_table_metropolitan
[] = {
167 _tile_table_metropolitan_0
,
170 /** Tiles for International Airport (large) - 2 runways */
171 static const AirportTileTable _tile_table_international_0
[] = {
172 MK(0, 0, APT_RUNWAY_END_FENCE_NW
),
173 MK(1, 0, APT_RUNWAY_FENCE_NW
),
174 MK(2, 0, APT_RUNWAY_FENCE_NW
),
175 MK(3, 0, APT_RUNWAY_FENCE_NW
),
176 MK(4, 0, APT_RUNWAY_FENCE_NW
),
177 MK(5, 0, APT_RUNWAY_FENCE_NW
),
178 MK(6, 0, APT_RUNWAY_END_FENCE_NW
),
179 MK(0, 1, APT_RADIO_TOWER_FENCE_NE
),
185 MK(6, 1, APT_DEPOT_SE
),
186 MK(0, 2, APT_BUILDING_3
),
189 MK(3, 2, APT_BUILDING_2
),
192 MK(6, 2, APT_APRON_FENCE_SW
),
193 MK(0, 3, APT_DEPOT_SE
),
196 MK(3, 3, APT_BUILDING_2
),
199 MK(6, 3, APT_HELIPAD_1
),
200 MK(0, 4, APT_APRON_FENCE_NE
),
206 MK(6, 4, APT_HELIPAD_1
),
207 MK(0, 5, APT_APRON_FENCE_NE
),
213 MK(6, 5, APT_RADAR_FENCE_SW
),
214 MK(0, 6, APT_RUNWAY_END_FENCE_SE
),
215 MK(1, 6, APT_RUNWAY_2
),
216 MK(2, 6, APT_RUNWAY_2
),
217 MK(3, 6, APT_RUNWAY_2
),
218 MK(4, 6, APT_RUNWAY_2
),
219 MK(5, 6, APT_RUNWAY_2
),
220 MK(6, 6, APT_RUNWAY_END_FENCE_SE
),
224 static const AirportTileTable
* const _tile_table_international
[] = {
225 _tile_table_international_0
,
228 /** Tiles for International Airport (large) - 2 runways */
229 static const AirportTileTable _tile_table_intercontinental_0
[] = {
230 MK(0, 0, APT_RADAR_FENCE_NE
),
231 MK(1, 0, APT_RUNWAY_END_FENCE_NE_NW
),
232 MK(2, 0, APT_RUNWAY_FENCE_NW
),
233 MK(3, 0, APT_RUNWAY_FENCE_NW
),
234 MK(4, 0, APT_RUNWAY_FENCE_NW
),
235 MK(5, 0, APT_RUNWAY_FENCE_NW
),
236 MK(6, 0, APT_RUNWAY_FENCE_NW
),
237 MK(7, 0, APT_RUNWAY_FENCE_NW
),
238 MK(8, 0, APT_RUNWAY_END_FENCE_NW_SW
),
239 MK(0, 1, APT_RUNWAY_END_FENCE_NE_NW
),
240 MK(1, 1, APT_RUNWAY_2
),
241 MK(2, 1, APT_RUNWAY_2
),
242 MK(3, 1, APT_RUNWAY_2
),
243 MK(4, 1, APT_RUNWAY_2
),
244 MK(5, 1, APT_RUNWAY_2
),
245 MK(6, 1, APT_RUNWAY_2
),
246 MK(7, 1, APT_RUNWAY_END_FENCE_SE_SW
),
247 MK(8, 1, APT_APRON_FENCE_NE_SW
),
248 MK(0, 2, APT_APRON_FENCE_NE_SW
),
250 MK(2, 2, APT_APRON_FENCE_NE
),
255 MK(7, 2, APT_RADIO_TOWER_FENCE_NE
),
256 MK(8, 2, APT_APRON_FENCE_NE_SW
),
257 MK(0, 3, APT_APRON_FENCE_NE
),
258 MK(1, 3, APT_APRON_HALF_EAST
),
259 MK(2, 3, APT_APRON_FENCE_NE
),
261 MK(4, 3, APT_HELIPAD_2
),
262 MK(5, 3, APT_HELIPAD_2
),
264 MK(7, 3, APT_APRON_FENCE_NW
),
265 MK(8, 3, APT_APRON_FENCE_SW
),
266 MK(0, 4, APT_APRON_FENCE_NE
),
270 MK(4, 4, APT_BUILDING_1
),
273 MK(7, 4, APT_LOW_BUILDING
),
274 MK(8, 4, APT_DEPOT_SE
),
275 MK(0, 5, APT_DEPOT_SE
),
276 MK(1, 5, APT_LOW_BUILDING
),
279 MK(4, 5, APT_BUILDING_2
),
283 MK(8, 5, APT_APRON_FENCE_SW
),
284 MK(0, 6, APT_APRON_FENCE_NE
),
288 MK(4, 6, APT_BUILDING_3
),
292 MK(8, 6, APT_APRON_FENCE_SW
),
293 MK(0, 7, APT_APRON_FENCE_NE
),
294 MK(1, 7, APT_APRON_FENCE_SE
),
297 MK(4, 7, APT_ROUND_TERMINAL
),
299 MK(6, 7, APT_APRON_FENCE_SW
),
300 MK(7, 7, APT_APRON_HALF_WEST
),
301 MK(8, 7, APT_APRON_FENCE_SW
),
302 MK(0, 8, APT_APRON_FENCE_NE
),
303 MK(1, 8, APT_GRASS_FENCE_NE_FLAG_2
),
304 MK(2, 8, APT_APRON_FENCE_NE
),
308 MK(6, 8, APT_APRON_FENCE_SW
),
310 MK(8, 8, APT_APRON_FENCE_NE_SW
),
311 MK(0, 9, APT_APRON_FENCE_NE
),
312 MK(1, 9, APT_RUNWAY_END_FENCE_NE_NW
),
313 MK(2, 9, APT_RUNWAY_FENCE_NW
),
314 MK(3, 9, APT_RUNWAY_FENCE_NW
),
315 MK(4, 9, APT_RUNWAY_FENCE_NW
),
316 MK(5, 9, APT_RUNWAY_FENCE_NW
),
317 MK(6, 9, APT_RUNWAY_FENCE_NW
),
318 MK(7, 9, APT_RUNWAY_FENCE_NW
),
319 MK(8, 9, APT_RUNWAY_END_FENCE_SE_SW
),
320 MK(0, 10, APT_RUNWAY_END_FENCE_NE_SE
),
321 MK(1, 10, APT_RUNWAY_2
),
322 MK(2, 10, APT_RUNWAY_2
),
323 MK(3, 10, APT_RUNWAY_2
),
324 MK(4, 10, APT_RUNWAY_2
),
325 MK(5, 10, APT_RUNWAY_2
),
326 MK(6, 10, APT_RUNWAY_2
),
327 MK(7, 10, APT_RUNWAY_END_FENCE_SE_SW
),
328 MK(8, 10, APT_EMPTY
),
332 static const AirportTileTable
* const _tile_table_intercontinental
[] = {
333 _tile_table_intercontinental_0
,
336 /** Tiles for Heliport */
337 static const AirportTileTable _tile_table_heliport_0
[] = {
338 MK(0, 0, APT_HELIPORT
),
342 static const AirportTileTable
* const _tile_table_heliport
[] = {
343 _tile_table_heliport_0
,
346 /** Tiles for Helidepot */
347 static const AirportTileTable _tile_table_helidepot_0
[] = {
348 MK(0, 0, APT_LOW_BUILDING_FENCE_N
),
349 MK(1, 0, APT_DEPOT_SE
),
350 MK(0, 1, APT_HELIPAD_2_FENCE_NE_SE
),
351 MK(1, 1, APT_APRON_FENCE_SE_SW
),
355 static const AirportTileTable
* const _tile_table_helidepot
[] = {
356 _tile_table_helidepot_0
,
359 /** Tiles for Helistation */
360 static const AirportTileTable _tile_table_helistation_0
[] = {
361 MK(0, 0, APT_DEPOT_SE
),
362 MK(1, 0, APT_LOW_BUILDING_FENCE_NW
),
363 MK(2, 0, APT_HELIPAD_3_FENCE_NW
),
364 MK(3, 0, APT_HELIPAD_3_FENCE_NW_SW
),
365 MK(0, 1, APT_APRON_FENCE_NE_SE
),
366 MK(1, 1, APT_APRON_FENCE_SE
),
367 MK(2, 1, APT_APRON_FENCE_SE
),
368 MK(3, 1, APT_HELIPAD_3_FENCE_SE_SW
),
372 static const AirportTileTable
* const _tile_table_helistation
[] = {
373 _tile_table_helistation_0
,
376 static const Direction _default_airports_rotation
[] = {
383 /** General AirportSpec definition. */
384 #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) \
385 {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)}
387 /** AirportSpec definition for airports without any depot. */
388 #define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \
389 AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _default_airports_rotation, lengthof(_tile_table_##ap_name), nullptr, 0, \
390 size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true)
392 /** AirportSpec definition for airports with at least one depot. */
393 #define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise, maint_cost, ttdpatch_type, class_id, name, preview) \
394 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), \
395 size_x, size_y, noise, catchment, min_year, max_year, maint_cost, ttdpatch_type, class_id, name, preview, true)
397 /* The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level */
398 extern const AirportSpec _origin_airport_specs
[] = {
399 AS(country
, 4, 3, 0, 1959, 4, 3, 7, ATP_TTDP_SMALL
, APC_SMALL
, STR_AIRPORT_SMALL
, SPR_AIRPORT_PREVIEW_SMALL
),
400 AS(city
, 6, 6, 1955, MAX_YEAR
, 5, 5, 24, ATP_TTDP_LARGE
, APC_LARGE
, STR_AIRPORT_CITY
, SPR_AIRPORT_PREVIEW_LARGE
),
401 AS_ND(heliport
, 1, 1, 1963, MAX_YEAR
, 4, 1, 4, ATP_TTDP_HELIPORT
, APC_HELIPORT
, STR_AIRPORT_HELIPORT
, SPR_AIRPORT_PREVIEW_HELIPORT
),
402 AS(metropolitan
, 6, 6, 1980, MAX_YEAR
, 6, 8, 28, ATP_TTDP_LARGE
, APC_LARGE
, STR_AIRPORT_METRO
, SPR_AIRPORT_PREVIEW_METROPOLITAN
),
403 AS(international
, 7, 7, 1990, MAX_YEAR
, 8, 17, 42, ATP_TTDP_LARGE
, APC_HUB
, STR_AIRPORT_INTERNATIONAL
, SPR_AIRPORT_PREVIEW_INTERNATIONAL
),
404 AS(commuter
, 5, 4, 1983, MAX_YEAR
, 4, 4, 20, ATP_TTDP_SMALL
, APC_SMALL
, STR_AIRPORT_COMMUTER
, SPR_AIRPORT_PREVIEW_COMMUTER
),
405 AS(helidepot
, 2, 2, 1976, MAX_YEAR
, 4, 2, 7, ATP_TTDP_SMALL
, APC_HELIPORT
, STR_AIRPORT_HELIDEPOT
, SPR_AIRPORT_PREVIEW_HELIDEPOT
),
406 AS(intercontinental
, 9, 11, 2002, MAX_YEAR
, 10, 25, 72, ATP_TTDP_LARGE
, APC_HUB
, STR_AIRPORT_INTERCONTINENTAL
, SPR_AIRPORT_PREVIEW_INTERCONTINENTAL
),
407 AS(helistation
, 4, 2, 1980, MAX_YEAR
, 4, 3, 14, ATP_TTDP_SMALL
, APC_HELIPORT
, STR_AIRPORT_HELISTATION
, SPR_AIRPORT_PREVIEW_HELISTATION
),
408 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),
411 assert_compile(NEW_AIRPORT_OFFSET
== lengthof(_origin_airport_specs
));
413 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);
419 #endif /* AIRPORT_DEFAULTS_H */