mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-13 22:22:05 +00:00
Don't max out fps if engine runs in the background or is unfocused
This commit is contained in:
parent
4904fdbf1b
commit
3382365feb
1 changed files with 12 additions and 0 deletions
|
@ -688,12 +688,16 @@ void idCommonLocal::Frame()
|
|||
gameTimeResidual += clampedDeltaMilliseconds * timescale.GetFloat();
|
||||
|
||||
// don't run any frames when paused
|
||||
/*
|
||||
RB moved down
|
||||
|
||||
if( pauseGame )
|
||||
{
|
||||
gameFrame++;
|
||||
gameTimeResidual = 0;
|
||||
break;
|
||||
}
|
||||
*/
|
||||
|
||||
// debug cvar to force multiple game tics
|
||||
if( com_fixedTic.GetInteger() > 0 )
|
||||
|
@ -753,6 +757,14 @@ void idCommonLocal::Frame()
|
|||
}
|
||||
}
|
||||
|
||||
// don't run any frames when paused
|
||||
// RB: reset numGameFrames here so we use the sleep above
|
||||
// and don't run as many frames as possible on the GPU
|
||||
if( pauseGame )
|
||||
{
|
||||
numGameFrames = 0;
|
||||
}
|
||||
|
||||
//--------------------------------------------
|
||||
// It would be better to push as much of this as possible
|
||||
// either before or after the renderSystem->SwapCommandBuffers(),
|
||||
|
|
Loading…
Reference in a new issue