diff options
author | yexo <yexo@openttd.org> | 2010-02-22 14:16:41 +0000 |
---|---|---|
committer | yexo <yexo@openttd.org> | 2010-02-22 14:16:41 +0000 |
commit | 880fedc192ff65a9916d8f0f7c94f930b62822ad (patch) | |
tree | 650ae38dafdc7a97eb742f836804696cbbf6d885 /src/station_cmd.cpp | |
parent | 80fb5c70c8e5c41d519946fe59fba4185fe7af89 (diff) | |
download | openttd-880fedc192ff65a9916d8f0f7c94f930b62822ad.tar.xz |
(svn r19195) -Codechange: actually draw newgrf airport tiles
Diffstat (limited to 'src/station_cmd.cpp')
-rw-r--r-- | src/station_cmd.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 4539fb38f..807bbcb9f 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -2398,7 +2398,18 @@ static void DrawTile_Station(TileInfo *ti) } if (IsAirport(ti->tile)) { - switch (GetStationGfx(ti->tile)) { + StationGfx gfx = GetAirportGfx(ti->tile); + if (gfx >= NEW_AIRPORTTILE_OFFSET) { + const AirportTileSpec *ats = AirportTileSpec::Get(gfx); + if (ats->grf_prop.spritegroup != NULL && DrawNewAirportTile(ti, Station::GetByTile(ti->tile), gfx, ats)) { + return; + } + /* No sprite group (or no valid one) found, meaning no graphics associated. + * Use the substitute one instead */ + assert(ats->grf_prop.subst_id != INVALID_AIRPORTTILE); + gfx = ats->grf_prop.subst_id; + } + switch (gfx) { case APT_RADAR_GRASS_FENCE_SW: t = &_station_display_datas_airport_radar_grass_fence_sw[GetStationAnimationFrame(ti->tile)]; break; |