From 5186351345d43801ac45acde8b7e30734eea0349 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 7 Nov 2017 18:33:03 +0100 Subject: Better unit say. --- src/common.hpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/common.hpp') diff --git a/src/common.hpp b/src/common.hpp index 043323a..44493eb 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -175,13 +175,14 @@ namespace game { class unit_t; class state_t { + double now; std::unordered_set selected_units; public: world::world_t world; void start(void); - void tick(double now); + void tick(double now_); // These are called by the interface. void select(rectf_t rect); @@ -250,13 +251,17 @@ namespace render { void load(std::string prefix, size_t xc, size_t yc); }; + typedef enum { + ALIGN_CENTER_BOTTOM + } text_align_t; + class state_t { sf::RenderWindow *window; - double now; void drender_text(rectf_t rect, std::string str); void drender_entity(world::entity_t *ent); public: + double now; state_t(sf::RenderWindow *window_); void begin_frame(double time_); @@ -265,6 +270,7 @@ namespace render { void render(animated_texture_t *anim, rectf_t bounds, bool mirror = false); void render(oriented_sprite_t *sprite, rectf_t bounds, float angle); + void render_text(v2f_t x, float height, const wchar_t *wstr, text_align_t align, sf::Color color); void render_hlrect(rectf_t rect, sf::Color color); void debug_path(std::list *path); @@ -285,8 +291,8 @@ namespace assets { }; namespace text { - extern std::string unit_no_path; - extern std::string unit_blocked; + extern const wchar_t *unit_no_path; + extern const wchar_t *unit_blocked; void load_strings(std::string lang); } -- cgit