OpenTTD
Data Structures | Functions | Variables
newgrf_airporttiles.cpp File Reference

NewGRF handling of airport tiles. More...

#include "stdafx.h"
#include "debug.h"
#include "newgrf_airporttiles.h"
#include "newgrf_spritegroup.h"
#include "newgrf_sound.h"
#include "station_base.h"
#include "water.h"
#include "landscape.h"
#include "company_base.h"
#include "town.h"
#include "table/strings.h"
#include "table/airporttiles.h"
#include "newgrf_animation_base.h"
#include "safeguards.h"

Go to the source code of this file.

Data Structures

struct  AirportTileAnimationBase
 Helper class for animation control. More...
 

Functions

StationGfx GetTranslatedAirportTileID (StationGfx gfx)
 Do airporttile gfx ID translation for NewGRFs. More...
 
static uint32 GetNearbyAirportTileInformation (byte parameter, TileIndex tile, StationID index, bool grf_version8)
 Based on newhouses/newindustries equivalent, but adapted for airports. More...
 
static uint32 GetAirportTileIDAtOffset (TileIndex tile, const Station *st, uint32 cur_grfid)
 Make an analysis of a tile and check whether it belongs to the same airport, and/or the same grf file. More...
 
uint16 GetAirportTileCallback (CallbackID callback, uint32 param1, uint32 param2, const AirportTileSpec *ats, Station *st, TileIndex tile, int extra_data=0)
 
static void AirportDrawTileLayout (const TileInfo *ti, const TileLayoutSpriteGroup *group, byte colour, StationGfx gfx)
 
bool DrawNewAirportTile (TileInfo *ti, Station *st, StationGfx gfx, const AirportTileSpec *airts)
 
void AnimateAirportTile (TileIndex tile)
 
void AirportTileAnimationTrigger (Station *st, TileIndex tile, AirpAnimationTrigger trigger, CargoID cargo_type)
 
void AirportAnimationTrigger (Station *st, AirpAnimationTrigger trigger, CargoID cargo_type)
 

Variables

AirportTileOverrideManager _airporttile_mngr (NEW_AIRPORTTILE_OFFSET, NUM_AIRPORTTILES, INVALID_AIRPORTTILE)
 

Detailed Description

NewGRF handling of airport tiles.

Definition in file newgrf_airporttiles.cpp.

Function Documentation

◆ GetAirportTileIDAtOffset()

static uint32 GetAirportTileIDAtOffset ( TileIndex  tile,
const Station st,
uint32  cur_grfid 
)
static

Make an analysis of a tile and check whether it belongs to the same airport, and/or the same grf file.

Parameters
tileTileIndex of the tile to query
stStation to which to compare the tile to
cur_grfidGRFID of the current callback
Returns
value encoded as per NFO specs

Definition at line 128 of file newgrf_airporttiles.cpp.

References AirportTileSpec::Get(), GetAirportGfx(), AirportTileSpec::grf_prop, GRFFilePropsBase< Tcnt >::grffile, INVALID_AIRPORTTILE, GRFFilePropsBase< Tcnt >::local_id, NEW_AIRPORTTILE_OFFSET, GRFFileProps::override, and GRFFilePropsBase< Tcnt >::spritegroup.

◆ GetNearbyAirportTileInformation()

static uint32 GetNearbyAirportTileInformation ( byte  parameter,
TileIndex  tile,
StationID  index,
bool  grf_version8 
)
static

Based on newhouses/newindustries equivalent, but adapted for airports.

Parameters
parameterfrom callback. It's in fact a pair of coordinates
tileTileIndex from which the callback was initiated
indexof the industry been queried for
grf_version8True, if we are dealing with a new NewGRF which uses GRF version >= 8.
Returns
a construction of bits obeying the newgrf format

Definition at line 111 of file newgrf_airporttiles.cpp.

References GetNearbyTile(), GetNearbyTileInformation(), GetStationIndex(), IsAirport(), IsTileType(), and MP_STATION.

◆ GetTranslatedAirportTileID()

StationGfx GetTranslatedAirportTileID ( StationGfx  gfx)

Do airporttile gfx ID translation for NewGRFs.

Parameters
gfxthe type to get the override for.
Returns
the gfx to actually work with.

Definition at line 97 of file newgrf_airporttiles.cpp.

References AirportTileSpec::Get(), AirportTileSpec::grf_prop, INVALID_AIRPORTTILE, and GRFFileProps::override.