# airport_defaults.h

Go to the documentation of this file.

    00001 /* $Id: airport_defaults.h 19023 2010-02-05 21:49:56Z rubidium $ */
    00002
    00003 /*
    00004  * This file is part of OpenTTD.
    00005  * 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.
    00006  * 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.
    00007  * 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/>.
    00008  */
    00009
    00012 #ifndef AIRPORT_DEFAULTS_H
    00013 #define AIRPORT_DEFAULTS_H
    00014
    00023 #define MK(x, y, m) {{x, y}, m}
    00024
    00028 #define MKEND {{-0x80, 0}, 0}
    00029
    00031 static AirportTileTable _tile_table_country_0[] = {
    00032   MK(0, 0, APT_SMALL_BUILDING_1),
    00033   MK(1, 0, APT_SMALL_BUILDING_2),
    00034   MK(2, 0, APT_SMALL_BUILDING_3),
    00035   MK(3, 0, APT_SMALL_DEPOT_SE),
    00036   MK(0, 1, APT_GRASS_FENCE_NE_FLAG),
    00037   MK(1, 1, APT_GRASS_1),
    00038   MK(2, 1, APT_GRASS_2),
    00039   MK(3, 1, APT_GRASS_FENCE_SW),
    00040   MK(0, 2, APT_RUNWAY_SMALL_FAR_END),
    00041   MK(1, 2, APT_RUNWAY_SMALL_MIDDLE),
    00042   MK(2, 2, APT_RUNWAY_SMALL_MIDDLE),
    00043   MK(3, 2, APT_RUNWAY_SMALL_NEAR_END),
    00044   MKEND
    00045 };
    00046
    00047 static AirportTileTable *_tile_table_country[] = {
    00048   _tile_table_country_0,
    00049 };
    00050
    00052 static AirportTileTable _tile_table_commuter_0[] = {
    00053   MK(0, 0, APT_TOWER),
    00054   MK(1, 0, APT_BUILDING_3),
    00055   MK(2, 0, APT_HELIPAD_2_FENCE_NW),
    00056   MK(3, 0, APT_HELIPAD_2_FENCE_NW),
    00057   MK(4, 0, APT_DEPOT_SE),
    00058   MK(0, 1, APT_APRON_FENCE_NE),
    00059   MK(1, 1, APT_APRON),
    00060   MK(2, 1, APT_APRON),
    00061   MK(3, 1, APT_APRON),
    00062   MK(4, 1, APT_APRON_FENCE_SW),
    00063   MK(0, 2, APT_APRON_FENCE_NE),
    00064   MK(1, 2, APT_STAND),
    00065   MK(2, 2, APT_STAND),
    00066   MK(3, 2, APT_STAND),
    00067   MK(4, 2, APT_APRON_FENCE_SW),
    00068   MK(0, 3, APT_RUNWAY_END_FENCE_SE),
    00069   MK(1, 3, APT_RUNWAY_2),
    00070   MK(2, 3, APT_RUNWAY_2),
    00071   MK(3, 3, APT_RUNWAY_2),
    00072   MK(4, 3, APT_RUNWAY_END_FENCE_SE),
    00073   MKEND
    00074 };
    00075
    00076 static AirportTileTable *_tile_table_commuter[] = {
    00077   _tile_table_commuter_0,
    00078 };
    00079
    00081 static AirportTileTable _tile_table_city_0[] = {
    00082   MK(0, 0, APT_BUILDING_1),
    00083   MK(1, 0, APT_APRON_FENCE_NW),
    00084   MK(2, 0, APT_STAND_1),
    00085   MK(3, 0, APT_APRON_FENCE_NW),
    00086   MK(4, 0, APT_APRON_FENCE_NW),
    00087   MK(5, 0, APT_DEPOT_SE),
    00088   MK(0, 1, APT_BUILDING_2),
    00089   MK(1, 1, APT_PIER),
    00090   MK(2, 1, APT_ROUND_TERMINAL),
    00091   MK(3, 1, APT_STAND_PIER_NE),
    00092   MK(4, 1, APT_APRON),
    00093   MK(5, 1, APT_APRON_FENCE_SW),
    00094   MK(0, 2, APT_BUILDING_3),
    00095   MK(1, 2, APT_STAND),
    00096   MK(2, 2, APT_PIER_NW_NE),
    00097   MK(3, 2, APT_APRON_S),
    00098   MK(4, 2, APT_APRON_HOR),
    00099   MK(5, 2, APT_APRON_N_FENCE_SW),
    00100   MK(0, 3, APT_RADIO_TOWER_FENCE_NE),
    00101   MK(1, 3, APT_APRON_W),
    00102   MK(2, 3, APT_APRON_VER_CROSSING_S),
    00103   MK(3, 3, APT_APRON_HOR_CROSSING_E),
    00104   MK(4, 3, APT_ARPON_N),
    00105   MK(5, 3, APT_TOWER_FENCE_SW),
    00106   MK(0, 4, APT_EMPTY_FENCE_NE),
    00107   MK(1, 4, APT_APRON_S),
    00108   MK(2, 4, APT_APRON_HOR_CROSSING_W),
    00109   MK(3, 4, APT_APRON_VER_CROSSING_N),
    00110   MK(4, 4, APT_APRON_E),
    00111   MK(5, 4, APT_RADAR_GRASS_FENCE_SW),
    00112   MK(0, 5, APT_RUNWAY_END_FENCE_SE),
    00113   MK(1, 5, APT_RUNWAY_1),
    00114   MK(2, 5, APT_RUNWAY_2),
    00115   MK(3, 5, APT_RUNWAY_3),
    00116   MK(4, 5, APT_RUNWAY_4),
    00117   MK(5, 5, APT_RUNWAY_END_FENCE_SE),
    00118   MKEND
    00119 };
    00120
    00121 static AirportTileTable *_tile_table_city[] = {
    00122   _tile_table_city_0,
    00123 };
    00124
    00126 static AirportTileTable _tile_table_metropolitan_0[] = {
    00127   MK(0, 0, APT_BUILDING_1),
    00128   MK(1, 0, APT_APRON_FENCE_NW),
    00129   MK(2, 0, APT_STAND_1),
    00130   MK(3, 0, APT_APRON_FENCE_NW),
    00131   MK(4, 0, APT_APRON_FENCE_NW),
    00132   MK(5, 0, APT_DEPOT_SE),
    00133   MK(0, 1, APT_BUILDING_2),
    00134   MK(1, 1, APT_PIER),
    00135   MK(2, 1, APT_ROUND_TERMINAL),
    00136   MK(3, 1, APT_STAND_PIER_NE),
    00137   MK(4, 1, APT_APRON),
    00138   MK(5, 1, APT_APRON_FENCE_SW),
    00139   MK(0, 2, APT_BUILDING_3),
    00140   MK(1, 2, APT_STAND),
    00141   MK(2, 2, APT_PIER_NW_NE),
    00142   MK(3, 2, APT_APRON_S),
    00143   MK(4, 2, APT_APRON_HOR),
    00144   MK(5, 2, APT_APRON_N_FENCE_SW),
    00145   MK(0, 3, APT_RADAR_FENCE_NE),
    00146   MK(1, 3, APT_APRON),
    00147   MK(2, 3, APT_APRON),
    00148   MK(3, 3, APT_APRON),
    00149   MK(4, 3, APT_APRON),
    00150   MK(5, 3, APT_TOWER_FENCE_SW),
    00151   MK(0, 4, APT_RUNWAY_END),
    00152   MK(1, 4, APT_RUNWAY_5),
    00153   MK(2, 4, APT_RUNWAY_5),
    00154   MK(3, 4, APT_RUNWAY_5),
    00155   MK(4, 4, APT_RUNWAY_5),
    00156   MK(5, 4, APT_RUNWAY_END),
    00157   MK(0, 5, APT_RUNWAY_END_FENCE_SE),
    00158   MK(1, 5, APT_RUNWAY_2),
    00159   MK(2, 5, APT_RUNWAY_2),
    00160   MK(3, 5, APT_RUNWAY_2),
    00161   MK(4, 5, APT_RUNWAY_2),
    00162   MK(5, 5, APT_RUNWAY_END_FENCE_SE),
    00163   MKEND
    00164 };
    00165
    00166 static AirportTileTable *_tile_table_metropolitan[] = {
    00167   _tile_table_metropolitan_0,
    00168 };
    00169
    00171 static AirportTileTable _tile_table_international_0[] = {
    00172   MK(0, 0, APT_RUNWAY_END_FENCE_NW),
    00173   MK(1, 0, APT_RUNWAY_FENCE_NW),
    00174   MK(2, 0, APT_RUNWAY_FENCE_NW),
    00175   MK(3, 0, APT_RUNWAY_FENCE_NW),
    00176   MK(4, 0, APT_RUNWAY_FENCE_NW),
    00177   MK(5, 0, APT_RUNWAY_FENCE_NW),
    00178   MK(6, 0, APT_RUNWAY_END_FENCE_NW),
    00179   MK(0, 1, APT_RADIO_TOWER_FENCE_NE),
    00180   MK(1, 1, APT_APRON),
    00181   MK(2, 1, APT_APRON),
    00182   MK(3, 1, APT_APRON),
    00183   MK(4, 1, APT_APRON),
    00184   MK(5, 1, APT_APRON),
    00185   MK(6, 1, APT_DEPOT_SE),
    00186   MK(0, 2, APT_BUILDING_3),
    00187   MK(1, 2, APT_APRON),
    00188   MK(2, 2, APT_STAND),
    00189   MK(3, 2, APT_BUILDING_2),
    00190   MK(4, 2, APT_STAND),
    00191   MK(5, 2, APT_APRON),
    00192   MK(6, 2, APT_APRON_FENCE_SW),
    00193   MK(0, 3, APT_DEPOT_SE),
    00194   MK(1, 3, APT_APRON),
    00195   MK(2, 3, APT_STAND),
    00196   MK(3, 3, APT_BUILDING_2),
    00197   MK(4, 3, APT_STAND),
    00198   MK(5, 3, APT_APRON),
    00199   MK(6, 3, APT_HELIPAD_1),
    00200   MK(0, 4, APT_APRON_FENCE_NE),
    00201   MK(1, 4, APT_APRON),
    00202   MK(2, 4, APT_STAND),
    00203   MK(3, 4, APT_TOWER),
    00204   MK(4, 4, APT_STAND),
    00205   MK(5, 4, APT_APRON),
    00206   MK(6, 4, APT_HELIPAD_1),
    00207   MK(0, 5, APT_APRON_FENCE_NE),
    00208   MK(1, 5, APT_APRON),
    00209   MK(2, 5, APT_APRON),
    00210   MK(3, 5, APT_APRON),
    00211   MK(4, 5, APT_APRON),
    00212   MK(5, 5, APT_APRON),
    00213   MK(6, 5, APT_RADAR_FENCE_SW),
    00214   MK(0, 6, APT_RUNWAY_END_FENCE_SE),
    00215   MK(1, 6, APT_RUNWAY_2),
    00216   MK(2, 6, APT_RUNWAY_2),
    00217   MK(3, 6, APT_RUNWAY_2),
    00218   MK(4, 6, APT_RUNWAY_2),
    00219   MK(5, 6, APT_RUNWAY_2),
    00220   MK(6, 6, APT_RUNWAY_END_FENCE_SE),
    00221   MKEND
    00222 };
    00223
    00224 static AirportTileTable *_tile_table_international[] = {
    00225   _tile_table_international_0,
    00226 };
    00227
    00229 static AirportTileTable _tile_table_intercontinental_0[] = {
    00230   MK(0, 0, APT_RADAR_FENCE_NE),
    00231   MK(1, 0, APT_RUNWAY_END_FENCE_NE_NW),
    00232   MK(2, 0, APT_RUNWAY_FENCE_NW),
    00233   MK(3, 0, APT_RUNWAY_FENCE_NW),
    00234   MK(4, 0, APT_RUNWAY_FENCE_NW),
    00235   MK(5, 0, APT_RUNWAY_FENCE_NW),
    00236   MK(6, 0, APT_RUNWAY_FENCE_NW),
    00237   MK(7, 0, APT_RUNWAY_FENCE_NW),
    00238   MK(8, 0, APT_RUNWAY_END_FENCE_NW_SW),
    00239   MK(0, 1, APT_RUNWAY_END_FENCE_NE_NW),
    00240   MK(1, 1, APT_RUNWAY_2),
    00241   MK(2, 1, APT_RUNWAY_2),
    00242   MK(3, 1, APT_RUNWAY_2),
    00243   MK(4, 1, APT_RUNWAY_2),
    00244   MK(5, 1, APT_RUNWAY_2),
    00245   MK(6, 1, APT_RUNWAY_2),
    00246   MK(7, 1, APT_RUNWAY_END_FENCE_SE_SW),
    00247   MK(8, 1, APT_APRON_FENCE_NE_SW),
    00248   MK(0, 2, APT_APRON_FENCE_NE),
    00249   MK(1, 2, APT_SMALL_BUILDING_1),
    00250   MK(2, 2, APT_APRON_FENCE_NE),
    00251   MK(3, 2, APT_APRON),
    00252   MK(4, 2, APT_APRON),
    00253   MK(5, 2, APT_APRON),
    00254   MK(6, 2, APT_APRON),
    00255   MK(7, 2, APT_RADIO_TOWER_FENCE_NE),
    00256   MK(8, 2, APT_APRON_FENCE_NE_SW),
    00257   MK(0, 3, APT_APRON_FENCE_NE),
    00258   MK(1, 3, APT_APRON_HALF_EAST),
    00259   MK(2, 3, APT_APRON_FENCE_NE),
    00260   MK(3, 3, APT_TOWER),
    00261   MK(4, 3, APT_HELIPAD_2),
    00262   MK(5, 3, APT_HELIPAD_2),
    00263   MK(6, 3, APT_APRON),
    00264   MK(7, 3, APT_APRON_FENCE_NW),
    00265   MK(8, 3, APT_APRON_FENCE_SW),
    00266   MK(0, 4, APT_APRON_FENCE_NE),
    00267   MK(1, 4, APT_APRON),
    00268   MK(2, 4, APT_APRON),
    00269   MK(3, 4, APT_STAND),
    00270   MK(4, 4, APT_BUILDING_1),
    00271   MK(5, 4, APT_STAND),
    00272   MK(6, 4, APT_APRON),
    00273   MK(7, 4, APT_LOW_BUILDING),
    00274   MK(8, 4, APT_DEPOT_SE),
    00275   MK(0, 5, APT_DEPOT_SE),
    00276   MK(1, 5, APT_LOW_BUILDING),
    00277   MK(2, 5, APT_APRON),
    00278   MK(3, 5, APT_STAND),
    00279   MK(4, 5, APT_BUILDING_2),
    00280   MK(5, 5, APT_STAND),
    00281   MK(6, 5, APT_APRON),
    00282   MK(7, 5, APT_APRON),
    00283   MK(8, 5, APT_APRON_FENCE_SW),
    00284   MK(0, 6, APT_APRON_FENCE_NE),
    00285   MK(1, 6, APT_APRON),
    00286   MK(2, 6, APT_APRON),
    00287   MK(3, 6, APT_STAND),
    00288   MK(4, 6, APT_BUILDING_3),
    00289   MK(5, 6, APT_STAND),
    00290   MK(6, 6, APT_APRON),
    00291   MK(7, 6, APT_APRON),
    00292   MK(8, 6, APT_APRON_FENCE_SW),
    00293   MK(0, 7, APT_APRON_FENCE_NE),
    00294   MK(1, 7, APT_APRON_FENCE_SE),
    00295   MK(2, 7, APT_APRON),
    00296   MK(3, 7, APT_STAND),
    00297   MK(4, 7, APT_ROUND_TERMINAL),
    00298   MK(5, 7, APT_STAND),
    00299   MK(6, 7, APT_APRON_FENCE_SW),
    00300   MK(7, 7, APT_APRON_HALF_WEST),
    00301   MK(8, 7, APT_APRON_FENCE_SW),
    00302   MK(0, 8, APT_APRON_FENCE_NE),
    00303   MK(1, 8, APT_GRASS_FENCE_NE_FLAG_2),
    00304   MK(2, 8, APT_APRON_FENCE_NE),
    00305   MK(3, 8, APT_APRON),
    00306   MK(4, 8, APT_APRON),
    00307   MK(5, 8, APT_APRON),
    00308   MK(6, 8, APT_APRON_FENCE_SW),
    00309   MK(7, 8, APT_EMPTY),
    00310   MK(8, 8, APT_APRON_FENCE_NE_SW),
    00311   MK(0, 9, APT_APRON_FENCE_NE),
    00312   MK(1, 9, APT_RUNWAY_END_FENCE_NE_NW),
    00313   MK(2, 9, APT_RUNWAY_FENCE_NW),
    00314   MK(3, 9, APT_RUNWAY_FENCE_NW),
    00315   MK(4, 9, APT_RUNWAY_FENCE_NW),
    00316   MK(5, 9, APT_RUNWAY_FENCE_NW),
    00317   MK(6, 9, APT_RUNWAY_FENCE_NW),
    00318   MK(7, 9, APT_RUNWAY_FENCE_NW),
    00319   MK(8, 9, APT_RUNWAY_END_FENCE_SE_SW),
    00320   MK(0, 10, APT_RUNWAY_END_FENCE_NE_SE),
    00321   MK(1, 10, APT_RUNWAY_2),
    00322   MK(2, 10, APT_RUNWAY_2),
    00323   MK(3, 10, APT_RUNWAY_2),
    00324   MK(4, 10, APT_RUNWAY_2),
    00325   MK(5, 10, APT_RUNWAY_2),
    00326   MK(6, 10, APT_RUNWAY_2),
    00327   MK(7, 10, APT_RUNWAY_END_FENCE_SE_SW),
    00328   MK(8, 10, APT_EMPTY),
    00329   MKEND
    00330 };
    00331
    00332 static AirportTileTable *_tile_table_intercontinental[] = {
    00333   _tile_table_intercontinental_0,
    00334 };
    00335
    00337 static AirportTileTable _tile_table_heliport_0[] = {
    00338   MK(0, 0, APT_HELIPORT),
    00339   MKEND
    00340 };
    00341
    00342 static AirportTileTable *_tile_table_heliport[] = {
    00343   _tile_table_heliport_0,
    00344 };
    00345
    00347 static AirportTileTable _tile_table_helidepot_0[] = {
    00348   MK(0, 0, APT_LOW_BUILDING_FENCE_N),
    00349   MK(1, 0, APT_DEPOT_SE),
    00350   MK(0, 1, APT_HELIPAD_2_FENCE_NE_SE),
    00351   MK(1, 1, APT_APRON_FENCE_SE_SW),
    00352   MKEND
    00353 };
    00354
    00355 static AirportTileTable *_tile_table_helidepot[] = {
    00356   _tile_table_helidepot_0,
    00357 };
    00358
    00360 static AirportTileTable _tile_table_helistation_0[] = {
    00361   MK(0, 0, APT_DEPOT_SE),
    00362   MK(1, 0, APT_LOW_BUILDING_FENCE_NW),
    00363   MK(2, 0, APT_HELIPAD_3_FENCE_NW),
    00364   MK(3, 0, APT_HELIPAD_3_FENCE_NW_SW),
    00365   MK(0, 1, APT_APRON_FENCE_NE_SE),
    00366   MK(1, 1, APT_APRON_FENCE_SE),
    00367   MK(2, 1, APT_APRON_FENCE_SE),
    00368   MK(3, 1, APT_HELIPAD_3_FENCE_SE_SW),
    00369   MKEND
    00370 };
    00371
    00372 static AirportTileTable *_tile_table_helistation[] = {
    00373   _tile_table_helistation_0,
    00374 };
    00375
    00376 #undef MK
    00377 #undef MKEND
    00378
    00380 #define AS_GENERIC(att, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year) \
    00381   {att, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year}
    00382
    00384 #define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise) \
    00385   AS_GENERIC(_tile_table_##ap_name, NULL, 0, size_x, size_y, noise, catchment, min_year, max_year)
    00386
    00388 #define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise) \
    00389   AS_GENERIC(_tile_table_##ap_name, _airport_depots_##ap_name, lengthof(_airport_depots_##ap_name), size_x, size_y, noise, catchment, min_year, max_year)
    00390
    00391 static const AirportSpec _origin_airport_specs[] = {
    00392   AS(country, 4, 3, 0, 1959, 4, 3),
    00393   AS(city, 6, 6, 1955, MAX_YEAR, 5, 5),
    00394   AS_ND(heliport, 1, 1, 1963, MAX_YEAR, 4, 1),
    00395   AS(metropolitan, 6, 6, 1980, MAX_YEAR, 6, 8),
    00396   AS(international, 7, 7, 1990, MAX_YEAR, 8, 17),
    00397   AS(commuter, 5, 4, 1983, MAX_YEAR, 4, 4),
    00398   AS(helidepot, 2, 2, 1976, MAX_YEAR, 4, 2),
    00399   AS(intercontinental, 9, 11, 2002, MAX_YEAR, 10, 25),
    00400   AS(helistation, 4, 2, 1980, MAX_YEAR, 4, 3),
    00401 };
    00402
    00403 assert_compile(NUM_AIRPORTS == lengthof(_origin_airport_specs));
    00404
    00405 #undef AS
    00406 #undef AS_ND
    00407 #undef AS_GENERIC
    00408
    00409 #endif /* AIRPORT_DEFAULTS_H */