Move the step_animation out of the animate2 module since it's only used in raycaster.cpp.
This commit is contained in:
parent
89ca204f3d
commit
83f62e3f45
3 changed files with 19 additions and 17 deletions
13
animate2.cpp
13
animate2.cpp
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue