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

Codechange: Turn AnimationTrigger enums into enum classes. (#14067)

This commit is contained in:
frosch
2025-04-21 20:53:31 +02:00
committed by GitHub
parent 61a0a520f6
commit d7ddea4032
34 changed files with 124 additions and 112 deletions

View File

@@ -564,9 +564,9 @@ void AnimateNewObjectTile(TileIndex tile)
*/
void TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
{
if (!HasBit(spec->animation.triggers, trigger)) return;
if (!spec->animation.triggers.Test(trigger)) return;
ObjectAnimationBase::ChangeAnimationFrame(CBID_OBJECT_ANIMATION_TRIGGER, spec, o, tile, Random(), trigger);
ObjectAnimationBase::ChangeAnimationFrame(CBID_OBJECT_ANIMATION_TRIGGER, spec, o, tile, Random(), to_underlying(trigger));
}
/**
@@ -577,7 +577,7 @@ void TriggerObjectTileAnimation(Object *o, TileIndex tile, ObjectAnimationTrigge
*/
void TriggerObjectAnimation(Object *o, ObjectAnimationTrigger trigger, const ObjectSpec *spec)
{
if (!HasBit(spec->animation.triggers, trigger)) return;
if (!spec->animation.triggers.Test(trigger)) return;
for (TileIndex tile : o->location) {
TriggerObjectTileAnimation(o, tile, trigger, spec);