diff options
-rw-r--r-- | main/floormat-main-impl.cpp | 7 | ||||
-rw-r--r-- | main/floormat-main-impl.hpp | 2 | ||||
-rw-r--r-- | main/floormat-main.hpp | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/main/floormat-main-impl.cpp b/main/floormat-main-impl.cpp index dc9bc0b0..0a0400fb 100644 --- a/main/floormat-main-impl.cpp +++ b/main/floormat-main-impl.cpp @@ -79,9 +79,7 @@ void main_impl::recalc_viewport(Vector2i size) noexcept app.on_viewport_event(size); } -static int fake_argc = 0; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) - -main_impl::main_impl(floormat_app& app, fm_settings&& s) noexcept : +main_impl::main_impl(floormat_app& app, fm_settings&& s, int& fake_argc) noexcept : Platform::Sdl2Application{Arguments{fake_argc, nullptr}, make_conf(s), make_gl_conf(s)}, s{std::move(s)}, app{app} @@ -243,7 +241,8 @@ int main_impl::exec() floormat_main* floormat_main::create(floormat_app& app, fm_settings&& options) { - auto* ret = new main_impl(app, std::move(options)); + int fake_argc = 0; + auto* ret = new main_impl(app, std::move(options), fake_argc); fm_assert(ret); return ret; } diff --git a/main/floormat-main-impl.hpp b/main/floormat-main-impl.hpp index 9cd156e3..e0a7f1e1 100644 --- a/main/floormat-main-impl.hpp +++ b/main/floormat-main-impl.hpp @@ -21,7 +21,7 @@ struct floormat_app; struct main_impl final : Platform::Sdl2Application, floormat_main { - explicit main_impl(floormat_app& app, fm_settings&& opts) noexcept; + explicit main_impl(floormat_app& app, fm_settings&& opts, int& fake_argc) noexcept; ~main_impl() noexcept override; int exec() override; diff --git a/main/floormat-main.hpp b/main/floormat-main.hpp index f1e5ce8a..6ba3b4c8 100644 --- a/main/floormat-main.hpp +++ b/main/floormat-main.hpp @@ -39,7 +39,7 @@ struct floormat_main virtual world& world() noexcept = 0; virtual SDL_Window* window() noexcept = 0; - static floormat_main* create(floormat_app& app, fm_settings&& options); + [[nodiscard]] static floormat_main* create(floormat_app& app, fm_settings&& options); protected: float _frame_time = 0; |