Mercurial > hg > openttd
changeset 15937:87ebc893bb08 draft
(svn r20625) -Add: AirportTileSpec::GetByTile to simplify accessing the AirportTileSpec
author | rubidium <rubidium@openttd.org> |
---|---|
date | Thu, 26 Aug 2010 16:53:06 +0000 |
parents | a14b2cc58625 |
children | 9497c86d792c |
files | src/newgrf_airporttiles.cpp src/newgrf_airporttiles.h src/station_cmd.cpp |
diffstat | 3 files changed, 12 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/newgrf_airporttiles.cpp +++ b/src/newgrf_airporttiles.cpp @@ -48,6 +48,16 @@ } /** + * 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 */ void AirportTileSpec::ResetAirportTiles()
--- a/src/newgrf_airporttiles.h +++ b/src/newgrf_airporttiles.h @@ -29,6 +29,7 @@ GRFFileProps grf_prop; ///< properties related the the grf file static const AirportTileSpec *Get(StationGfx gfx); + static const AirportTileSpec *GetByTile(TileIndex tile); static void ResetAirportTiles();
--- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2807,7 +2807,7 @@ } 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) {