From b84b39f099e8a1f66fb95d371b60b1546fb3142a Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 21 Apr 2018 15:05:44 +0200 Subject: Replicator avatar. --- assets/units/repl/avatar_0.png | Bin 0 -> 10609 bytes src/game/assets.cpp | 1 + src/game/game.hpp | 2 +- src/game/interface.cpp | 4 ++++ src/game/unit_repl.cpp | 6 +----- 5 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 assets/units/repl/avatar_0.png diff --git a/assets/units/repl/avatar_0.png b/assets/units/repl/avatar_0.png new file mode 100644 index 0000000..62a1a64 Binary files /dev/null and b/assets/units/repl/avatar_0.png differ diff --git a/src/game/assets.cpp b/src/game/assets.cpp index f92aae0..106387d 100644 --- a/src/game/assets.cpp +++ b/src/game/assets.cpp @@ -76,6 +76,7 @@ void load(void) nest.death.load("assets/units/nest/death.ogg"); repl.idle.load("assets/units/repl/idle_", 4); + repl.avatar.load("assets/units/repl/avatar_", 1); repl.sound.load("assets/units/repl/sound.ogg"); repl.damage.load("assets/units/repl/damage1.ogg"); repl.damage.load("assets/units/repl/damage2.ogg"); diff --git a/src/game/game.hpp b/src/game/game.hpp index 6d6e773..1cd61aa 100644 --- a/src/game/game.hpp +++ b/src/game/game.hpp @@ -83,7 +83,7 @@ namespace game { } nest_assets_t; typedef struct { - render::animated_texture_t idle, dead; + render::animated_texture_t idle, avatar; audio::sound_t sound, damage; } repl_assets_t; diff --git a/src/game/interface.cpp b/src/game/interface.cpp index 34bbcf2..1119367 100644 --- a/src/game/interface.cpp +++ b/src/game/interface.cpp @@ -358,6 +358,10 @@ static void render_avatar(render::state_t *render, game::unit_t *unit, v2f_t at, image = &assets::soldier.avatar; break; + case game::unit_t::UNIT_REPL: + image = &assets::repl.avatar; + break; + default: image = &assets::deco.eyething; break; diff --git a/src/game/unit_repl.cpp b/src/game/unit_repl.cpp index 584778d..08a43d2 100644 --- a/src/game/unit_repl.cpp +++ b/src/game/unit_repl.cpp @@ -48,11 +48,7 @@ void unit_repl_t::on_death(void) void unit_repl_t::render_to(render::state_t *render) { - if (!dead) - render->render(game->now, &assets::repl.idle, render_bounds); - else - render->render(game->now, &assets::repl.dead, render_bounds); - + render->render(game->now, &assets::repl.idle, render_bounds); unit_t::render_to(render); } -- cgit