Move the step_animation out of the animate2 module since it's only used in raycaster.cpp.

This commit is contained in:
Zed A. Shaw 2026-02-24 11:14:16 -05:00
parent 89ca204f3d
commit 83f62e3f45
3 changed files with 19 additions and 17 deletions

View file

@ -289,17 +289,10 @@ namespace animate2 {
}
}
void step_animation(DinkyECS::World& world, DinkyECS::Entity entity, sf::Sprite& sprite) {
if(auto anim = world.get_if<Animate2>(entity)) {
if(anim->playing) {
anim->update();
anim->apply(sprite);
}
}
}
void animate_entity(DinkyECS::World &world, DinkyECS::Entity entity) {
if(auto anim = world.get_if<Animate2>(entity)) {
auto anim = world.get_if<Animate2>(entity);
if(anim != nullptr && !anim->playing) {
anim->play();
}
}