summaryrefslogtreecommitdiff
path: root/src/render.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-15 18:13:28 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-15 18:13:28 +0100
commit6c5bb0dbe21cd173c86ff4264646566da95832bc (patch)
tree153714c861dff32d4badf65ad63e3a9f68f7a9fa /src/render.cpp
parentd1ea04251bf5f77a0eeda2ce1247a17c19556a6c (diff)
Color modulation for animated textures.
Diffstat (limited to 'src/render.cpp')
-rw-r--r--src/render.cpp6
1 files changed, 3 insertions, 3 deletions
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,