- adjust elapsedInputTicks in GetInput() to be 1000.0 / REALGAMETICSPERSEC.

* 1000 / 30 = 33.333~. This ensures that if 33.333 is the minimum value, the calculation for scaleAdjust always equals 1.0 (no scaling).
This commit is contained in:
Mitchell Richters 2020-07-24 19:38:09 +10:00
parent 25ca23f2e2
commit 5bb7c7a647

View file

@ -1207,7 +1207,7 @@ void GetInput()
auto now = I_msTimeF();
// do not let this become too large - it would create overflows resulting in undefined behavior. The very first tic must not use the timer difference at all because the timer has not been set yet.
// This really needs to have the timer fixed to be robust, doing it ad-hoc here is not really safe.
if (lastCheck > 0) elapsedInputTicks = min(now - lastCheck, (double)(REALGAMETICSPERSEC));
if (lastCheck > 0) elapsedInputTicks = min(now - lastCheck, 1000.0 / REALGAMETICSPERSEC);
else elapsedInputTicks = 1;
lastCheck = now;