summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
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)