1
0
forked from mirrors/0ad

Attempted fix to prevent strange timer-related bug in Atlas (fails to start when opened from the game's main menu), refs #1729

This was SVN commit r12902.
This commit is contained in:
historic_bruno
2012-11-30 21:34:33 +00:00
parent 0e7e6e88e0
commit f7608bf270
@@ -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;