From 348acf95e0e9344e76157bf533bccce0ce1a58fc Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 3 Aug 2020 10:00:06 +1000 Subject: [PATCH] - 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 --- source/core/gamecontrol.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index fdc074569..2a2c8eb61 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -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;