Just passing along what I believe is a small bug in WinEnvironment.cpp.
In the main loop, somewhere around line 350, you'll find this code:
// if a pause ended during this iteration: if (mPauseDuration>0) { // account for it: mT0 += mPauseDuration; // reset the pause duration now that it's accounted for: mPauseDuration = 0; }
It's currently called after the call to update(), but assuming the intent is that Environment::getTime() should return game time (i.e. real time - start time - any time paused), it needs to come before the call to update()
Update( float dt) will still be called with dt equal to the real time between this update call and the last one. But with this change, Environment->getTime() will return game time correctly for the frame following the call to Environment::resumeTime().
|