summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.hpp')
-rw-r--r--src/common.hpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/common.hpp b/src/common.hpp
index a301881..ecdb549 100644
--- a/src/common.hpp
+++ b/src/common.hpp
@@ -9,6 +9,10 @@
#include <SFML/Graphics.hpp>
#include "math.hpp"
+extern bool debug_draw_cmodels;
+extern bool debug_draw_paths;
+extern bool debug_draw_tile_coords;
+
namespace procgen {
class prng_t {
uint32_t state = 0;
@@ -95,11 +99,6 @@ namespace world {
protected:
friend render::state_t;
- typedef struct {
- v2f_t x;
- std::string text;
- } debug_t;
- std::list<debug_t> debug;
public:
world_t(void);
@@ -177,7 +176,9 @@ namespace game {
void start(void);
void tick(double now);
- void debug_click(v2f_t x);
+ // These are called by the interface.
+ void select(rectf_t rect);
+ void command(v2f_t x);
};
}
@@ -190,10 +191,15 @@ namespace interface {
sf::Vector2f center;
int target_zoom = 3;
float zoom = 3.0f;
- bool dragging = false;
- sf::Vector2f drag_ref;
+ bool panning = false;
+ sf::Vector2f pan_ref;
} camera;
+ struct {
+ bool selecting = false;
+ rectf_t rect;
+ } select;
+
public:
state_t(sf::RenderWindow *window_, game::state_t *game);
void tick(void);