summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-11-07 13:50:52 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-11-07 13:52:04 +0100
commitd0be87d32929c42502fb842aa2b0ab0233313b93 (patch)
treec88b88f63d08cbeaec100eff876676f60ddf78ba /src/common.hpp
parente28a62894f368cccc64932fe83c91f32d7cb7288 (diff)
Refactoring, introduce text.cpp, closer to an actual game.
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp19
1 files changed, 17 insertions, 2 deletions
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<unit_t*> 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<v2f_t> *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 <typename T>
T divide_rmi(T x, T y, T *rem)