X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fapp%2FMasterState.hpp;h=8290e86886b53d59c246ea36d076c34acadf4dfd;hb=392826deaf802ac0960ed3924a3f98b9d18d381b;hp=f62c77309ea7ea4a04133c5b1013e5accebded10;hpb=c5556cf5f6813887a3503433c021ccd2e7fae865;p=blobs.git diff --git a/src/app/MasterState.hpp b/src/app/MasterState.hpp index f62c773..8290e86 100644 --- a/src/app/MasterState.hpp +++ b/src/app/MasterState.hpp @@ -5,6 +5,9 @@ #include "Assets.hpp" #include "../graphics/Camera.hpp" +#include "../ui/CreaturePanel.hpp" +#include "../ui/RecordsPanel.hpp" +#include "../ui/TimePanel.hpp" namespace blobs { @@ -28,12 +31,26 @@ public: MasterState &operator =(MasterState &&) = delete; public: - void SetReference(world::Body &r) { reference = &r; } + graphics::Camera &GetCamera() noexcept { return cam; } + const graphics::Camera &GetCamera() const noexcept { return cam; } + + ui::CreaturePanel &GetCreaturePanel() noexcept { return cp; } + const ui::CreaturePanel &GetCreaturePanel() const noexcept { return cp; } + + ui::RecordsPanel &GetRecordsPanel() noexcept { return rp; } + const ui::RecordsPanel &GetRecordsPanel() const noexcept { return rp; } + + ui::TimePanel &GetTimePanel() noexcept { return tp; } + const ui::TimePanel &GetTimePanel() const noexcept { return tp; } private: void OnResize(int w, int h) override; void OnKeyDown(const SDL_KeyboardEvent &) override; + void OnMouseDown(const SDL_MouseButtonEvent &) override; + void OnMouseUp(const SDL_MouseButtonEvent &) override; + void OnMouseMotion(const SDL_MouseMotionEvent &) override; + void OnMouseWheel(const SDL_MouseWheelEvent &) override; void OnUpdate(int dt) override; void OnRender(graphics::Viewport &) override; @@ -44,9 +61,16 @@ private: private: Assets &assets; world::Simulation ∼ - world::Body *reference; graphics::Camera cam; + double cam_dist; + double cam_tgt_dist; + glm::dvec3 cam_orient; + bool cam_dragging; + + ui::CreaturePanel cp; + ui::RecordsPanel rp; + ui::TimePanel tp; int remain; int thirds;