- change division of delta between currentTime and lastTime from 8 to 72 to ensure smoothratio doesn't clip at 65536.

* Divisor of delta is there so smoothratio always starts off with some kind of value. After 10 minutes at 1100 fps, closest final result to 65536 was:

ototalclk: 4573
totalclk: 4576
gametics: 33.333 ms
elapsedTime: 33.331 ms
ratio: 0.999938
result: 65531.941356
This commit is contained in:
Mitchell Richters 2020-08-03 10:00:06 +10:00
parent 70794df76c
commit 348acf95e0

View file

@ -1059,7 +1059,7 @@ double CalcSmoothRatio(ClockTicks totalclk, ClockTicks ototalclk, int realgameti
else
{
lastototalclk = ototalclk;
elapsedTime = lastTime != 0 ? (currentTime - lastTime) / 8 : 0;
elapsedTime = lastTime != 0 ? (currentTime - lastTime) / 72 : 0;
}
lastTime = currentTime;
ratio = elapsedTime / gametics;