From 4bf6b8dad9923d6f3687e8ced72a4eda6a56220d Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 2 Jan 2022 20:28:24 +0000 Subject: No need to pass GameState around, it has a global pointer --- ui/gameMainWindow.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'ui/gameMainWindow.cpp') diff --git a/ui/gameMainWindow.cpp b/ui/gameMainWindow.cpp index 41d55da..b904388 100644 --- a/ui/gameMainWindow.cpp +++ b/ui/gameMainWindow.cpp @@ -33,10 +33,7 @@ public: class GameMainSelector : public UIComponent { public: - GameMainSelector(const Camera * c, glm::vec2 size, const GameState * gs) : - UIComponent {{{}, size}}, camera {c}, gameState {gs} - { - } + GameMainSelector(const Camera * c, glm::vec2 size) : UIComponent {{{}, size}}, camera {c} { } void render(const UIShader &, const Position &) const override @@ -63,13 +60,12 @@ public: private: const Camera * camera; - const GameState * gameState; }; -GameMainWindow::GameMainWindow(size_t w, size_t h, const GameState * gameState) : +GameMainWindow::GameMainWindow(size_t w, size_t h) : Window {w, h, "I Like Trains"}, camera {{-1250.0F, -1250.0F, 35.0F}, quarter_pi, rdiv(w, h), 0.1F, 10000.0F} { - uiComponents.create(&camera, glm::vec2 {w, h}, gameState); + uiComponents.create(&camera, glm::vec2 {w, h}); uiComponents.create(); uiComponents.create(glm::vec2 {-1150, -1150}); @@ -86,9 +82,9 @@ GameMainWindow::tick(TickDuration) } void -GameMainWindow::render(const GameState * gameState) const +GameMainWindow::render() const { glEnable(GL_DEPTH_TEST); gameState->world.apply(&Renderable::render, shader); - Window::render(gameState); + Window::render(); } -- cgit v1.2.3