Actor.cpp "fDeltaTime >= 0" assertion fires occasionally. This is under

Foreground's update, caused by GAMESTATE->m_fMusicSeconds moving backwards.

This happens due to frame skips confusing GameSoundManager::GetFrameTimingAdjustment.
It expects that, when the framerate is stable, each frame will take 1/FPS.
If we skip a frame, it thinks one frame is 30ms late, and tries to
adjust by 30-16ms.  Reduce the threshold for this adjustment to half a frame;
if we're that much late, the problem isn't scheduling jitter--we've probably
dropped a frame, and adjusting here is incorrect.

In case that isn't enough, clamp fDeltaTime in Foreground, too.
This commit is contained in:
Glenn Maynard
2006-02-25 10:08:18 +00:00
parent 4c836c9da7
commit c6125c4e26
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -441,7 +441,7 @@ float GameSoundManager::GetFrameTimingAdjustment( float fDeltaTime )
const float fExpectedDelay = 1.0f / iThisFPS;
const float fExtraDelay = fDeltaTime - fExpectedDelay;
if( fabsf(fExtraDelay) >= fExpectedDelay )
if( fabsf(fExtraDelay) >= fExpectedDelay/2 )
return 0;
/* Subtract the extra delay. */