De-virtualise tile animation calls
This commit is contained in:
@@ -51,12 +51,37 @@ void AddAnimatedTile(TileIndex tile)
|
|||||||
*/
|
*/
|
||||||
void AnimateAnimatedTiles()
|
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);
|
PerformanceAccumulator framerate(PFE_GL_LANDSCAPE);
|
||||||
|
|
||||||
const TileIndex *ti = _animated_tiles.Begin();
|
const TileIndex *ti = _animated_tiles.Begin();
|
||||||
while (ti < _animated_tiles.End()) {
|
while (ti < _animated_tiles.End()) {
|
||||||
const TileIndex curr = *ti;
|
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,
|
/* During the AnimateTile call, DeleteAnimatedTile could have been called,
|
||||||
* deleting an element we've already processed and pushing the rest one
|
* 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
|
* slot to the left. We can detect this by checking whether the index
|
||||||
|
@@ -540,7 +540,7 @@ static bool TransportIndustryGoods(TileIndex tile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void AnimateTile_Industry(TileIndex tile)
|
void AnimateTile_Industry(TileIndex tile)
|
||||||
{
|
{
|
||||||
IndustryGfx gfx = GetIndustryGfx(tile);
|
IndustryGfx gfx = GetIndustryGfx(tile);
|
||||||
|
|
||||||
|
@@ -696,7 +696,7 @@ static bool ClickTile_Object(TileIndex tile)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AnimateTile_Object(TileIndex tile)
|
void AnimateTile_Object(TileIndex tile)
|
||||||
{
|
{
|
||||||
AnimateNewObjectTile(tile);
|
AnimateNewObjectTile(tile);
|
||||||
}
|
}
|
||||||
|
@@ -3316,7 +3316,7 @@ static void TileLoop_Station(TileIndex tile)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void AnimateTile_Station(TileIndex tile)
|
void AnimateTile_Station(TileIndex tile)
|
||||||
{
|
{
|
||||||
if (HasStationRail(tile)) {
|
if (HasStationRail(tile)) {
|
||||||
AnimateStationTile(tile);
|
AnimateStationTile(tile);
|
||||||
|
@@ -182,13 +182,6 @@ static inline void AddProducedCargo(TileIndex tile, CargoArray &produced)
|
|||||||
proc(tile, 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)
|
static inline bool ClickTile(TileIndex tile)
|
||||||
{
|
{
|
||||||
ClickTileProc *proc = _tile_type_procs[GetTileType(tile)]->click_tile_proc;
|
ClickTileProc *proc = _tile_type_procs[GetTileType(tile)]->click_tile_proc;
|
||||||
|
@@ -397,7 +397,7 @@ static Foundation GetFoundation_Town(TileIndex tile, Slope tileh)
|
|||||||
* The newhouses animation supersedes regular ones
|
* The newhouses animation supersedes regular ones
|
||||||
* @param tile TileIndex of the house to animate
|
* @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) {
|
if (GetHouseType(tile) >= NEW_HOUSE_OFFSET) {
|
||||||
AnimateNewHouseTile(tile);
|
AnimateNewHouseTile(tile);
|
||||||
|
Reference in New Issue
Block a user