|
@@ -10,25 +10,25 @@
|
|
|
/** @file animated_tile.cpp Everything related to animated tiles. */
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
#include "core/alloc_func.hpp"
|
|
|
#include "core/smallvec_type.hpp"
|
|
|
#include "tile_cmd.h"
|
|
|
#include "viewport_func.h"
|
|
|
#include "framerate_type.h"
|
|
|
|
|
|
#include "safeguards.h"
|
|
|
|
|
|
/** The table/list with animated tiles. */
|
|
|
SmallVector<TileIndex, 256> _animated_tiles;
|
|
|
std::vector<TileIndex> _animated_tiles;
|
|
|
|
|
|
/**
|
|
|
* Removes the given tile from the animated tile table.
|
|
|
* @param tile the tile to remove
|
|
|
*/
|
|
|
void DeleteAnimatedTile(TileIndex tile)
|
|
|
{
|
|
|
auto to_remove = std::find(_animated_tiles.begin(), _animated_tiles.end(), 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);
|