- 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.
This commit is contained in:
Christoph Oelckers 2020-07-14 12:32:59 +02:00
parent df2b3b6b17
commit 893686709b
1 changed files with 2 additions and 3 deletions

View File

@ -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);
}