From 893686709b2ca5c761b5ecaa2ff8629993cb7c84 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 14 Jul 2020 12:32:59 +0200 Subject: [PATCH] - removed the redundant rfreq factor from CalcSmoothRatio. I never realized it was redundant when consolidating the interpolation math into one function - originally this was done in a way that it wasn't obvious. This also eliminates the dependency on refreshFreq which never actually made any sense. --- source/core/gamecontrol.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index c484cac01..b49be0006 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -1022,10 +1022,9 @@ int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int { const double TICRATE = 120.; - double rfreq = refreshfreq * TICRATE / timerGetClockRate(); double elapsedTime = (totalclk - ototalclk).toScale16F(); - double elapsedFrames = elapsedTime * rfreq * (1. / TICRATE); - double ratio = (elapsedFrames * realgameticspersec) / rfreq; + double elapsedFrames = elapsedTime * (1. / TICRATE); + double ratio = (elapsedFrames * realgameticspersec); return clamp(xs_RoundToInt(ratio * 65536), 0, 65536); }