diff --git a/source/tools/atlas/GameInterface/GameLoop.cpp b/source/tools/atlas/GameInterface/GameLoop.cpp index 9104d5eb65..484a4d2853 100644 --- a/source/tools/atlas/GameInterface/GameLoop.cpp +++ b/source/tools/atlas/GameInterface/GameLoop.cpp @@ -144,9 +144,9 @@ static void* RunEngine(void* data) { double time = timer_Time(); static double last_time = time; - float realFrameLength = (float)(time-last_time); + // TODO: why is this sometimes negative, if timer_Time ensures monotonic results? + float realFrameLength = std::max(0.0f, (float)(time-last_time)); last_time = time; - ENSURE(realFrameLength >= 0.0f); // TODO: filter out big jumps, e.g. when having done a lot of slow // processing in the last frame state.realFrameLength = realFrameLength;