- 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.
This commit is contained in:
Mitchell Richters 2020-08-02 11:09:16 +10:00 committed by Christoph Oelckers
parent 4830989d32
commit 3861064f62

View file

@ -1060,7 +1060,7 @@ int CalcSmoothRatio(const ClockTicks &totalclk, const ClockTicks &ototalclk, int
else else
{ {
lastototalclk = ototalclk; lastototalclk = ototalclk;
elapsedTime = 0; elapsedTime = lastTime != 0 ? (currentTime - lastTime) / 8 : 0;
} }
lastTime = currentTime; lastTime = currentTime;
ratio = elapsedTime / gametics; ratio = elapsedTime / gametics;