Small bug in WinEnvironment.cpp

You are viewing a static copy of the old 2DBoy forum, which closed in 2010. It is preserved here for historical interest, but it is not possible to reply to topics. For more recent discussion about World of Goo, visit our new forum.
Small bug in WinEnvironment.cppblurgle08/04/2009 - 00:55

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().