OpenTTD
Data Structures | Typedefs | Enumerations | Functions
newgrf_airport.h File Reference

NewGRF handling of airports. More...

#include "airport.h"
#include "date_type.h"
#include "newgrf_class.h"
#include "newgrf_commons.h"
#include "tilearea_type.h"

Go to the source code of this file.

Data Structures

struct  AirportTileTable
 Tile-offset / AirportTileID pair. More...
 
class  AirportTileTableIterator
 Iterator to iterate over all tiles belonging to an airport spec. More...
 
struct  HangarTileTable
 A list of all hangar tiles in an airport. More...
 
struct  AirportSpec
 Defines the data structure for an airport. More...
 

Typedefs

typedef byte StationGfx
 Copy from station_map.h.
 
typedef NewGRFClass< AirportSpec, AirportClassID, APC_MAXAirportClass
 Information related to airport classes. More...
 

Enumerations

enum  AirportClassID {
  APC_BEGIN = 0, APC_SMALL = 0, APC_LARGE, APC_HUB,
  APC_HELIPORT, APC_MAX = 16
}
 List of default airport classes. More...
 
enum  TTDPAirportType { ATP_TTDP_SMALL, ATP_TTDP_LARGE, ATP_TTDP_HELIPORT, ATP_TTDP_OILRIG }
 Allow incrementing of AirportClassID variables. More...
 

Functions

void BindAirportSpecs ()
 Tie all airportspecs to their class.
 
StringID GetAirportTextCallback (const AirportSpec *as, byte layout, uint16 callback)
 Get a custom text for the airport. More...
 

Detailed Description

NewGRF handling of airports.

Definition in file newgrf_airport.h.

Typedef Documentation

◆ AirportClass

Information related to airport classes.

Definition at line 143 of file newgrf_airport.h.

Enumeration Type Documentation

◆ AirportClassID

List of default airport classes.

Enumerator
APC_BEGIN 

Lowest valid airport class id.

APC_SMALL 

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 

maximum number of airport classes

Definition at line 70 of file newgrf_airport.h.

◆ TTDPAirportType

Allow incrementing of AirportClassID variables.

TTDP airport types. Used to map our types to TTDPatch's

Enumerator
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.

Definition at line 83 of file newgrf_airport.h.

Function Documentation

◆ GetAirportTextCallback()

StringID GetAirportTextCallback ( const AirportSpec as,
byte  layout,
uint16  callback 
)

Get a custom text for the airport.

Parameters
asThe airport type's specification.
layoutThe layout index.
callbackThe callback to call.
Returns
The custom text.

Definition at line 278 of file newgrf_airport.cpp.

References CALLBACK_FAILED, ErrorUnknownCallbackResult(), GetGRFStringID(), AirportSpec::GetIndex(), AirportSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, and INVALID_TILE.

Referenced by BuildAirportWindow::SetStringParameters().