MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / AddAnimatedTile

Function AddAnimatedTile

src/animated_tile.cpp:56–70  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

54 * @param mark_dirty whether to also mark the tile dirty.
55 */
56void AddAnimatedTile(TileIndex tile, bool mark_dirty)
57{
58 if (mark_dirty) MarkTileDirtyByTile(tile);
59
60 const AnimatedTileState state = GetAnimatedTileState(tile);
61
62 /* Tile is already animated so nothing needs to happen. */
63 if (state == AnimatedTileState::Animated) return;
64
65 /* Tile has no previous animation state, so add to the tile list. If the state is anything
66 * other than None (e.g. Deleted) then the tile will still be in the list and does not need to be added again. */
67 if (state == AnimatedTileState::None) _animated_tiles.push_back(tile);
68
69 SetAnimatedTileState(tile, AnimatedTileState::Animated);
70}
71
72/**
73 * Animate all tiles in the animated tile list, i.e.\ call AnimateTile on them.

Callers 8

MakeIndustryTileBiggerFunction · 0.85
TileLoop_IndustryFunction · 0.85
DoCreateNewIndustryFunction · 0.85
BubbleTickFunction · 0.85
ChangeAnimationFrameMethod · 0.85
CmdBuildAirportFunction · 0.85
TileLoop_TownFunction · 0.85
ClearMakeHouseTileFunction · 0.85

Calls 4

GetAnimatedTileStateFunction · 0.85
SetAnimatedTileStateFunction · 0.85
push_backMethod · 0.80
MarkTileDirtyByTileFunction · 0.70

Tested by

no test coverage detected