diff --git a/src/App.cpp b/src/App.cpp index 9157f155..4ef291e2 100644 --- a/src/App.cpp +++ b/src/App.cpp @@ -46,7 +46,8 @@ App::~App() { App& App::instance() { if (!self) { - self = new App; + static App dummy; // e.g. for unit tests + self = &dummy; } return *self; } diff --git a/src/jngl/Mat3.cpp b/src/jngl/Mat3.cpp index 0b655b8d..710eeec7 100644 --- a/src/jngl/Mat3.cpp +++ b/src/jngl/Mat3.cpp @@ -1,4 +1,4 @@ -// Copyright 2021-2023 Jan Niklas Hasse +// Copyright 2021-2024 Jan Niklas Hasse // For conditions of distribution and use, see copyright notice in LICENSE.txt #include "Mat3.hpp" @@ -26,8 +26,8 @@ Mat3& Mat3::translate(const jngl::Vec2& v) { } Mat3& Mat3::translate(const Pixels x, const Pixels y) { - return *this *= - boost::qvm::translation_mat(boost::qvm::vec{ { float(x), float(y) } }); + return *this *= boost::qvm::translation_mat( + boost::qvm::vec{ { static_cast(x), static_cast(y) } }); } Mat3& Mat3::scale(const float factor) {