mirror of
https://github.com/FWGS/xash3d-fwgs
synced 2024-11-23 10:20:08 +01:00
engine: client: improve accumulating rounding error, thanks @SNMetamorph for suggestion
This commit is contained in:
parent
793adadb06
commit
413a0fb2e5
@ -608,10 +608,12 @@ static void CL_CreateCmd( void )
|
||||
cl.frametime_remainder += accurate_ms - ms; // accumulate rounding error each frame
|
||||
|
||||
// add a ms if error accumulates enough
|
||||
if( cl.frametime_remainder > 1.0 )
|
||||
if( cl.frametime_remainder >= 1.0 )
|
||||
{
|
||||
cl.frametime_remainder = 0.0;
|
||||
ms++;
|
||||
int ms2 = (int)cl.frametime_remainder;
|
||||
|
||||
ms += ms2;
|
||||
cl.frametime_remainder -= ms2;
|
||||
}
|
||||
|
||||
// ms can't be negative, rely on error accumulation only if FPS > 1000
|
||||
|
Loading…
Reference in New Issue
Block a user