diff --git a/src/animated_tile.cpp b/src/animated_tile.cpp index bd39c60a1d..96a99755aa 100644 --- a/src/animated_tile.cpp +++ b/src/animated_tile.cpp @@ -51,12 +51,37 @@ void AddAnimatedTile(TileIndex tile) */ void AnimateAnimatedTiles() { + extern void AnimateTile_Town(TileIndex tile); + extern void AnimateTile_Station(TileIndex tile); + extern void AnimateTile_Industry(TileIndex tile); + extern void AnimateTile_Object(TileIndex tile); + PerformanceAccumulator framerate(PFE_GL_LANDSCAPE); const TileIndex *ti = _animated_tiles.Begin(); while (ti < _animated_tiles.End()) { const TileIndex curr = *ti; - AnimateTile(curr); + switch (GetTileType(curr)) { + case MP_HOUSE: + AnimateTile_Town(curr); + break; + + case MP_STATION: + AnimateTile_Station(curr); + break; + + case MP_INDUSTRY: + AnimateTile_Industry(curr); + break; + + case MP_OBJECT: + AnimateTile_Object(curr); + break; + + default: + NOT_REACHED(); + } + /* During the AnimateTile call, DeleteAnimatedTile could have been called, * deleting an element we've already processed and pushing the rest one * slot to the left. We can detect this by checking whether the index diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 36e67d0984..81ebb7c741 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -540,7 +540,7 @@ static bool TransportIndustryGoods(TileIndex tile) } -static void AnimateTile_Industry(TileIndex tile) +void AnimateTile_Industry(TileIndex tile) { IndustryGfx gfx = GetIndustryGfx(tile); diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index a8ee17867a..a21b9a6ca5 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -696,7 +696,7 @@ static bool ClickTile_Object(TileIndex tile) return true; } -static void AnimateTile_Object(TileIndex tile) +void AnimateTile_Object(TileIndex tile) { AnimateNewObjectTile(tile); } diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 2ef2cdf815..12900e053f 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3316,7 +3316,7 @@ static void TileLoop_Station(TileIndex tile) } -static void AnimateTile_Station(TileIndex tile) +void AnimateTile_Station(TileIndex tile) { if (HasStationRail(tile)) { AnimateStationTile(tile); diff --git a/src/tile_cmd.h b/src/tile_cmd.h index 0b02fca0c2..32cc8ee3ae 100644 --- a/src/tile_cmd.h +++ b/src/tile_cmd.h @@ -182,13 +182,6 @@ static inline void AddProducedCargo(TileIndex tile, CargoArray &produced) proc(tile, produced); } -static inline void AnimateTile(TileIndex tile) -{ - AnimateTileProc *proc = _tile_type_procs[GetTileType(tile)]->animate_tile_proc; - assert(proc != NULL); - proc(tile); -} - static inline bool ClickTile(TileIndex tile) { ClickTileProc *proc = _tile_type_procs[GetTileType(tile)]->click_tile_proc; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 28a9fb8371..b5de80c618 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -397,7 +397,7 @@ static Foundation GetFoundation_Town(TileIndex tile, Slope tileh) * The newhouses animation supersedes regular ones * @param tile TileIndex of the house to animate */ -static void AnimateTile_Town(TileIndex tile) +void AnimateTile_Town(TileIndex tile) { if (GetHouseType(tile) >= NEW_HOUSE_OFFSET) { AnimateNewHouseTile(tile);