mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r20538) -Codechange: introduce a few macros to initialize the airport classes
This commit is contained in:
parent
8118cab6ba
commit
a65345d7ed
126
src/airport.cpp
126
src/airport.cpp
|
@ -23,115 +23,31 @@
|
||||||
#include "table/airporttile_ids.h"
|
#include "table/airporttile_ids.h"
|
||||||
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_dummy(
|
#define AIRPORT_GENERIC(name, terminals, num_helipads, flags, delta_z) \
|
||||||
_airport_moving_data_dummy,
|
static AirportFTAClass _airportfta_ ## name(_airport_moving_data_ ## name, terminals, \
|
||||||
NULL,
|
num_helipads, _airport_entries_ ## name, flags, _airport_fta_ ## name, delta_z);
|
||||||
0,
|
|
||||||
_airport_entries_dummy,
|
|
||||||
AirportFTAClass::ALL,
|
|
||||||
_airport_fta_dummy,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_country(
|
#define AIRPORT(name, num_helipads, short_strip) \
|
||||||
_airport_moving_data_country,
|
AIRPORT_GENERIC(name, _airport_terminal_ ## name, num_helipads, AirportFTAClass::ALL | (short_strip ? AirportFTAClass::SHORT_STRIP : (AirportFTAClass::Flags)0), 0)
|
||||||
_airport_terminal_country,
|
|
||||||
0,
|
|
||||||
_airport_entries_country,
|
|
||||||
AirportFTAClass::ALL | AirportFTAClass::SHORT_STRIP,
|
|
||||||
_airport_fta_country,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_city(
|
#define HELIPORT(name, num_helipads, delta_z) \
|
||||||
_airport_moving_data_town,
|
AIRPORT_GENERIC(name, NULL, num_helipads, AirportFTAClass::HELICOPTERS, delta_z)
|
||||||
_airport_terminal_city,
|
|
||||||
0,
|
|
||||||
_airport_entries_city,
|
|
||||||
AirportFTAClass::ALL,
|
|
||||||
_airport_fta_city,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_oilrig(
|
AIRPORT(country, 0, true)
|
||||||
_airport_moving_data_oilrig,
|
AIRPORT(city, 0, false)
|
||||||
NULL,
|
HELIPORT(heliport, 1, 60)
|
||||||
1,
|
AIRPORT(metropolitan, 0, false)
|
||||||
_airport_entries_heliport_oilrig,
|
AIRPORT(international, 2, false)
|
||||||
AirportFTAClass::HELICOPTERS,
|
AIRPORT(commuter, 2, true)
|
||||||
_airport_fta_heliport_oilrig,
|
HELIPORT(helidepot, 1, 0)
|
||||||
54
|
AIRPORT(intercontinental, 2, false)
|
||||||
);
|
HELIPORT(helistation, 3, 0)
|
||||||
|
HELIPORT(oilrig, 1, 54)
|
||||||
|
AIRPORT_GENERIC(dummy, NULL, 0, AirportFTAClass::ALL, 0)
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_heliport(
|
#undef HELIPORT
|
||||||
_airport_moving_data_heliport,
|
#undef AIRPORT
|
||||||
NULL,
|
#undef AIRPORT_GENERIC
|
||||||
1,
|
|
||||||
_airport_entries_heliport_oilrig,
|
|
||||||
AirportFTAClass::HELICOPTERS,
|
|
||||||
_airport_fta_heliport_oilrig,
|
|
||||||
60
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_metropolitan(
|
|
||||||
_airport_moving_data_metropolitan,
|
|
||||||
_airport_terminal_metropolitan,
|
|
||||||
0,
|
|
||||||
_airport_entries_metropolitan,
|
|
||||||
AirportFTAClass::ALL,
|
|
||||||
_airport_fta_metropolitan,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_international(
|
|
||||||
_airport_moving_data_international,
|
|
||||||
_airport_terminal_international,
|
|
||||||
2,
|
|
||||||
_airport_entries_international,
|
|
||||||
AirportFTAClass::ALL,
|
|
||||||
_airport_fta_international,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_commuter(
|
|
||||||
_airport_moving_data_commuter,
|
|
||||||
_airport_terminal_commuter,
|
|
||||||
2,
|
|
||||||
_airport_entries_commuter,
|
|
||||||
AirportFTAClass::ALL | AirportFTAClass::SHORT_STRIP,
|
|
||||||
_airport_fta_commuter,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_helidepot(
|
|
||||||
_airport_moving_data_helidepot,
|
|
||||||
NULL,
|
|
||||||
1,
|
|
||||||
_airport_entries_helidepot,
|
|
||||||
AirportFTAClass::HELICOPTERS,
|
|
||||||
_airport_fta_helidepot,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_intercontinental(
|
|
||||||
_airport_moving_data_intercontinental,
|
|
||||||
_airport_terminal_intercontinental,
|
|
||||||
2,
|
|
||||||
_airport_entries_intercontinental,
|
|
||||||
AirportFTAClass::ALL,
|
|
||||||
_airport_fta_intercontinental,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
static AirportFTAClass _airportfta_helistation(
|
|
||||||
_airport_moving_data_helistation,
|
|
||||||
NULL,
|
|
||||||
3,
|
|
||||||
_airport_entries_helistation,
|
|
||||||
AirportFTAClass::HELICOPTERS,
|
|
||||||
_airport_fta_helistation,
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
#include "table/airport_defaults.h"
|
#include "table/airport_defaults.h"
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ static const AirportMovingData _airport_moving_data_commuter[37] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* City Airport (large) 6x6 */
|
/* City Airport (large) 6x6 */
|
||||||
static const AirportMovingData _airport_moving_data_town[] = {
|
static const AirportMovingData _airport_moving_data_city[] = {
|
||||||
AMD( 85, 3, AMED_EXACTPOS, DIR_SE), // 00 In Hangar
|
AMD( 85, 3, AMED_EXACTPOS, DIR_SE), // 00 In Hangar
|
||||||
AMD( 85, 22, 0, DIR_N ), // 01 Taxi to right outside depot
|
AMD( 85, 22, 0, DIR_N ), // 01 Taxi to right outside depot
|
||||||
AMD( 26, 41, AMED_EXACTPOS, DIR_SW), // 02 Terminal 1
|
AMD( 26, 41, AMED_EXACTPOS, DIR_SW), // 02 Terminal 1
|
||||||
|
@ -728,8 +728,8 @@ static const AirportFTAbuildup _airport_fta_intercontinental[] = {
|
||||||
|
|
||||||
|
|
||||||
/* heliports, oilrigs don't have depots */
|
/* heliports, oilrigs don't have depots */
|
||||||
static const byte _airport_entries_heliport_oilrig[] = { 7, 7, 7, 7 };
|
static const byte _airport_entries_heliport[] = { 7, 7, 7, 7 };
|
||||||
static const AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
|
static const AirportFTAbuildup _airport_fta_heliport[] = {
|
||||||
{ 0, HELIPAD1, HELIPAD1_block, 1 },
|
{ 0, HELIPAD1, HELIPAD1_block, 1 },
|
||||||
{ 1, HELITAKEOFF, NOTHING_block, 0 }, // takeoff
|
{ 1, HELITAKEOFF, NOTHING_block, 0 }, // takeoff
|
||||||
{ 2, 255, AIRPORT_BUSY_block, 0 }, { 2, HELILANDING, 0, 3 }, { 2, HELITAKEOFF, 0, 1 },
|
{ 2, 255, AIRPORT_BUSY_block, 0 }, { 2, HELILANDING, 0, 3 }, { 2, HELITAKEOFF, 0, 1 },
|
||||||
|
@ -742,6 +742,8 @@ static const AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
|
||||||
{ 8, FLYING, NOTHING_block, 5 }, { 8, HELILANDING, HELIPAD1_block, 2 }, // landing
|
{ 8, FLYING, NOTHING_block, 5 }, { 8, HELILANDING, HELIPAD1_block, 2 }, // landing
|
||||||
{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
|
{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
|
||||||
};
|
};
|
||||||
|
#define _airport_entries_oilrig _airport_entries_heliport
|
||||||
|
#define _airport_fta_oilrig _airport_fta_heliport
|
||||||
|
|
||||||
/* helidepots */
|
/* helidepots */
|
||||||
static const HangarTileTable _airport_depots_helidepot[] = { {{1, 0}, 0} };
|
static const HangarTileTable _airport_depots_helidepot[] = { {{1, 0}, 0} };
|
||||||
|
|
Loading…
Reference in New Issue