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 @@
#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 {
using namespace ecs::components;
using namespace util::unit_literals;
......@@ -122,11 +108,6 @@ namespace mirrage {
_engine.screens().leave();
}
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: {
auto& cam = _camera.get<Transform_comp>().get_or_throw();
......
......@@ -7,6 +7,19 @@
#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 {
......@@ -125,6 +138,9 @@ namespace mirrage::gui {
_mailbox.subscribe_to([&](input::Once_action& e) {
switch(e.id) {
case "fast_quit"_strid:
mirrage_quick_exit();
break;
case "console"_strid:
_show_console = !_show_console;
_focus_prompt = true;
......
Markdown is supported
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