diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-22 01:13:55 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2024-03-22 04:17:20 +0100 |
commit | 5f1de5633a9b53f12bf9c0923c790a3d8f0c96d7 (patch) | |
tree | 10fec440e5ee85eb98ad0cc40c4272805cec3fce | |
parent | 79357950ac0665dc01f22ebfa9a4efce48bb7682 (diff) |
fix assert when resuming from breakpoint
#0 0x00007fff5b83f1e7 in msvcrt!abort () from C:\Windows\System32\msvcrt.dll
#1 0x00007ff6b1d2a8d4 in floormat::object::alloc_frame_time<unsigned int> (dt=..., accum=@0xc622418: 36957033, hz=60, speed=10) at C:/repos/floormat/src/object.cpp:319
#2 0x00007ff6b1b9bfa8 in floormat::tests::(anonymous namespace)::pf_test::update_pre (this=0xc6b6d10, a=..., dt=...) at C:/repos/floormat/editor/tests/pathfinding.cpp:217
#3 0x00007ff6b1b99375 in floormat::app::tests_pre_update (this=0xf2be00, dt=...) at C:/repos/floormat/editor/tests.cpp:52
#4 0x00007ff6b1ba17ec in floormat::app::update (this=0xf2be00, dt=...) at C:/repos/floormat/editor/update.cpp:280
#5 0x00007ff6b1ba4534 in floormat::main_impl::do_update (this=0xf2bf50) at C:/repos/floormat/main/draw.cpp:43
#6 0x00007ff6b1ba465f in floormat::main_impl::drawEvent (this=0xf2bf50)
-rw-r--r-- | main/draw.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/main/draw.cpp b/main/draw.cpp index 5831a0b7..42cf4082 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -4,7 +4,7 @@ #include "src/camera-offset.hpp" #include "src/anim-atlas.hpp" #include "main/clickable.hpp" -#include "src/nanosecond.hpp" +#include "src/nanosecond.inl" #include <Corrade/Containers/GrowableArray.h> #include <Corrade/Containers/ArrayView.h> #include <Magnum/GL/DefaultFramebuffer.h> @@ -23,7 +23,9 @@ size_t bad_frame_counter = 0; // NOLINT void main_impl::do_update() { constexpr auto eps = 1e-5f; - auto dt = timeline.update(); + constexpr auto max_dt = Milliseconds*100; + const auto dtʹ = timeline.update(); + const auto dt = dtʹ > max_dt ? max_dt : dtʹ; if (float secs{Time::to_seconds(dt)}; secs > eps) { #if 1 |