From 880fedc192ff65a9916d8f0f7c94f930b62822ad Mon Sep 17 00:00:00 2001 From: yexo Date: Mon, 22 Feb 2010 14:16:41 +0000 Subject: (svn r19195) -Codechange: actually draw newgrf airport tiles --- src/station_cmd.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/station_cmd.cpp') 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; -- cgit v1.2.3-54-g00ecf