1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 10:52:41 +01:00

Codechange: Allow adding to animated tile list without marking dirty.

This avoids redundant tile refreshes when the caller has already marked a tile dirty, or knows it does not need refreshing.

Loosely backported from JGRPP.
This commit is contained in:
Peter Nelson
2024-08-01 21:11:35 +01:00
committed by Peter Nelson
parent 79369a886a
commit 8754846901
5 changed files with 8 additions and 8 deletions

View File

@@ -32,13 +32,13 @@ void DeleteAnimatedTile(TileIndex tile)
}
/**
* Add the given tile to the animated tile table (if it does not exist
* on that table yet). Also increases the size of the table if necessary.
* Add the given tile to the animated tile table (if it does not exist yet).
* @param tile the tile to make animated
* @param mark_dirty whether to also mark the tile dirty.
*/
void AddAnimatedTile(TileIndex tile)
void AddAnimatedTile(TileIndex tile, bool mark_dirty)
{
MarkTileDirtyByTile(tile);
if (mark_dirty) MarkTileDirtyByTile(tile);
include(_animated_tiles, tile);
}