Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Dependencies
Cpp
mirrage
Commits
97a081cc
Commit
97a081cc
authored
Mar 22, 2019
by
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
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
src/demo/src/test_screen.cpp
View file @
97a081cc
...
...
@@ -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
();
...
...
src/mirrage/gui/src/debug_ui.cpp
View file @
97a081cc
...
...
@@ -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
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment