diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 13:41:52 +0100 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2017-12-19 13:41:52 +0100 |
commit | def701e42a40a1d95c3195be0c07d9b7b71cdd1d (patch) | |
tree | 2026fd15d6bf38d3323ecbf5ed71a61b016929bb /src/common.hpp | |
parent | 139779aecad253155d90ee1a68403dece48a3a02 (diff) |
Automatic camera following.
Diffstat (limited to 'src/common.hpp')
-rw-r--r-- | src/common.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/common.hpp b/src/common.hpp index 3131b69..13b843d 100644 --- a/src/common.hpp +++ b/src/common.hpp @@ -211,18 +211,14 @@ namespace game { }; class state_t { - protected: - friend entity_t; - friend interface::state_t; - - std::unordered_set<entity_t*> awake_entities; - std::unordered_set<unit_t*> selected_units; public: world::world_t world; interface::state_t *interface; double now = 0.0, dt; bool paused = false; procgen::prng_t dice_prng; + std::unordered_set<entity_t*> awake_entities; + std::unordered_set<unit_t*> selected_units; void start(void); void stop(void); @@ -244,11 +240,12 @@ namespace interface { float em; struct { - sf::Vector2f center; + v2f_t center; int target_zoom = 3; float zoom = 3.0f; bool panning = false; sf::Vector2f pan_ref; + bool following = true; } camera; struct { |