summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 02:51:42 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 02:51:42 +0000
commitd6e99a696aa582b81018078b68f6600c8030d643 (patch)
tree5c1451bbc76c31f78ddd169fca7780a0943f5910 /ui
parentReformat with new clang-format (diff)
downloadilt-d6e99a696aa582b81018078b68f6600c8030d643.tar.bz2
ilt-d6e99a696aa582b81018078b68f6600c8030d643.tar.xz
ilt-d6e99a696aa582b81018078b68f6600c8030d643.zip
WIP typedefing all the things - headers
Diffstat (limited to 'ui')
-rw-r--r--ui/builders/freeExtend.h2
-rw-r--r--ui/builders/straight.h4
-rw-r--r--ui/gameMainSelector.cpp2
-rw-r--r--ui/gameMainSelector.h3
-rw-r--r--ui/manualCameraController.h4
-rw-r--r--ui/window.h2
6 files changed, 9 insertions, 8 deletions
diff --git a/ui/builders/freeExtend.h b/ui/builders/freeExtend.h
index 55fe7ff..b276426 100644
--- a/ui/builders/freeExtend.h
+++ b/ui/builders/freeExtend.h
@@ -9,5 +9,5 @@ class BuilderFreeExtend : public EditNetwork::Builder {
void click(Network * network, const GeoData * geoData, const SDL_MouseButtonEvent & e, const Ray & ray) override;
void move(Network * network, const GeoData * geoData, const SDL_MouseMotionEvent & e, const Ray & ray) override;
- std::optional<glm::vec3> p1;
+ std::optional<Position3D> p1;
};
diff --git a/ui/builders/straight.h b/ui/builders/straight.h
index 1cde2b0..cf99a1d 100644
--- a/ui/builders/straight.h
+++ b/ui/builders/straight.h
@@ -9,7 +9,7 @@ class BuilderStraight : public EditNetwork::Builder {
void click(Network * network, const GeoData * geoData, const SDL_MouseButtonEvent & e, const Ray & ray) override;
void move(Network * network, const GeoData * geoData, const SDL_MouseMotionEvent & e, const Ray & ray) override;
- void create(Network * network, glm::vec3 p1, glm::vec3 p2) const;
+ void create(Network * network, Position3D p1, Position3D p2) const;
- std::optional<glm::vec3> p1;
+ std::optional<Position3D> p1;
};
diff --git a/ui/gameMainSelector.cpp b/ui/gameMainSelector.cpp
index 6c6935c..808e0e4 100644
--- a/ui/gameMainSelector.cpp
+++ b/ui/gameMainSelector.cpp
@@ -14,7 +14,7 @@
#include <typeinfo>
#include <vector>
-GameMainSelector::GameMainSelector(const Camera * c, glm::vec2 size) : UIComponent {{{}, size}}, camera {c} { }
+GameMainSelector::GameMainSelector(const Camera * c, ScreenAbsCoord size) : UIComponent {{{}, size}}, camera {c} { }
constexpr glm::vec2 TargetPos {5, 45};
diff --git a/ui/gameMainSelector.h b/ui/gameMainSelector.h
index 98cdf53..88db34b 100644
--- a/ui/gameMainSelector.h
+++ b/ui/gameMainSelector.h
@@ -1,6 +1,7 @@
#pragma once
#include "SDL_events.h"
+#include "config/types.h"
#include "special_members.h"
#include "uiComponent.h"
#include "worldOverlay.h"
@@ -26,7 +27,7 @@ public:
virtual void render(const SceneShader &) const;
};
- GameMainSelector(const Camera * c, glm::vec2 size);
+ GameMainSelector(const Camera * c, ScreenAbsCoord size);
void render(const UIShader & shader, const Position & pos) const override;
void render(const SceneShader & shader) const override;
diff --git a/ui/manualCameraController.h b/ui/manualCameraController.h
index d15fa76..46655bc 100644
--- a/ui/manualCameraController.h
+++ b/ui/manualCameraController.h
@@ -11,7 +11,7 @@ class Camera;
class ManualCameraController : public CameraController, public UIComponent {
public:
- explicit ManualCameraController(glm::vec2 f) : UIComponent {{}}, focus {f} { }
+ explicit ManualCameraController(Position2D f) : UIComponent {{}}, focus {f} { }
bool handleInput(const SDL_Event & e, const Position &) override;
void render(const UIShader &, const Position & parentPos) const override;
@@ -20,7 +20,7 @@ public:
private:
bool ctrl {false}, mrb {false};
- glm::vec2 focus;
+ Position2D focus;
float direction {quarter_pi};
float dist {40}, pitch {quarter_pi};
};
diff --git a/ui/window.h b/ui/window.h
index 183a65a..8f2b70b 100644
--- a/ui/window.h
+++ b/ui/window.h
@@ -36,7 +36,7 @@ protected:
GLInitHelper();
};
- const glm::ivec2 size;
+ const ScreenAbsCoord size;
SDL_WindowPtr m_window;
SDL_GLContextPtr glContext;
GLInitHelper glInithelper;