From d32aff11b80bf208efa59f3e673ea9837aaf73be Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sat, 1 Feb 2025 09:50:43 +1100 Subject: [PATCH] Attempt to resolve fps drops for some users --- src/d_loop.c | 2 +- src/d_loop.h | 2 +- src/i_video.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/d_loop.c b/src/d_loop.c index cbc440f3c..35f3fb6d1 100644 --- a/src/d_loop.c +++ b/src/d_loop.c @@ -63,7 +63,7 @@ void TryRunTics(void) { I_StartTic(); - if (maketic - gametime > BACKUPTICS / 2) + if (maketic - gametime > 2) break; G_BuildTiccmd(&localcmds[maketic++ % BACKUPTICS]); diff --git a/src/d_loop.h b/src/d_loop.h index 9fe4a1385..9f2f76826 100644 --- a/src/d_loop.h +++ b/src/d_loop.h @@ -38,7 +38,7 @@ #include "m_fixed.h" // Tic handling related. -#define BACKUPTICS 8 +#define BACKUPTICS 128 extern fixed_t fractionaltic; diff --git a/src/i_video.c b/src/i_video.c index 209efef57..8c1c9d15d 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -595,8 +595,7 @@ void I_RestoreMousePointerPosition(void) static void SmoothMouse(int *x, int *y) { - const fixed_t tic = ((I_GetTimeMS() * TICRATE) % 1000) * FRACUNIT / 1000; - const fixed_t adjustment = FixedDiv(tic, FRACUNIT + tic); + const fixed_t adjustment = FixedDiv(fractionaltic, FRACUNIT + fractionaltic); static int xx, yy; *x += xx;