diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-06 18:16:36 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2023-03-06 18:16:36 +0100 |
commit | 8009972ccbb68a252050a353aada458e9e05b893 (patch) | |
tree | c83f688a909f5637484273987a342e0030ad551d /main | |
parent | 8f275a126f56f4d1cb54c99a467ce8a29de0f6ea (diff) |
main: don't override magnum's cmdline options
Diffstat (limited to 'main')
-rw-r--r-- | main/debug.cpp | 15 | ||||
-rw-r--r-- | main/main-impl.hpp | 3 | ||||
-rw-r--r-- | main/setup.cpp | 10 |
3 files changed, 3 insertions, 25 deletions
diff --git a/main/debug.cpp b/main/debug.cpp index 2d320a3b..eaac17b7 100644 --- a/main/debug.cpp +++ b/main/debug.cpp @@ -65,19 +65,4 @@ void main_impl::register_debug_callback() GL::DebugOutput::setCallback(_debug_callback, this); } -char main_impl::maybe_register_debug_callback(fm_gpu_debug flag) -{ - using enum fm_gpu_debug; - switch (flag) - { - default: - register_debug_callback(); - break; - case off: - case no_error: - break; - } - return '\0'; -} - } // namespace floormat diff --git a/main/main-impl.hpp b/main/main-impl.hpp index 997b4980..ca3e9ad3 100644 --- a/main/main-impl.hpp +++ b/main/main-impl.hpp @@ -74,7 +74,7 @@ struct main_impl final : Platform::Sdl2Application, floormat_main private: fm_settings s; - [[maybe_unused]] char _dummy = maybe_register_debug_callback(s.gpu_debug); + [[maybe_unused]] char _dummy = (register_debug_callback(), '\0'); floormat_app& app; // NOLINT(cppcoreguidelines-avoid-const-or-ref-data-members) tile_shader _shader; std::vector<clickable> _clickable_scenery; @@ -95,7 +95,6 @@ private: draw_bounds get_draw_bounds() const noexcept override; - char maybe_register_debug_callback(fm_gpu_debug flag); void register_debug_callback(); static Configuration make_conf(const fm_settings& s); diff --git a/main/setup.cpp b/main/setup.cpp index 9030eaf7..8e0e36b9 100644 --- a/main/setup.cpp +++ b/main/setup.cpp @@ -45,22 +45,16 @@ auto main_impl::make_window_flags(const fm_settings& s) -> Configuration::Window auto main_impl::make_conf(const fm_settings& s) -> Configuration { return Configuration{} - .setTitle(s.title) + .setTitle(s.title ? (StringView)s.title : "floormat editor"_s) .setSize(s.resolution) .setWindowFlags(make_window_flags(s)); } -auto main_impl::make_gl_conf(const fm_settings& s) -> GLConfiguration +auto main_impl::make_gl_conf(const fm_settings&) -> GLConfiguration { GLConfiguration::Flags flags{}; using f = GLConfiguration::Flag; flags |= f::ForwardCompatible; - if (s.gpu_debug >= fm_gpu_debug::on) - flags |= f::Debug | f::GpuValidation; - if (s.gpu_debug >= fm_gpu_debug::robust) - flags |= f::RobustAccess | f::ResetIsolation; - else if (s.gpu_debug <= fm_gpu_debug::no_error) - flags |= f::NoError; return GLConfiguration{}.setFlags(flags); } |