OpenTTD Source
20241108-master-g80f628063a
|
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 | |
uint32_t | GetRelativePosition (TileIndex tile, TileIndex ind_tile) |
This is the position of the tile relative to the northernmost tile of the industry. More... | |
StationGfx | GetTranslatedAirportTileID (StationGfx gfx) |
Do airporttile gfx ID translation for NewGRFs. More... | |
static uint32_t | GetNearbyAirportTileInformation (uint8_t parameter, TileIndex tile, StationID index, bool grf_version8) |
Based on newhouses/newindustries equivalent, but adapted for airports. More... | |
static uint32_t | GetAirportTileIDAtOffset (TileIndex tile, const Station *st, uint32_t 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_t | GetAirportTileCallback (CallbackID callback, uint32_t param1, uint32_t param2, const AirportTileSpec *ats, Station *st, TileIndex tile, [[maybe_unused]] int extra_data=0) |
static void | AirportDrawTileLayout (const TileInfo *ti, const TileLayoutSpriteGroup *group, uint8_t colour) |
bool | DrawNewAirportTile (TileInfo *ti, Station *st, 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) |
NewGRF handling of airport tiles.
Definition in file newgrf_airporttiles.cpp.
|
static |
Make an analysis of a tile and check whether it belongs to the same airport, and/or the same grf file.
tile | TileIndex of the tile to query |
st | Station to which to compare the tile to |
cur_grfid | GRFID of the current callback |
Definition at line 127 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.
Referenced by AirportTileScopeResolver::GetVariable().
|
static |
Based on newhouses/newindustries equivalent, but adapted for airports.
parameter | from callback. It's in fact a pair of coordinates |
tile | TileIndex from which the callback was initiated |
index | of the industry been queried for |
grf_version8 | True, if we are dealing with a new NewGRF which uses GRF version >= 8. |
Definition at line 110 of file newgrf_airporttiles.cpp.
References GetNearbyTile(), GetNearbyTileInformation(), GetStationIndex(), IsAirport(), IsTileType(), and MP_STATION.
Referenced by AirportTileScopeResolver::GetVariable().
This is the position of the tile relative to the northernmost tile of the industry.
Format: 00yxYYXX Variable Content x the x offset from the northernmost tile XX same, but stored in a byte instead of a nibble y the y offset from the northernmost tile YY same, but stored in a byte instead of a nibble
tile | TileIndex of the tile to evaluate |
ind_tile | northernmost tile of the industry |
Definition at line 53 of file newgrf_industrytiles.cpp.
Referenced by AirportTileScopeResolver::GetVariable(), and IndustryTileScopeResolver::GetVariable().
StationGfx GetTranslatedAirportTileID | ( | StationGfx | gfx | ) |
Do airporttile gfx ID translation for NewGRFs.
gfx | the type to get the override for. |
Definition at line 96 of file newgrf_airporttiles.cpp.
References AirportTileSpec::Get(), AirportTileSpec::grf_prop, INVALID_AIRPORTTILE, and GRFFileProps::override.
Referenced by GetAirportGfx().