Commit 97a081cc authored by Florian Oetke's avatar Florian Oetke
Browse files

moved fast_quit logic into debug_ui so its available outside the demo application, too

parent 29cea5dd
Pipeline #2619 passed with stage
in 12 minutes and 40 seconds
...@@ -26,20 +26,6 @@ ...@@ -26,20 +26,6 @@
#include <sstream> #include <sstream>
template <class = void>
void quick_exit(int) noexcept
{
std::abort();
}
void mirrage_quick_exit() noexcept
{
using namespace std;
// calls std::quick_exit if it exists or the template-fallback defined above, if not
// needs to be at global scope for this workaround to work correctly
quick_exit(0);
}
namespace mirrage { namespace mirrage {
using namespace ecs::components; using namespace ecs::components;
using namespace util::unit_literals; using namespace util::unit_literals;
...@@ -122,11 +108,6 @@ namespace mirrage { ...@@ -122,11 +108,6 @@ namespace mirrage {
_engine.screens().leave(); _engine.screens().leave();
} }
break; break;
case "fast_quit"_strid:
_meta_system.renderer().device().wait_idle();
std::this_thread::sleep_for(std::chrono::milliseconds(250));
mirrage_quick_exit();
break;
case "create"_strid: { case "create"_strid: {
auto& cam = _camera.get<Transform_comp>().get_or_throw(); auto& cam = _camera.get<Transform_comp>().get_or_throw();
......
...@@ -7,6 +7,19 @@ ...@@ -7,6 +7,19 @@
#include <mirrage/utils/ranges.hpp> #include <mirrage/utils/ranges.hpp>
template <class = void>
void quick_exit(int) noexcept
{
std::abort();
}
void mirrage_quick_exit() noexcept
{
using namespace std;
// calls std::quick_exit if it exists or the template-fallback defined above, if not
// needs to be at global scope for this workaround to work correctly
quick_exit(0);
}
namespace mirrage::gui { namespace mirrage::gui {
namespace { namespace {
...@@ -125,6 +138,9 @@ namespace mirrage::gui { ...@@ -125,6 +138,9 @@ namespace mirrage::gui {
_mailbox.subscribe_to([&](input::Once_action& e) { _mailbox.subscribe_to([&](input::Once_action& e) {
switch(e.id) { switch(e.id) {
case "fast_quit"_strid:
mirrage_quick_exit();
break;
case "console"_strid: case "console"_strid:
_show_console = !_show_console; _show_console = !_show_console;
_focus_prompt = true; _focus_prompt = true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment