Cache animated tile speed, use btree map for animated tiles

This commit is contained in:
Jonathan G Rennison
2020-11-24 19:02:38 +00:00
parent 72a7ae25e8
commit 2ad446369d
23 changed files with 267 additions and 56 deletions

View File

@@ -530,6 +530,14 @@ void AnimateNewObjectTile(TileIndex tile)
ObjectAnimationBase::AnimateTile(spec, Object::GetByTile(tile), tile, (spec->flags & OBJECT_FLAG_ANIM_RANDOM_BITS) != 0);
}
uint8 GetNewObjectTileAnimationSpeed(TileIndex tile)
{
const ObjectSpec *spec = ObjectSpec::GetByTile(tile);
if (spec == nullptr || !(spec->flags & OBJECT_FLAG_ANIMATION)) return 0;
return ObjectAnimationBase::GetAnimationSpeed(spec);
}
/**
* Trigger the update of animation on a single tile.
* @param o The object that got triggered.