From 3e36f3b9b96374856caf77440b3967de1b3aac72 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sat, 30 Dec 2023 16:47:05 +0700 Subject: [PATCH] reset target refresh after wipe (wipe is always at 35 FPS) --- src/d_main.c | 2 ++ src/i_video.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 7a94c2e5..6bc25399 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -385,6 +385,8 @@ void D_Display (void) I_FinishUpdate(); // page flip or blit buffer } while (!done); + + I_ResetTargetRefresh(); // reset after wipe } // diff --git a/src/i_video.c b/src/i_video.c index 20f3f8e9..a1bf31d8 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -1030,10 +1030,10 @@ static void ResetResolution(int height) video.unscaledw = (video.unscaledw + 1) & ~1; - // Unscaled widescreen 16:9 resolution truncates to 428x240, which is not + // Unscaled widescreen 16:9 resolution truncates to 426x240, which is not // quite 16:9. To avoid visual instability, we calculate the scaled width // without the actual aspect ratio. For example, at 1280x720 we get - // 1284x720. + // 1278x720. double vertscale = (double)actualheight / (double)unscaled_actualheight; video.width = (int)(video.unscaledw * vertscale); @@ -1172,6 +1172,8 @@ static void ResetLogicalSize(void) void I_ResetTargetRefresh(void) { + frametime_withoutpresent = 0; // skip DRS one frame + if (uncapped) { targetrefresh = (fpslimit >= TICRATE) ? fpslimit : native_refresh_rate;