From d0be87d32929c42502fb842aa2b0ab0233313b93 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 7 Nov 2017 13:50:52 +0100 Subject: Refactoring, introduce text.cpp, closer to an actual game. --- src/common.hpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/common.hpp') diff --git a/src/common.hpp b/src/common.hpp index ecdb549..043323a 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -128,9 +128,12 @@ namespace world { size_t cookie = 0; public: + int type; cmodel_t cmodel; rectf_t render_bounds; + entity_t(int type_); + void link(world_t *world); void unlink(); @@ -169,7 +172,11 @@ namespace world { namespace game { bool load_assets(void); + class unit_t; + class state_t { + std::unordered_set selected_units; + public: world::world_t world; @@ -203,7 +210,7 @@ namespace interface { public: state_t(sf::RenderWindow *window_, game::state_t *game); void tick(void); - void render(void); + void render_to(render::state_t *render); }; } @@ -247,7 +254,6 @@ namespace render { sf::RenderWindow *window; double now; - void drender_rect(rectf_t rect, sf::Color color); void drender_text(rectf_t rect, std::string str); void drender_entity(world::entity_t *ent); public: @@ -259,6 +265,8 @@ 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_hlrect(rectf_t rect, sf::Color color); + void debug_path(std::list *path); }; } @@ -276,6 +284,13 @@ namespace assets { void load(void); }; +namespace text { + extern std::string unit_no_path; + extern std::string unit_blocked; + + void load_strings(std::string lang); +} + // Divide and round to minus infinity. template T divide_rmi(T x, T y, T *rem) -- cgit