1
0
Fork 0

Codechange: Don't mark tiles dirty when deleting from animated tile list.

The callers of DeleteAnimatedTile already know if the tile needs refreshing, so it is redundant for DeleteAnimatedTile to do so.

Loosely backported from JGRPP.
pull/12885/head
Peter Nelson 2024-08-01 20:15:56 +01:00
parent 8ba4f8c872
commit d9f73dfd6d
No known key found for this signature in database
GPG Key ID: 8EF8F0A467DF75ED
2 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,6 @@ void DeleteAnimatedTile(TileIndex tile)
if (to_remove != _animated_tiles.end()) {
/* The order of the remaining elements must stay the same, otherwise the animation loop may miss a tile. */
_animated_tiles.erase(to_remove);
MarkTileDirtyByTile(tile);
}
}

View File

@ -603,8 +603,8 @@ static void AnimatePowerPlantSparks(TileIndex tile)
DeleteAnimatedTile(tile);
} else {
SetAnimationFrame(tile, m + 1);
MarkTileDirtyByTile(tile);
}
MarkTileDirtyByTile(tile);
}
static void AnimateToyFactory(TileIndex tile)
@ -649,8 +649,8 @@ static void AnimateOilWell(TileIndex tile, IndustryGfx gfx)
} else {
SetAnimationFrame(tile, m);
SetIndustryGfx(tile, gfx);
MarkTileDirtyByTile(tile);
}
MarkTileDirtyByTile(tile);
}
static void AnimateMineTower(TileIndex tile)
@ -906,6 +906,7 @@ static void TileLoop_Industry(TileIndex tile)
SetIndustryCompleted(tile);
SetIndustryConstructionStage(tile, 3);
DeleteAnimatedTile(tile);
MarkTileDirtyByTile(tile);
}
break;