OpenTTD Source 20241224-master-gf74b0cf984
animated_tile.cpp File Reference

Everything related to animated tiles. More...

#include "stdafx.h"
#include "animated_tile_func.h"
#include "animated_tile_map.h"
#include "tile_cmd.h"
#include "viewport_func.h"
#include "framerate_type.h"
#include "safeguards.h"

Go to the source code of this file.

Functions

void DeleteAnimatedTile (TileIndex tile, bool immediate)
 Stops animation on the given tile.
 
void AddAnimatedTile (TileIndex tile, bool mark_dirty)
 Add the given tile to the animated tile table (if it does not exist yet).
 
void AnimateAnimatedTiles ()
 Animate all tiles in the animated tile list, i.e. call AnimateTile on them.
 
void InitializeAnimatedTiles ()
 Initialize all animated tile variables to some known begin point.
 

Variables

std::vector< TileIndex_animated_tiles
 The table/list with animated tiles.
 

Detailed Description

Everything related to animated tiles.

Definition in file animated_tile.cpp.

Function Documentation

◆ AddAnimatedTile()

void AddAnimatedTile ( TileIndex  tile,
bool  mark_dirty 
)

Add the given tile to the animated tile table (if it does not exist yet).

Parameters
tilethe tile to make animated
mark_dirtywhether to also mark the tile dirty.

Definition at line 56 of file animated_tile.cpp.

References _animated_tiles, Animated, GetAnimatedTileState(), MarkTileDirtyByTile(), None, and SetAnimatedTileState().

Referenced by AnimationBase< Tbase, Tspec, Tobj, Textra, GetCallback, Tframehelper >::ChangeAnimationFrame(), ClearMakeHouseTile(), CmdBuildAirport(), DoCreateNewIndustry(), and TileLoop_Town().

◆ AnimateAnimatedTiles()

void AnimateAnimatedTiles ( )

Animate all tiles in the animated tile list, i.e. call AnimateTile on them.

Definition at line 75 of file animated_tile.cpp.

References _animated_tiles, Animated, GetAnimatedTileState(), None, PFE_GL_LANDSCAPE, and SetAnimatedTileState().

Referenced by StateGameLoop().

◆ DeleteAnimatedTile()

void DeleteAnimatedTile ( TileIndex  tile,
bool  immediate 
)

Stops animation on the given tile.

Parameters
tilethe tile to remove
immediateimmediately delete the tile from the animated tile list instead of waiting for the next tick.

Definition at line 27 of file animated_tile.cpp.

References _animated_tiles, Animated, Deleted, GetAnimatedTileState(), None, and SetAnimatedTileState().

Referenced by AnimationBase< Tbase, Tspec, Tobj, Textra, GetCallback, Tframehelper >::AnimateTile(), AnimateTile_Town(), AnimationBase< Tbase, Tspec, Tobj, Textra, GetCallback, Tframehelper >::ChangeAnimationFrame(), CmdBuildRailStation(), and RemoveRoadStop().

◆ InitializeAnimatedTiles()

void InitializeAnimatedTiles ( )

Initialize all animated tile variables to some known begin point.

Definition at line 106 of file animated_tile.cpp.

References _animated_tiles.

Variable Documentation

◆ _animated_tiles

std::vector<TileIndex> _animated_tiles

The table/list with animated tiles.

Definition at line 20 of file animated_tile.cpp.

Referenced by AddAnimatedTile(), AfterLoadGame(), AnimateAnimatedTiles(), DeleteAnimatedTile(), InitializeAnimatedTiles(), and ANITChunkHandler::Load().