summaryrefslogtreecommitdiff
path: root/src/common.hpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-11-07 12:41:23 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-11-07 12:41:23 +0100
commite28a62894f368cccc64932fe83c91f32d7cb7288 (patch)
tree63588a2791d1fa474327807b9185f864d1e2974e /src/common.hpp
parent7471347839f30a85e985891b945a721967fcfb86 (diff)
Hide debug draws by default, start working on selecting.
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);