Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
GameDevWeek
Dependencies
Cpp
mirrage
Commits
c581cc90
Commit
c581cc90
authored
Aug 30, 2018
by
Florian Oetke
Browse files
fixed workaround for missing quick_exit in mingw
parent
50a59567
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/demo/src/test_screen.cpp
View file @
c581cc90
...
...
@@ -30,6 +30,20 @@
#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
;
...
...
@@ -59,11 +73,6 @@ namespace mirrage {
0.
f
,
5600.
f
,
false
}}};
template
<
class
=
void
>
void
quick_exit
()
{
std
::
exit
(
0
);
}
}
...
...
@@ -127,11 +136,7 @@ namespace mirrage {
case
"fast_quit"
_strid
:
_meta_system
.
renderer
().
device
().
wait_idle
();
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
250
));
{
using
namespace
std
;
// calls std::quick_exit if it exists or the template-fallback defined above, if not
quick_exit
();
}
mirrage_quick_exit
();
break
;
case
"create"
_strid
:
...
...
@@ -822,7 +827,7 @@ namespace mirrage {
NK_TEXT_LEFT
);
auto
speed
=
anim
.
speed
();
nk_property_float
(
ctx
,
"Speed"
,
0.
f
,
&
speed
,
5.
f
,
0.
0
1
f
,
0.0
01
f
);
nk_property_float
(
ctx
,
"Speed"
,
0.
f
,
&
speed
,
5.
f
,
0.1
f
,
0.0
5
f
);
anim
.
speed
(
speed
);
...
...
src/mirrage/renderer/include/mirrage/renderer/animation_comp.hpp
View file @
c581cc90
...
...
@@ -56,9 +56,9 @@ namespace mirrage::renderer {
static
constexpr
auto
pack_speed
(
float
v
)
{
return
std
::
int8_t
(
std
::
clamp
(
v
/
10
*
255
,
0.
f
,
255.
f
));
return
std
::
u
int8_t
(
std
::
round
(
std
::
clamp
(
v
/
10
*
255
,
0.
f
,
255.
f
))
)
;
}
static
constexpr
auto
unpack_speed
(
std
::
int8_t
v
)
{
return
float
(
v
)
*
10
/
255
;
}
static
constexpr
auto
unpack_speed
(
std
::
u
int8_t
v
)
{
return
float
(
v
)
*
10
/
255
;
}
Animation_state
()
:
time
(
0.
f
),
speed
(
pack_speed
(
1.
f
)),
reversed
(
false
),
paused
(
false
),
looped
(
true
)
{}
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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