From ae14b550063aae11b16b95588c861f0dcf8ac5bf Mon Sep 17 00:00:00 2001 From: NepDisk Date: Fri, 15 Aug 2025 17:33:08 -0400 Subject: [PATCH] Funny shitpost idea to improve smoothness You maybe wondering? WHY, answer is yes. --- src/d_main.cpp | 12 ++++++++++++ src/i_time.c | 1 + 2 files changed, 13 insertions(+) diff --git a/src/d_main.cpp b/src/d_main.cpp index d7eac7942..09580c2c6 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -788,6 +788,7 @@ static void D_WipeDraw(boolean menu) static double D_EndFrame(precise_t enterprecise, int *frameskip) { + I_UpdateTime(cv_timescale.value); // Fully completed frame made. precise_t finishprecise = I_GetPreciseTime(); @@ -809,6 +810,7 @@ static double D_EndFrame(precise_t enterprecise, int *frameskip) *frameskip = 0; } + I_UpdateTime(cv_timescale.value); if (!singletics) { precise_t elapsed = finishprecise - enterprecise; @@ -825,6 +827,7 @@ static double D_EndFrame(precise_t enterprecise, int *frameskip) } } + I_UpdateTime(cv_timescale.value); // Capture the time once more to get the real delta time. finishprecise = I_GetPreciseTime(); deltasecs = (double)((INT64)(finishprecise - enterprecise)) / I_GetPrecisePrecision(); @@ -1019,6 +1022,7 @@ void D_SRB2Loop(void) #ifdef HW3SOUND HW3S_BeginFrameUpdate(); #endif + I_UpdateTime(cv_timescale.value); if (realtics > 0 || singletics) { @@ -1027,6 +1031,8 @@ void D_SRB2Loop(void) if (realtics > 8) realtics = 1; + I_UpdateTime(cv_timescale.value); + // process tics (but maybe not if realtic == 0) { ZoneScopedN("TryRunTics"); @@ -1064,12 +1070,16 @@ void D_SRB2Loop(void) renderisnewtic = false; } + I_UpdateTime(cv_timescale.value); + if (interp) { renderdeltatics = FLOAT_TO_FIXED(deltatics); const boolean lagging = ((deltatics >= 1.0) || hu_stopped); + I_UpdateTime(cv_timescale.value); + if (!(paused || P_AutoPause()) && !lagging) { rendertimefrac = g_time.timefrac; @@ -1095,6 +1105,8 @@ void D_SRB2Loop(void) rendertimefrac_unpaused = FRACUNIT; } + I_UpdateTime(cv_timescale.value); + if (interp || doDisplay) { if (!frameskip) diff --git a/src/i_time.c b/src/i_time.c index 0418ef1bd..d94774984 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -42,6 +42,7 @@ static double tictimer; tic_t I_GetTime(void) { + I_UpdateTime(cv_timescale.value); return g_time.time; }