- don't make assumptions about refreshfreq when calculating smoothratio.

This commit is contained in:
Mitchell Richters 2020-04-15 12:51:37 +10:00 committed by Christoph Oelckers
parent 5c3c55b6cd
commit 22a940c922

View file

@ -874,9 +874,7 @@ int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int
{
const double TICRATE = 120.;
double rfreq = (refreshfreq != -1 ? refreshfreq : 60);
rfreq = rfreq * TICRATE / timerGetClockRate();
double rfreq = refreshfreq * TICRATE / timerGetClockRate();
double elapsedTime = (totalclk - ototalclk).toScale16F();
double elapsedFrames = elapsedTime * rfreq * (1. / TICRATE);
double ratio = (elapsedFrames * realgameticspersec) / rfreq;