From eadb31f9cde9eb495840e6a2bf040cd1567bc06e Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Thu, 23 Jul 2020 19:16:51 +1000 Subject: [PATCH] - use `REALGAMETICSPERSEC` as maximum value for `elapsedInputTicks` in `GetInput()`. Hard-coded value of `10.0` was too low and was always being used instead of the value of `(now - lastCheck)`. This made `scaleAdjust` inaccurate and not fast enough. --- source/games/duke/src/input.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/games/duke/src/input.cpp b/source/games/duke/src/input.cpp index 5bcca590c..31de3548b 100644 --- a/source/games/duke/src/input.cpp +++ b/source/games/duke/src/input.cpp @@ -1231,7 +1231,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, 10.); + if (lastCheck > 0) elapsedInputTicks = min(now - lastCheck, (double)(REALGAMETICSPERSEC)); else elapsedInputTicks = 1; lastCheck = now;