From 2f8d7643d03f39fa848576692264d0fe3a37ed91 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 6 Nov 2023 20:48:33 +0000 Subject: Reformat with new clang-format --- ui/font.cpp | 1 + ui/font.h | 1 + ui/gameMainSelector.cpp | 1 + ui/gameMainWindow.cpp | 4 ++++ ui/iconButton.h | 1 + ui/modeHelper.h | 1 + ui/text.cpp | 1 + ui/text.h | 1 + ui/uiComponent.cpp | 1 + ui/uiComponent.h | 1 + ui/uiComponentPlacer.cpp | 1 + ui/window.h | 1 + 12 files changed, 15 insertions(+) (limited to 'ui') diff --git a/ui/font.cpp b/ui/font.cpp index 108f905..ebd856d 100644 --- a/ui/font.cpp +++ b/ui/font.cpp @@ -14,6 +14,7 @@ #include #include #include + // IWYU pragma: no_forward_declare FT_LibraryRec_ std::string diff --git a/ui/font.h b/ui/font.h index 6c86e18..2f3337f 100644 --- a/ui/font.h +++ b/ui/font.h @@ -31,6 +31,7 @@ public: glm::ivec2 bearing; long advance; }; + struct FontTexture { glTexture texture; unsigned int used; diff --git a/ui/gameMainSelector.cpp b/ui/gameMainSelector.cpp index 081718d..6c6935c 100644 --- a/ui/gameMainSelector.cpp +++ b/ui/gameMainSelector.cpp @@ -15,6 +15,7 @@ #include GameMainSelector::GameMainSelector(const Camera * c, glm::vec2 size) : UIComponent {{{}, size}}, camera {c} { } + constexpr glm::vec2 TargetPos {5, 45}; void diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index c35c9c6..b94accd 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -48,6 +48,7 @@ GameMainWindow::render() const SceneRenderer::render(*this); Window::render(); } + void GameMainWindow::content(const SceneShader & shader) const { @@ -59,17 +60,20 @@ GameMainWindow::content(const SceneShader & shader) const gameState->world.apply(&Renderable::render, shader); uiComponents.apply(&WorldOverlay::render, shader); } + void GameMainWindow::environment(const SceneShader & s, const SceneRenderer & r) const { // default for now SceneProvider::environment(s, r); } + void GameMainWindow::lights(const SceneShader & shader) const { gameState->world.apply(&Renderable::lights, shader); } + void GameMainWindow::shadows(const ShadowMapper & shadowMapper) const { diff --git a/ui/iconButton.h b/ui/iconButton.h index 6ac9317..0afe92d 100644 --- a/ui/iconButton.h +++ b/ui/iconButton.h @@ -10,6 +10,7 @@ class UIShader; union SDL_Event; static const constexpr glm::vec2 ICON_SIZE {32.F, 32.F}; + class IconButton : public UIComponent { public: IconButton(const std::string & icon, glm::vec2 position, UIEvent click); diff --git a/ui/modeHelper.h b/ui/modeHelper.h index 77707f2..d20f2db 100644 --- a/ui/modeHelper.h +++ b/ui/modeHelper.h @@ -4,6 +4,7 @@ union SDL_Event; enum ModeSecondClick { Unset, Reset, NoAction }; + template class Mode { public: explicit Mode(Target & t) : target {t} { } diff --git a/ui/text.cpp b/ui/text.cpp index d24c268..b776b90 100644 --- a/ui/text.cpp +++ b/ui/text.cpp @@ -12,6 +12,7 @@ #include const std::filesystem::path font {"/usr/share/fonts/hack/Hack-Regular.ttf"}; + Text::Text(std::string_view s, Position pos, glm::vec3 c) : UIComponent {pos}, colour {c} { for (const auto & textureQuads : diff --git a/ui/text.h b/ui/text.h index 9fe87d1..de2fe2e 100644 --- a/ui/text.h +++ b/ui/text.h @@ -25,6 +25,7 @@ private: glVertexArray vao; glBuffer vbo; }; + std::vector models; glm::vec3 colour; }; diff --git a/ui/uiComponent.cpp b/ui/uiComponent.cpp index e480fbc..aa4838d 100644 --- a/ui/uiComponent.cpp +++ b/ui/uiComponent.cpp @@ -20,6 +20,7 @@ UIComponent::Position::operator&(const glm::vec2 & pos) const { return (pos.x >= origin.x && pos.y >= origin.y && pos.x < origin.x + size.x && pos.y < origin.y + size.y); } + bool UIComponent::Position::operator&(const SDL_MouseButtonEvent & pos) const { diff --git a/ui/uiComponent.h b/ui/uiComponent.h index 75c2284..71d2659 100644 --- a/ui/uiComponent.h +++ b/ui/uiComponent.h @@ -18,6 +18,7 @@ public: bool operator&(const SDL_MouseButtonEvent &) const; bool operator&(const glm::vec2 &) const; }; + explicit UIComponent(Position); virtual ~UIComponent() = default; diff --git a/ui/uiComponentPlacer.cpp b/ui/uiComponentPlacer.cpp index 368e772..5e645d8 100644 --- a/ui/uiComponentPlacer.cpp +++ b/ui/uiComponentPlacer.cpp @@ -16,6 +16,7 @@ UIComponentPlacer::next(glm::vec2 size) max = std::max(max, size[1 - axis]); return n; } + glm::vec2 UIComponentPlacer::getLimit() const { diff --git a/ui/window.h b/ui/window.h index 369228a..183a65a 100644 --- a/ui/window.h +++ b/ui/window.h @@ -31,6 +31,7 @@ public: protected: virtual void render() const; + struct GLInitHelper { GLInitHelper(); }; -- cgit v1.2.3