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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user