Functions | Variables

# newgrf_airport.cpp File Reference

NewGRF handling of airports. More...

`#include "stdafx.h"`
`#include "debug.h"`
`#include "date_func.h"`
`#include "newgrf_spritegroup.h"`
`#include "newgrf_text.h"`
`#include "station_base.h"`
`#include "newgrf_class_func.h"`

Go to the source code of this file.

## Functions
void | BindAirportSpecs ()
| Tie all airportspecs to their class.
uint32 | AirportGetVariable (const ResolverObject *object, byte variable, uint32 parameter, bool *available)
static const SpriteGroup * | AirportResolveReal (const ResolverObject *object, const RealSpriteGroup *group)
static uint32 | AirportGetRandomBits (const ResolverObject *object)
static uint32 | AirportGetTriggers (const ResolverObject *object)
static void | AirportSetTriggers (const ResolverObject *object, int triggers)
void | AirportStorePSA (ResolverObject *object, uint pos, int32 value)
| Store a value into the object's persistent storage.
static void | NewAirportResolver (ResolverObject *res, TileIndex tile, Station *st, byte airport_id, byte layout)
SpriteID | GetCustomAirportSprite (const AirportSpec *as, byte layout)
uint16 | GetAirportCallback (CallbackID callback, uint32 param1, uint32 param2, Station *st, TileIndex tile)
StringID | GetAirportTextCallback (const AirportSpec *as, byte layout, uint16 callback)
| Get a custom text for the airport.
## Variables
AirportOverrideManager | _airport_mngr (NEW_AIRPORT_OFFSET, NUM_AIRPORTS, AT_INVALID)

## Detailed Description

NewGRF handling of airports.

Definition in file newgrf_airport.cpp.

## Function Documentation

void AirportStorePSA | ( | ResolverObject * | object,
|  | uint | pos,
|  | int32 | value |
| ) |  |  |

Store a value into the object's persistent storage.

Parameters:

  | object | Object that we want to query.
  | pos | Position in the persistent storage to use.
  | value | Value to store.

Definition at line 191 of file newgrf_airport.cpp.

References Station::airport, Pool< Titem, Tindex, Tgrowth_step, Tmax_size, Tpool_type, Tcache, Tzero >::PoolItem<&_persistent_storage_pool >::CanAllocateItem(), ResolverObject::grffile, Airport::psa, ResolverObject::scope, PersistentStorageArray< TYPE, SIZE >::StoreValue(), and VSG_SCOPE_SELF.

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

Get a custom text for the airport.

Parameters:

  | as | The airport type's specification.
  | layout | The layout index.
  | callback | The callback to call.

Returns:
  The custom text.

Definition at line 266 of file newgrf_airport.cpp.

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

Referenced by BuildAirportWindow::DrawWidget(), BuildAirportWindow::SetStringParameters(), and BuildAirportWindow::UpdateWidgetSize().