From 6c5bb0dbe21cd173c86ff4264646566da95832bc Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Fri, 15 Dec 2017 18:13:28 +0100 Subject: Color modulation for animated textures. --- src/render.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/render.cpp') diff --git a/src/render.cpp b/src/render.cpp index 0e04aab..792d70d 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(double phase, animated_texture_t *anim, rectf_t bounds, bool mirror){ +void state_t::render(double phase, animated_texture_t *anim, rectf_t bounds, sf::Color color, bool mirror){ size_t frame; if (!anim) @@ -156,7 +156,7 @@ void state_t::render(double phase, animated_texture_t *anim, rectf_t bounds, boo frame = floor(fmod(phase, 1.0) * anim->frame_count); wot_rect.setTexture(anim->frames + frame, true); - wot_rect.setFillColor(sf::Color::White); + wot_rect.setFillColor(color); if (!mirror) { wot_rect.setPosition(bounds[0]); @@ -179,7 +179,7 @@ void state_t::render(double phase, oriented_sprite_t *sprite, rectf_t bounds, fl bool mirror; index = sprite->select_index(angle, &mirror); - render(phase, sprite->textures + index, bounds, mirror); + render(phase, sprite->textures + index, bounds, sf::Color::White, mirror); } void state_t::render_text(v2f_t x, float height, std::string str, -- cgit