From 3861064f62c2136744c4dd193f859025f8115a34 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sun, 2 Aug 2020 11:09:16 +1000 Subject: [PATCH] - use 1/8 of delta time as initial elapsed time when calculating smoothratio on a new ototalclk. * Pushes final result closer to 65536 and always ensures smoothratio never starts at 0. --- 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 305583118..f1e56e4b0 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -1060,7 +1060,7 @@ int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int else { lastototalclk = ototalclk; - elapsedTime = 0; + elapsedTime = lastTime != 0 ? (currentTime - lastTime) / 8 : 0; } lastTime = currentTime; ratio = elapsedTime / gametics;