diff options
Diffstat (limited to 'src/render.cpp')
-rw-r--r-- | src/render.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/render.cpp b/src/render.cpp index a7c6ba6..0e04aab 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -144,7 +144,7 @@ void state_t::render(game::state_t *game) } } -void state_t::render(animated_texture_t *anim, rectf_t bounds, bool mirror){ +void state_t::render(double phase, animated_texture_t *anim, rectf_t bounds, bool mirror){ size_t frame; if (!anim) @@ -153,7 +153,7 @@ void state_t::render(animated_texture_t *anim, rectf_t bounds, bool mirror){ if (!anim->frame_count) return; - frame = floor(fmod(now * 20.0, anim->frame_count)); + frame = floor(fmod(phase, 1.0) * anim->frame_count); wot_rect.setTexture(anim->frames + frame, true); wot_rect.setFillColor(sf::Color::White); @@ -173,13 +173,13 @@ void state_t::render(animated_texture_t *anim, rectf_t bounds, bool mirror){ wot_rect.setScale(v2f_t(1, 1)); } -void state_t::render(oriented_sprite_t *sprite, rectf_t bounds, float angle) +void state_t::render(double phase, oriented_sprite_t *sprite, rectf_t bounds, float angle) { size_t index; bool mirror; index = sprite->select_index(angle, &mirror); - render(sprite->textures + index, bounds, mirror); + render(phase, sprite->textures + index, bounds, mirror); } void state_t::render_text(v2f_t x, float height, std::string str, |