Changeset - r14755:86b8e81d785d
[Not reviewed]
master
0 6 0
yexo - 15 years ago 2010-03-06 15:38:13
yexo@openttd.org
(svn r19353) -Codechange: use static objects for the airport statemachines instead of new/delete at the start/end of the game
-Codechange: store the fta in AirportSpec
6 files changed with 56 insertions and 107 deletions:
0 comments (0 inline, 0 general)
src/airport.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * 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.
 
 * 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.
 
 * 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/>.
 
 */
 

	
 
/** @file airport.cpp Functions related to airports. */
 

	
 
#include "stdafx.h"
 
#include "debug.h"
 
#include "airport.h"
 
#include "map_type.h"
 
#include "table/airport_movement.h"
 
#include "core/alloc_func.hpp"
 
#include "date_func.h"
 
#include "settings_type.h"
 
#include "newgrf_airport.h"
 
#include "table/strings.h"
 
#include "table/airporttile_ids.h"
 
#include "table/airport_defaults.h"
 

	
 
/* Uncomment this to print out a full report of the airport-structure
 
 * You should either use
 
 * - true: full-report, print out every state and choice with string-names
 
 * OR
 
 * - false: give a summarized report which only shows current and next position */
 
//#define DEBUG_AIRPORT false
 

	
 
static AirportFTAClass *_dummy_airport;
 
static AirportFTAClass *_country_airport;
 
static AirportFTAClass *_city_airport;
 
static AirportFTAClass *_oilrig;
 
static AirportFTAClass *_heliport;
 
static AirportFTAClass *_metropolitan_airport;
 
static AirportFTAClass *_international_airport;
 
static AirportFTAClass *_commuter_airport;
 
static AirportFTAClass *_heli_depot;
 
static AirportFTAClass *_intercontinental_airport;
 
static AirportFTAClass *_heli_station;
 

	
 

	
 
void InitializeAirports()
 
