diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/game.hpp | 7 | ||||
-rw-r--r-- | src/game/units.cpp | 24 |
2 files changed, 17 insertions, 14 deletions
diff --git a/src/game/game.hpp b/src/game/game.hpp index 57dbb07..a952576 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -12,9 +12,10 @@ namespace game { }; enum { - CF_SOLID = 1, - CF_BODY = 2, - CF_BODY_SMALL = 4 + CF_BACKGROUND = 1, + CF_SOLID = 2, + CF_BODY = 4, + CF_BODY_SMALL = 8 }; extern size_t selection_cookie; diff --git a/src/game/units.cpp b/src/game/units.cpp index d1648d7..201b7be 100644 --- a/src/game/units.cpp +++ b/src/game/units.cpp @@ -58,6 +58,17 @@ void unit_t::render_to(render::state_t *render) if (move.moving && debug_draw_paths) render->debug_path(&move.path); + + if (say_time + 5.0 > game->now) { + v2f_t text_pos; + float height; + + text_pos = render_bounds[0] + v2f_t(render_bounds.dim(0) / 2, -render_bounds.dim(1) * 0.1); + height = size.dim_min() * 0.20f; + render->render_text(text_pos, height, say_text, + render::ALIGN_CENTER_BOTTOM, + sf::Color::White); + } } void unit_t::say(std::string str) @@ -304,6 +315,7 @@ void human_t::die(void) render_size[0] = v2f_t(-0.75f, -0.5f); render_size[1] = v2f_t(+0.75f, +0.5f); render_layer = -1; + cmodel.cflags = CF_BACKGROUND; unlink(); compute_bounds(); link(world); @@ -339,17 +351,6 @@ void human_t::render_to(render::state_t *render) } else render->render(&assets::human.dead, render_bounds); - if (say_time + 5.0 > game->now) { - v2f_t text_pos; - float height; - - text_pos = render_bounds[0] + v2f_t(render_bounds.dim(0) / 2, -render_bounds.dim(1) * 0.1); - height = size.dim_min() * 0.20f; - render->render_text(text_pos, height, say_text, - render::ALIGN_CENTER_BOTTOM, - sf::Color::White); - } - unit_t::render_to(render); } @@ -381,6 +382,7 @@ void alien_t::sleep(void) void alien_t::die(void) { render_layer = -1; + cmodel.cflags = CF_BACKGROUND; } void alien_t::think(void) |