From e28a62894f368cccc64932fe83c91f32d7cb7288 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Tue, 7 Nov 2017 12:41:23 +0100 Subject: Hide debug draws by default, start working on selecting. --- src/common.hpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/common.hpp') 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 #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; 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); -- cgit