diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-15 18:11:02 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-15 18:11:02 +0100 |
commit | d1ea04251bf5f77a0eeda2ce1247a17c19556a6c (patch) | |
tree | c17bf8eb9a821dd2fd7c4e20344edee0ea0b04c6 /src/game | |
parent | 4dd7ac29fe0132b9f5896a84ccfe8d05363dfa74 (diff) |
Explicit phase control for animated textures.
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/effects.cpp | 5 | ||||
-rw-r--r-- | src/game/units.cpp | 16 |
2 files changed, 12 insertions, 9 deletions
diff --git a/src/game/effects.cpp b/src/game/effects.cpp index e80623e..306405f 100644 --- a/src/game/effects.cpp +++ b/src/game/effects.cpp @@ -51,7 +51,10 @@ fx_blood_t::fx_blood_t(state_t *game_, v2f_t x_, bool alien_) : effect_t(game_) void fx_blood_t::render_to(render::state_t *render) { - render->render(&assets::fx.blood, render_bounds); + double phase; + + phase = (game->now - ttl) + 1; + render->render(phase, &assets::fx.blood, render_bounds); } } // namespace game diff --git a/src/game/units.cpp b/src/game/units.cpp index 65f0a2c..d03ce76 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -357,11 +357,11 @@ void human_t::render_to(render::state_t *render) body_angle = move.angle; } - render->render(legs, render_bounds, move.angle); - render->render(body, render_bounds, body_angle); - render->render(&assets::human.head_idle, render_bounds, body_angle); + render->render(game->now * 10, legs, render_bounds, move.angle); + render->render(game->now * 10, body, render_bounds, body_angle); + render->render(game->now * 10, &assets::human.head_idle, render_bounds, body_angle); } else - render->render(&assets::human.dead, render_bounds); + render->render(game->now * 10, &assets::human.dead, render_bounds); unit_t::render_to(render); } @@ -370,8 +370,8 @@ alien_t::alien_t(game::state_t *game) : unit_t(game, UNIT_ALIEN) { cflags = CF_BODY_SMALL; health = max_health = 4; - size[0] = v2f_t(-0.2f, -0.2f); - size[1] = v2f_t(+0.2f, +0.2f); + size[0] = v2f_t(-0.2f, -0.3f); + size[1] = v2f_t(+0.2f, +0.3f); render_size[0] = v2f_t(-0.3f, -0.3f); render_size[1] = v2f_t(+0.3f, +0.3f); name = text::get(text::UNIT_ALIEN); @@ -432,10 +432,10 @@ void alien_t::render_to(render::state_t *render) moving = move.moving && !move.blocked; if (!dead) - render->render((moving ? &assets::alien.walking : + render->render(game->now * 20, (moving ? &assets::alien.walking : &assets::alien.idle), render_bounds, move.angle); else - render->render(&assets::alien.dead, render_bounds); + render->render(game->now * 20, &assets::alien.dead, render_bounds); unit_t::render_to(render); } |