# HG changeset patch # User richk # Date 1175032718 0 # Node ID b25cf31294e9fb4473893e7bf2bc4588b130e40c # Parent bbe3f6d2dcaf27eb66a27e1867217795aa0913ec (svn r9510) [NewGRF_ports] -Codechange: Moved airport layouts from station_cmd.cpp into table/station_air.h. Ultimately, these layouts should be provided by a newgrf. diff -r bbe3f6d2dcaf -r b25cf31294e9 projects/openttd.vcproj --- a/projects/openttd.vcproj Tue Mar 27 21:18:53 2007 +0000 +++ b/projects/openttd.vcproj Tue Mar 27 21:58:38 2007 +0000 @@ -873,6 +873,9 @@ RelativePath=".\..\src\table\sprites.h"> + + + + diff -r bbe3f6d2dcaf -r b25cf31294e9 source.list --- a/source.list Tue Mar 27 21:18:53 2007 +0000 +++ b/source.list Tue Mar 27 21:58:38 2007 +0000 @@ -260,6 +260,7 @@ table/road_land.h table/roadveh.h table/sprites.h +table/station_air.h table/station_land.h table/strings.h table/town_land.h diff -r bbe3f6d2dcaf -r b25cf31294e9 src/station_cmd.cpp --- a/src/station_cmd.cpp Tue Mar 27 21:18:53 2007 +0000 +++ b/src/station_cmd.cpp Tue Mar 27 21:58:38 2007 +0000 @@ -39,6 +39,7 @@ #include "misc/autoptr.hpp" #include "road.h" #include "cargotype.h" +#include "table/station_air.h" /** * Called if a new block is added to the station-pool @@ -1368,98 +1369,6 @@ return ret; } -// FIXME -- need to move to its corresponding Airport variable -// Country Airfield (small) -static const byte _airport_sections_country[] = { - 54, 53, 52, 65, - 58, 57, 56, 55, - 64, 63, 63, 62 -}; - -// City Airport (large) -static const byte _airport_sections_town[] = { - 31, 9, 33, 9, 9, 32, - 27, 36, 29, 34, 8, 10, - 30, 11, 35, 13, 20, 21, - 51, 12, 14, 17, 19, 28, - 38, 13, 15, 16, 18, 39, - 26, 22, 23, 24, 25, 26 -}; - -// Metropolitain Airport (large) - 2 runways -static const byte _airport_sections_metropolitan[] = { - 31, 9, 33, 9, 9, 32, - 27, 36, 29, 34, 8, 10, - 30, 11, 35, 13, 20, 21, - 102, 8, 8, 8, 8, 28, - 83, 84, 84, 84, 84, 83, - 26, 23, 23, 23, 23, 26 -}; - -// International Airport (large) - 2 runways -static const byte _airport_sections_international[] = { - 88, 89, 89, 89, 89, 89, 88, - 51, 8, 8, 8, 8, 8, 32, - 30, 8, 11, 27, 11, 8, 10, - 32, 8, 11, 27, 11, 8, 114, - 87, 8, 11, 85, 11, 8, 114, - 87, 8, 8, 8, 8, 8, 90, - 26, 23, 23, 23, 23, 23, 26 -}; - -// Intercontinental Airport (vlarge) - 4 runways -static const byte _airport_sections_intercontinental[] = { - 102, 120, 89, 89, 89, 89, 89, 89, 118, - 120, 23, 23, 23, 23, 23, 23, 119, 117, - 87, 54, 87, 8, 8, 8, 8, 51, 117, - 87, 162, 87, 85, 116, 116, 8, 9, 10, - 87, 8, 8, 11, 31, 11, 8, 160, 32, - 32, 160, 8, 11, 27, 11, 8, 8, 10, - 87, 8, 8, 11, 30, 11, 8, 8, 10, - 87, 142, 8, 11, 29, 11, 10, 163, 10, - 87, 164, 87, 8, 8, 8, 10, 37, 117, - 87, 120, 89, 89, 89, 89, 89, 89, 119, - 121, 23, 23, 23, 23, 23, 23, 119, 37 -}; - - -// Commuter Airfield (small) -static const byte _airport_sections_commuter[] = { - 85, 30, 115, 115, 32, - 87, 8, 8, 8, 10, - 87, 11, 11, 11, 10, - 26, 23, 23, 23, 26 -}; - -// Heliport -static const byte _airport_sections_heliport[] = { - 66, -}; - -// Helidepot -static const byte _airport_sections_helidepot[] = { - 124, 32, - 122, 123 -}; - -// Helistation -static const byte _airport_sections_helistation[] = { - 32, 134, 159, 158, - 161, 142, 142, 157 -}; - -static const byte * const _airport_sections[] = { - _airport_sections_country, // Country Airfield (small) - _airport_sections_town, // City Airport (large) - _airport_sections_heliport, // Heliport - _airport_sections_metropolitan, // Metropolitain Airport (large) - _airport_sections_international, // International Airport (xlarge) - _airport_sections_commuter, // Commuter Airport (small) - _airport_sections_helidepot, // Helidepot - _airport_sections_intercontinental, // Intercontinental Airport (xxlarge) - _airport_sections_helistation // Helistation -}; - /** Place an Airport. * @param tile tile where airport will be built * @param p1 airport type, @see airport.h diff -r bbe3f6d2dcaf -r b25cf31294e9 src/table/station_air.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/table/station_air.h Tue Mar 27 21:58:38 2007 +0000 @@ -0,0 +1,97 @@ +/* $Id$ */ + +/** @file table/station_air.h Layouts of airports */ + +/* + * The sprites are defined in station_land.h. + */ + +// Country Airfield (small) +static const byte _airport_sections_country[] = { + 54, 53, 52, 65, + 58, 57, 56, 55, + 64, 63, 63, 62 +}; + +// City Airport (large) +static const byte _airport_sections_town[] = { + 31, 9, 33, 9, 9, 32, + 27, 36, 29, 34, 8, 10, + 30, 11, 35, 13, 20, 21, + 51, 12, 14, 17, 19, 28, + 38, 13, 15, 16, 18, 39, + 26, 22, 23, 24, 25, 26 +}; + +// Metropolitain Airport (large) - 2 runways +static const byte _airport_sections_metropolitan[] = { + 31, 9, 33, 9, 9, 32, + 27, 36, 29, 34, 8, 10, + 30, 11, 35, 13, 20, 21, + 102, 8, 8, 8, 8, 28, + 83, 84, 84, 84, 84, 83, + 26, 23, 23, 23, 23, 26 +}; + +// International Airport (large) - 2 runways +static const byte _airport_sections_international[] = { + 88, 89, 89, 89, 89, 89, 88, + 51, 8, 8, 8, 8, 8, 32, + 30, 8, 11, 27, 11, 8, 10, + 32, 8, 11, 27, 11, 8, 114, + 87, 8, 11, 85, 11, 8, 114, + 87, 8, 8, 8, 8, 8, 90, + 26, 23, 23, 23, 23, 23, 26 +}; + +// Intercontinental Airport (vlarge) - 4 runways +static const byte _airport_sections_intercontinental[] = { + 102, 120, 89, 89, 89, 89, 89, 89, 118, + 120, 22, 22, 22, 22, 22, 22, 119, 117, + 87, 54, 87, 8, 8, 8, 8, 51, 117, + 87, 162, 87, 85, 116, 116, 8, 9, 10, + 87, 8, 8, 11, 31, 11, 8, 160, 32, + 32, 160, 8, 11, 27, 11, 8, 8, 10, + 87, 8, 8, 11, 30, 11, 8, 8, 10, + 87, 142, 8, 11, 29, 11, 10, 163, 10, + 87, 164, 87, 8, 8, 8, 10, 37, 117, + 87, 120, 89, 89, 89, 89, 89, 89, 119, + 121, 22, 22, 22, 22, 22, 22, 119, 37 +}; + +// Commuter Airfield (small) +static const byte _airport_sections_commuter[] = { + 85, 30, 115, 115, 32, + 87, 8, 8, 8, 10, + 87, 11, 11, 11, 10, + 26, 23, 23, 23, 26 +}; + +// Heliport +static const byte _airport_sections_heliport[] = { + 66, +}; + +// Helidepot +static const byte _airport_sections_helidepot[] = { + 124, 32, + 122, 123 +}; + +// Helistation +static const byte _airport_sections_helistation[] = { + 32, 134, 159, 158, + 161, 142, 142, 157 +}; + +static const byte * const _airport_sections[] = { + _airport_sections_country, // Country Airfield (small) + _airport_sections_town, // City Airport (large) + _airport_sections_heliport, // Heliport + _airport_sections_metropolitan, // Metropolitain Airport (large) + _airport_sections_international, // International Airport (xlarge) + _airport_sections_commuter, // Commuter Airport (small) + _airport_sections_helidepot, // Helidepot + _airport_sections_intercontinental, // Intercontinental Airport (xxlarge) + _airport_sections_helistation // Helistation +};