summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp14
1 files changed, 10 insertions, 4 deletions
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<unit_t*> 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<v2f_t> *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);
}