From 287cc28e54fc7a967fe521eb2b1b1e76ccd1f643 Mon Sep 17 00:00:00 2001 From: Joseph Walton-Rivers <joseph@walton-rivers.uk> Date: Sat, 26 Nov 2022 15:09:42 +0000 Subject: [PATCH] deal with a few warnings --- demo/demo/robot/programmer.cpp | 1 - fggl/scenes/menu.cpp | 6 +++--- include/fggl/gfx/paint.hpp | 6 +++--- include/fggl/gui/widgets.hpp | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/demo/demo/robot/programmer.cpp b/demo/demo/robot/programmer.cpp index 5d3a1e5..a4592d5 100644 --- a/demo/demo/robot/programmer.cpp +++ b/demo/demo/robot/programmer.cpp @@ -46,7 +46,6 @@ namespace demo::robot { } void Timeline::renderInstructions(fggl::gfx::Paint& paint) { - const auto size = this->size(); const fggl::math::vec2f barExtents{16, 16}; for ( auto track=0U; track < m_tracks.size(); ++track) { diff --git a/fggl/scenes/menu.cpp b/fggl/scenes/menu.cpp index 3663914..a497298 100644 --- a/fggl/scenes/menu.cpp +++ b/fggl/scenes/menu.cpp @@ -26,15 +26,15 @@ namespace fggl::scenes { m_inputs = app.service<input::Input>(); } - void BasicMenu::update(float dt) { + void BasicMenu::update(float /*dt*/) { if (m_inputs != nullptr) { m_cursorPos.x = m_inputs->mouse.axis(MouseAxis::X); m_cursorPos.y = m_inputs->mouse.axis(MouseAxis::Y); // in canvas space math::vec2 projected; - projected.x = math::rescale_ndc(m_cursorPos.x, 0, 1920.f); - projected.y = math::rescale_ndc(m_cursorPos.y, 0, 1080.0f); + projected.x = math::rescale_ndc(m_cursorPos.x, 0, 1920.0F); + projected.y = math::rescale_ndc(m_cursorPos.y, 0, 1080.0F); m_canvas.onMouseOver(projected); if (m_inputs->mouse.pressed(MouseButton::LEFT)) { diff --git a/include/fggl/gfx/paint.hpp b/include/fggl/gfx/paint.hpp index fe18e27..c0a1eff 100644 --- a/include/fggl/gfx/paint.hpp +++ b/include/fggl/gfx/paint.hpp @@ -225,14 +225,14 @@ namespace fggl::gfx { }; inline Path2D make_shape(math::vec2 center, float radius, int sides, math::vec3 colour = colours::WHITE, ShapeOpts opts = {}) { - double angle = (M_PI * 2.0) / sides; + float angle = (M_PI * 2.0F) / sides; fggl::gfx::Path2D tileGfx(center); tileGfx.colour(colour); for (int i=0; i < sides; ++i) { - float xPos = (float)(sin(i * angle + opts.angleOffset) * radius) + center.x; - float yPos = (float)(cos(i * angle + opts.angleOffset) * radius) + center.y; + float xPos = (float)(sinf(i * angle + opts.angleOffset) * radius) + center.x; + float yPos = (float)(cosf(i * angle + opts.angleOffset) * radius) + center.y; if (!opts.sinFirst) { std::swap(xPos, yPos); } diff --git a/include/fggl/gui/widgets.hpp b/include/fggl/gui/widgets.hpp index 9a206f9..f78926d 100644 --- a/include/fggl/gui/widgets.hpp +++ b/include/fggl/gui/widgets.hpp @@ -61,7 +61,7 @@ namespace fggl::gui { } void layout() override; - inline void update(float deltaTime) override {} + inline void update(float /*deltaTime*/) override {} private: std::shared_ptr<gui::FontFace> m_font; @@ -83,7 +83,7 @@ namespace fggl::gui { [[nodiscard]] std::string label() const; - inline void update(float deltaTime) override {} + inline void update(float /*deltaTime*/) override {} void addCallback(Callback callback); void layout() override; -- GitLab