diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-14 22:30:26 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-14 22:30:26 +0100 |
commit | ac86313ae58e8274454aa5999d8bdd4d91faa04e (patch) | |
tree | 8aed601c360c17b45661499fe1d7cd16f4f9673a /src | |
parent | 47ac1b7868b8bfb3e5fe71395a34124bf9f7209a (diff) |
Minor improvements.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/game.hpp | 7 | ||||
-rw-r--r-- | src/game/units.cpp | 24 | ||||
-rw-r--r-- | src/text.cpp | 2 |
3 files changed, 18 insertions, 15 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) diff --git a/src/text.cpp b/src/text.cpp index 1a36180..de335eb 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -2,7 +2,7 @@ namespace text { -language_t language = LANG_POLISH; +language_t language = LANG_ENGLISH; static const char *human_names[] = { "Kowalski", "Jackson", "Carter", "O'Neill", "Hammond", "Mitchell" |