{
 
	_dummy_airport = new AirportFTAClass(
 
static AirportFTAClass _airportfta_dummy(
 
		_airport_moving_data_dummy,
 
		NULL,
 
		NULL,
 
		_airport_entries_dummy,
 
		AirportFTAClass::ALL,
 
		_airport_fta_dummy,
 
		0
 
	);
 

	
 
	_country_airport = new AirportFTAClass(
 
static AirportFTAClass _airportfta_country(
 
		_airport_moving_data_country,
 
		_airport_terminal_country,
 
		NULL,
 
		_airport_entries_country,
 
		AirportFTAClass::ALL | AirportFTAClass::SHORT_STRIP,
 
		_airport_fta_country,
 
		0
 
	);
 

	
 
	_city_airport = new AirportFTAClass(
 
static AirportFTAClass _airportfta_city(
 
		_airport_moving_data_town,
 
		_airport_terminal_city,
 
		NULL,
 
		_airport_entries_city,
 
		AirportFTAClass::ALL,
 
		_airport_fta_city,
 
		0
 
	);
 

	
 
	_metropolitan_airport = new AirportFTAClass(
 
static AirportFTAClass _airportfta_oilrig(
 
		_airport_moving_data_oilrig,
 
		NULL,
 
		_airport_helipad_heliport_oilrig,
 
		_airport_entries_heliport_oilrig,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_heliport_oilrig,
 
		54
 
	);
 

	
 
static AirportFTAClass _airportfta_heliport(
 
		_airport_moving_data_heliport,
 
		NULL,
 
		_airport_helipad_heliport_oilrig,
 
		_airport_entries_heliport_oilrig,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_heliport_oilrig,
 
		60
 
	);
 

	
 
static AirportFTAClass _airportfta_metropolitan(
 
		_airport_moving_data_metropolitan,
 
		_airport_terminal_metropolitan,
 
		NULL,
 
		_airport_entries_metropolitan,
 
		AirportFTAClass::ALL,
 
		_airport_fta_metropolitan,
 
		0
 
	);
 

	
 
	_international_airport = new AirportFTAClass(
 
static AirportFTAClass _airportfta_international(
 
		_airport_moving_data_international,
 
		_airport_terminal_international,
 
		_airport_helipad_international,
 
		_airport_entries_international,
 
		AirportFTAClass::ALL,
 
		_airport_fta_international,
 
		0
 
	);
 

	
 
	_intercontinental_airport = new AirportFTAClass(
 
static AirportFTAClass _airportfta_commuter(
 
		_airport_moving_data_commuter,
 
		_airport_terminal_commuter,
 
		_airport_helipad_commuter,
 
		_airport_entries_commuter,
 
		AirportFTAClass::ALL | AirportFTAClass::SHORT_STRIP,
 
		_airport_fta_commuter,
 
		0
 
	);
 

	
 
static AirportFTAClass _airportfta_helidepot(
 
		_airport_moving_data_helidepot,
 
		NULL,
 
		_airport_helipad_helidepot,
 
		_airport_entries_helidepot,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_helidepot,
 
		0
 
	);
 

	
 
static AirportFTAClass _airportfta_intercontinental(
 
		_airport_moving_data_intercontinental,
 
		_airport_terminal_intercontinental,
 
		_airport_helipad_intercontinental,
 
		_airport_entries_intercontinental,
 
		AirportFTAClass::ALL,
 
		_airport_fta_intercontinental,
 
		0
 
	);
 

	
 
	_heliport = new AirportFTAClass(
 
		_airport_moving_data_heliport,
 
		NULL,
 
		_airport_helipad_heliport_oilrig,
 
		_airport_entries_heliport_oilrig,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_heliport_oilrig,
 
		60
 
	);
 

	
 
	_oilrig = new AirportFTAClass(
 
		_airport_moving_data_oilrig,
 
		NULL,
 
		_airport_helipad_heliport_oilrig,
 
		_airport_entries_heliport_oilrig,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_heliport_oilrig,
 
		54
 
	);
 

	
 
	_commuter_airport = new AirportFTAClass(
 
		_airport_moving_data_commuter,
 
		_airport_terminal_commuter,
 
		_airport_helipad_commuter,
 
		_airport_entries_commuter,
 
		AirportFTAClass::ALL | AirportFTAClass::SHORT_STRIP,
 
		_airport_fta_commuter,
 
		0
 
	);
 

	
 
	_heli_depot = new AirportFTAClass(
 
		_airport_moving_data_helidepot,
 
		NULL,
 
		_airport_helipad_helidepot,
 
		_airport_entries_helidepot,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_helidepot,
 
		0
 
	);
 

	
 
	_heli_station = new AirportFTAClass(
 
static AirportFTAClass _airportfta_helistation(
 
		_airport_moving_data_helistation,
 
		NULL,
 
		_airport_helipad_helistation,
 
		_airport_entries_helistation,
 
		AirportFTAClass::HELICOPTERS,
 
		_airport_fta_helistation,
 
		0
 
	);
 
}
 

	
 
void UnInitializeAirports()
 
{
 
	delete _dummy_airport;
 
	delete _country_airport;
 
	delete _city_airport;
 
	delete _heliport;
 
	delete _metropolitan_airport;
 
	delete _international_airport;
 
	delete _commuter_airport;
 
	delete _heli_depot;
 
	delete _intercontinental_airport;
 
	delete _heli_station;
 
}
 
#include "table/airport_defaults.h"
 

	
 

	
 
static uint16 AirportGetNofElements(const AirportFTAbuildup *apFA);
 
static AirportFTA *AirportBuildAutomata(uint nofelements, const AirportFTAbuildup *apFA);
 
static byte AirportGetTerminalCount(const byte *terminals, byte *groups);
 
static byte AirportTestFTA(uint nofelements, const AirportFTA *layout, const byte *terminals);
 

	
 
#ifdef DEBUG_AIRPORT
 
static void AirportPrintOut(uint nofelements, const AirportFTA *layout, bool full_report);
 
#endif
 

	
 

	
 
AirportFTAClass::AirportFTAClass(
 
	const AirportMovingData *moving_data_,
 
	const byte *terminals_,
 
	const byte *helipads_,
 
	const byte *entry_points_,
 
	Flags flags_,
 
	const AirportFTAbuildup *apFA,
 
	byte delta_z_
 
) :
 
	moving_data(moving_data_),
 
	terminals(terminals_),
 
	helipads(helipads_),
 
@@ -386,41 +357,26 @@ static const char * const _airport_headi
 
};
 

	
 
static void AirportPrintOut(uint nofelements, const AirportFTA *layout, bool full_report)
 
{
 
	if (!full_report) printf("(P = Current Position; NP = Next Position)\n");
 

	
 
	for (uint i = 0; i < nofelements; i++) {
 
		for (const AirportFTA *current = &layout[i]; current != NULL; current = current->next) {
 
			if (full_report) {
 
				byte heading = (current->heading == 255) ? MAX_HEADINGS + 1 : current->heading;
 
				printf("\tPos:%2d NPos:%2d Heading:%15s Block:%2d\n", current->position,
 
					    current->next_position, _airport_heading_strings[heading],
 
							FindLastBit(current->block));
 
			} else {
 
				printf("P:%2d NP:%2d", current->position, current->next_position);
 
			}
 
		}
 
		printf("\n");
 
	}
 
}
 
#endif
 

	
 
const AirportFTAClass *GetAirport(const byte airport_type)
 
{
 
	/* FIXME -- AircraftNextAirportPos_and_Order -> Needs something nicer, don't like this code
 
	 * needs constant change if more airports are added */
 
	switch (airport_type) {
 
		default:               NOT_REACHED();
 
		case AT_SMALL:         return _country_airport;
 
		case AT_LARGE:         return _city_airport;
 
		case AT_METROPOLITAN:  return _metropolitan_airport;
 
		case AT_HELIPORT:      return _heliport;
 
		case AT_OILRIG:        return _oilrig;
 
		case AT_INTERNATIONAL: return _international_airport;
 
		case AT_COMMUTER:      return _commuter_airport;
 
		case AT_HELIDEPOT:     return _heli_depot;
 
		case AT_INTERCON:      return _intercontinental_airport;
 
		case AT_HELISTATION:   return _heli_station;
 
		case AT_DUMMY:         return _dummy_airport;
 
	}
 
	return AirportSpec::Get(airport_type)->fsm;
 
}
src/airport.h
Show inline comments
 
@@ -164,31 +164,29 @@ public:
 
	}
 

	
 
	const AirportMovingData *moving_data;
 
	struct AirportFTA *layout;            ///< state machine for airport
 
	const byte *terminals;
 
	const byte *helipads;
 
	Flags flags;
 
	byte nofelements;                     ///< number of positions the airport consists of
 
	const byte *entry_points;             ///< when an airplane arrives at this airport, enter it at position entry_point, index depends on direction
 
	byte delta_z;                         ///< Z adjustment for helicopter pads
 
};
 

	
 
DECLARE_ENUM_AS_BIT_SET(AirportFTAClass::Flags)
 

	
 

	
 
/** Internal structure used in openttd - Finite sTate mAchine --> FTA */
 
struct AirportFTA {
 
	AirportFTA *next;        ///< possible extra movement choices from this position
 
	uint64 block;            ///< 64 bit blocks (st->airport_flags), should be enough for the most complex airports
 
	byte position;           ///< the position that an airplane is at
 
	byte next_position;      ///< next position from this position
 
	byte heading;            ///< heading (current orders), guiding an airplane to its target on an airport
 
};
 

	
 
void InitializeAirports();
 
void UnInitializeAirports();
 
const AirportFTAClass *GetAirport(const byte airport_type);
 

	
 
extern const byte * const _airport_sections[];
 

	
 
#endif /* AIRPORT_H */
src/newgrf_airport.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/*
 
 * This file is part of OpenTTD.
 
 * 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.
 
 * 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.
 
 * 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/>.
 
 */
 

	
 
/** @file newgrf_airport.h NewGRF handling of airports. */
 

	
 
#include "stdafx.h"
 
#include "airport.h"
 
#include "newgrf_airport.h"
 
#include "date_func.h"
 
#include "settings_type.h"
 
#include "core/alloc_type.hpp"
 
#include "newgrf.h"
 
#include "table/strings.h"
 

	
 
static AirportClass _airport_classes[APC_MAX];
 

	
 
AirportSpec AirportSpec::dummy = {NULL, NULL, 0, 0, 0, 0, 0, MIN_YEAR, MIN_YEAR, STR_NULL, ATP_TTDP_LARGE, APC_BEGIN, false};
 
AirportSpec AirportSpec::dummy = {NULL, NULL, NULL, 0, 0, 0, 0, 0, MIN_YEAR, MIN_YEAR, STR_NULL, ATP_TTDP_LARGE, APC_BEGIN, false};
 

	
 
AirportSpec AirportSpec::specs[NUM_AIRPORTS];
 

	
 
/**
 
 * Retrieve airport spec for the given airport. If an override is available
 
 *  it is returned.
 
 * @param type index of airport
 
 * @return A pointer to the corresponding AirportSpec
 
 */
 
/* static */ const AirportSpec *AirportSpec::Get(byte type)
 
{
 
	assert(type < lengthof(AirportSpec::specs));
 
	return &AirportSpec::specs[type];
 
}
 

	
 
/**
 
 * Retrieve airport spec for the given airport. Even if an override is
 
 *  available the base spec is returned.
 
 * @param type index of airport
 
 * @return A pointer to the corresponding AirportSpec
 
 */
 
/* static */ AirportSpec *AirportSpec::GetWithoutOverride(byte type)
 
{
 
	assert(type < lengthof(AirportSpec::specs));
src/newgrf_airport.h
Show inline comments
 
@@ -28,48 +28,49 @@ struct AirportTileTable {
 
enum AirportClassID {
 
	APC_BEGIN     = 0,  ///< Lowest valid airport class id
 
	APC_SMALL     = 0,  ///< id for small airports class
 
	APC_LARGE,          ///< id for large airports class
 
	APC_HUB,            ///< id for hub airports class
 
	APC_HELIPORT,       ///< id for heliports
 
	APC_MAX       = 16, ///< maximum number of airport classes
 
};
 

	
 
/** Allow incrementing of AirportClassID variables */
 
DECLARE_POSTFIX_INCREMENT(AirportClassID);
 

	
 
/** TTDP airport types. Used to map our types to TTDPatch's */
 
enum TTDPAirportType {
 
	ATP_TTDP_SMALL,    ///< Same as AT_SMALL
 
	ATP_TTDP_LARGE,    ///< Same as AT_LARGE
 
	ATP_TTDP_HELIPORT, ///< Same as AT_HELIPORT
 
	ATP_TTDP_OILRIG,   ///< Same as AT_OILRIG
 
};
 

	
 
/**
 
 * Defines the data structure for an airport.
 
 */
 
struct AirportSpec {
 
	const struct AirportFTAClass *fsm;     ///< the finite statemachine for the default airports
 
	const AirportTileTable * const *table; ///< list of the tiles composing the airport
 
	const TileIndexDiffC *depot_table;     ///< gives the position of the depots on the airports
 
	byte nof_depots;                       ///< the number of depots in this airport
 
	byte size_x;                           ///< size of airport in x direction
 
	byte size_y;                           ///< size of airport in y direction
 
	byte noise_level;                      ///< noise that this airport generates
 
	byte catchment;                        ///< catchment area of this airport
 
	Year min_year;                         ///< first year the airport is available
 
	Year max_year;                         ///< last year the airport is available
 
	StringID name;                         ///< name of this airport
 
	TTDPAirportType ttd_airport_type;      ///< ttdpatch airport type (Small/Large/Helipad/Oilrig)
 
	AirportClassID aclass;                 ///< the class to which this airport type belongs
 
	/* Newgrf data */
 
	bool enabled;                          ///< entity still avaible (by default true).newgrf can disable it, though
 

	
 
	static const AirportSpec *Get(byte type);
 
	static AirportSpec *GetWithoutOverride(byte type);
 

	
 
	bool IsAvailable() const;
 

	
 
	static void ResetAirports();
 

	
 
	/** Get the index of this spec. */
 
	byte GetIndex() const
src/openttd.cpp
Show inline comments
 
@@ -312,51 +312,48 @@ static void InitializeDynamicVariables()
 
	_engine_mngr.ResetToDefaultMapping();
 
	_house_mngr.ResetMapping();
 
	_industry_mngr.ResetMapping();
 
	_industile_mngr.ResetMapping();
 
	_airporttile_mngr.ResetMapping();
 
}
 

	
 

	
 
/** Unitializes drivers, frees allocated memory, cleans pools, ...
 
 * Generally, prepares the game for shutting down
 
 */
 
static void ShutdownGame()
 
{
 
	IConsoleFree();
 

	
 
	if (_network_available) NetworkShutDown(); // Shut down the network and close any open connections
 

	
 
	DriverFactoryBase::ShutdownDrivers();
 

	
 
	UnInitWindowSystem();
 

	
 
	/* stop the AI */
 
	AI::Uninitialize(false);
 

	
 
	/* Uninitialize airport state machines */
 
	UnInitializeAirports();
 

	
 
	/* Uninitialize variables that are allocated dynamically */
 
	GamelogReset();
 
	_town_pool.CleanPool();
 
	_industry_pool.CleanPool();
 
	_station_pool.CleanPool();
 
	_roadstop_pool.CleanPool();
 
	_vehicle_pool.CleanPool();
 
	_sign_pool.CleanPool();
 
	_order_pool.CleanPool();
 
	_group_pool.CleanPool();
 
	_cargopacket_pool.CleanPool();
 
	_engine_pool.CleanPool();
 
	_company_pool.CleanPool();
 

	
 
	free(_config_file);
 

	
 
	/* Close all and any open filehandles */
 
	FioCloseAll();
 
}
 

	
 
static void LoadIntroGame()
 
{
 
	_game_mode = GM_MENU;
 

	
 
@@ -584,51 +581,48 @@ int ttd_main(int argc, char *argv[])
 

	
 
	/*
 
	 * The width and height must be at least 1 pixel and width times
 
	 * height must still fit within a 32 bits integer, this way all
 
	 * internal drawing routines work correctly.
 
	 */
 
	_cur_resolution.width  = ClampU(_cur_resolution.width,  1, UINT16_MAX);
 
	_cur_resolution.height = ClampU(_cur_resolution.height, 1, UINT16_MAX);
 

	
 
#if defined(ENABLE_NETWORK)
 
	if (dedicated_host) {
 
		_network_bind_list.Clear();
 
		*_network_bind_list.Append() = strdup(dedicated_host);
 
	}
 
	if (dedicated_port) _settings_client.network.server_port = dedicated_port;
 
	if (_dedicated_forks && !dedicated) _dedicated_forks = false;
 
#endif /* ENABLE_NETWORK */
 

	
 
	/* enumerate language files */
 
	InitializeLanguagePacks();
 

	
 
	/* initialize screenshot formats */
 
	InitializeScreenshotFormats();
 

	
 
	/* initialize airport state machines */
 
	InitializeAirports();
 

	
 
	/* initialize all variables that are allocated dynamically */
 
	InitializeDynamicVariables();
 

	
 
	/* Initialize FreeType */
 
	InitFreeType();
 

	
 
	/* This must be done early, since functions use the SetWindowDirty* calls */
 
	InitWindowSystem();
 

	
 
	/* Look for the sounds before the graphics. Otherwise none would be set and
 
	 * the first initialisation of the video happens on the wrong data. Now it
 
	 * can do the first initialisation right. */
 
	if (sounds_set == NULL && BaseSounds::ini_set != NULL) sounds_set = strdup(BaseSounds::ini_set);
 
	if (!BaseSounds::SetSet(sounds_set)) {
 
		StrEmpty(sounds_set) ?
 
			usererror("Failed to find a sounds set. Please acquire a sounds set for OpenTTD. See section 4.1 of readme.txt.") :
 
			usererror("Failed to select requested sounds set '%s'", sounds_set);
 
	}
 
	free(sounds_set);
 

	
 
	if (graphics_set == NULL && BaseGraphics::ini_set != NULL) graphics_set = strdup(BaseGraphics::ini_set);
 
	if (!BaseGraphics::SetSet(graphics_set)) {
 
		StrEmpty(graphics_set) ?
 
			usererror("Failed to find a graphics set. Please acquire a graphics set for OpenTTD. See section 4.1 of readme.txt.") :
src/table/airport_defaults.h
Show inline comments
 
@@ -356,56 +356,56 @@ static AirportTileTable *_tile_table_hel
 
	_tile_table_helidepot_0,
 
};
 

	
 
/** Tiles for Helistation */
 
static AirportTileTable _tile_table_helistation_0[] = {
 
	MK(0, 0, APT_DEPOT_SE),
 
	MK(1, 0, APT_LOW_BUILDING_FENCE_NW),
 
	MK(2, 0, APT_HELIPAD_3_FENCE_NW),
 
	MK(3, 0, APT_HELIPAD_3_FENCE_NW_SW),
 
	MK(0, 1, APT_APRON_FENCE_NE_SE),
 
	MK(1, 1, APT_APRON_FENCE_SE),
 
	MK(2, 1, APT_APRON_FENCE_SE),
 
	MK(3, 1, APT_HELIPAD_3_FENCE_SE_SW),
 
	MKEND
 
};
 

	
 
static AirportTileTable *_tile_table_helistation[] = {
 
	_tile_table_helistation_0,
 
};
 

	
 
#undef MK
 
#undef MKEND
 

	
 
/** General AirportSpec definition. */
 
#define AS_GENERIC(att, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, ttdpatch_type, class_id, name, enabled) \
 
	{att, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, class_id, enabled}
 
#define AS_GENERIC(fsm, att, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, ttdpatch_type, class_id, name, enabled) \
 
	{fsm, att, depot_tbl, num_depots, size_x, size_y, noise, catchment, min_year, max_year, name, ttdpatch_type, class_id, enabled}
 

	
 
/** AirportSpec definition for airports without any depot. */
 
#define AS_ND(ap_name, size_x, size_y, min_year, max_year, catchment, noise, ttdpatch_type, class_id, name) \
 
	AS_GENERIC(_tile_table_##ap_name, NULL, 0, size_x, size_y, noise, catchment, min_year, max_year, ttdpatch_type, class_id, name, true)
 
	AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, NULL, 0, size_x, size_y, noise, catchment, min_year, max_year, ttdpatch_type, class_id, name, true)
 

	
 
/** AirportSpec definition for airports with at least one depot. */
 
#define AS(ap_name, size_x, size_y, min_year, max_year, catchment, noise, ttdpatch_type, class_id, name) \
 
	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, ttdpatch_type, class_id, name, true)
 
	AS_GENERIC(&_airportfta_##ap_name, _tile_table_##ap_name, _airport_depots_##ap_name, lengthof(_airport_depots_##ap_name), size_x, size_y, noise, catchment, min_year, max_year, ttdpatch_type, class_id, name, true)
 

	
 
/* The helidepot and helistation have ATP_TTDP_SMALL because they are at ground level */
 
extern const AirportSpec _origin_airport_specs[] = {
 
	AS(country, 4, 3, 0, 1959, 4, 3, ATP_TTDP_SMALL, APC_SMALL, STR_AIRPORT_SMALL),
 
	AS(city, 6, 6, 1955, MAX_YEAR, 5, 5, ATP_TTDP_LARGE, APC_LARGE, STR_AIRPORT_CITY),
 
	AS_ND(heliport, 1, 1, 1963, MAX_YEAR, 4, 1, ATP_TTDP_HELIPORT, APC_HELIPORT, STR_AIRPORT_HELIPORT),
 
	AS(metropolitan, 6, 6, 1980, MAX_YEAR, 6, 8, ATP_TTDP_LARGE, APC_LARGE, STR_AIRPORT_METRO),
 
	AS(international, 7, 7, 1990, MAX_YEAR, 8, 17, ATP_TTDP_LARGE, APC_HUB, STR_AIRPORT_INTERNATIONAL),
 
	AS(commuter, 5, 4, 1983, MAX_YEAR, 4, 4, ATP_TTDP_SMALL, APC_SMALL, STR_AIRPORT_COMMUTER),
 
	AS(helidepot, 2, 2, 1976, MAX_YEAR, 4, 2, ATP_TTDP_SMALL, APC_HELIPORT, STR_AIRPORT_HELIDEPOT),
 
	AS(intercontinental, 9, 11, 2002, MAX_YEAR, 10, 25, ATP_TTDP_LARGE, APC_HUB, STR_AIRPORT_INTERCONTINENTAL),
 
	AS(helistation, 4, 2, 1980, MAX_YEAR, 4, 3, ATP_TTDP_SMALL, APC_HELIPORT, STR_AIRPORT_HELISTATION),
 
	AS_GENERIC(NULL, NULL, 0, 1, 1, 0, 4, 0, 0, ATP_TTDP_OILRIG, APC_HELIPORT, STR_NULL, false),
 
	AS_GENERIC(&_airportfta_oilrig, NULL, NULL, 0, 1, 1, 0, 4, 0, 0, ATP_TTDP_OILRIG, APC_HELIPORT, STR_NULL, false),
 
};
 

	
 
assert_compile(NUM_AIRPORTS == lengthof(_origin_airport_specs));
 

	
 
#undef AS
 
#undef AS_ND
 
#undef AS_GENERIC
 

	
 
#endif /* AIRPORT_DEFAULTS_H */
0 comments (0 inline, 0 general)