mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-09 07:29:44 +00:00
(svn r20625) -Add: AirportTileSpec::GetByTile to simplify accessing the AirportTileSpec
This commit is contained in:
parent
9982b5fd00
commit
82ef98a90a
@ -47,6 +47,16 @@ AirportTileOverrideManager _airporttile_mngr(NEW_AIRPORTTILE_OFFSET, NUM_AIRPORT
|
||||
return &AirportTileSpec::tiles[gfx];
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve airport tile spec for the given airport tile.
|
||||
* @param tile The airport tile.
|
||||
* @return A pointer to the corresponding AirportTileSpec.
|
||||
*/
|
||||
/* static */ const AirportTileSpec *AirportTileSpec::GetByTile(TileIndex tile)
|
||||
{
|
||||
return AirportTileSpec::Get(GetAirportGfx(tile));
|
||||
}
|
||||
|
||||
/**
|
||||
* This function initializes the tile array of AirportTileSpec
|
||||
*/
|
||||
|
@ -29,6 +29,7 @@ struct AirportTileSpec {
|
||||
GRFFileProps grf_prop; ///< properties related the the grf file
|
||||
|
||||
static const AirportTileSpec *Get(StationGfx gfx);
|
||||
static const AirportTileSpec *GetByTile(TileIndex tile);
|
||||
|
||||
static void ResetAirportTiles();
|
||||
|
||||
|
@ -2807,7 +2807,7 @@ static void GetTileDesc_Station(TileIndex tile, TileDesc *td)
|
||||
}
|
||||
|
||||
if (IsAirport(tile)) {
|
||||
const AirportTileSpec *ats = AirportTileSpec::Get(GetAirportGfx(tile));
|
||||
const AirportTileSpec *ats = AirportTileSpec::GetByTile(tile);
|
||||
td->airport_tile_name = ats->name;
|
||||
|
||||
if (ats->grf_prop.grffile != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user