From 3584cb67bb2298ed39fbc4b5b40ad0bdabed6c17 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Tue, 19 Dec 2023 15:57:10 +0700 Subject: [PATCH] remove window_event flag, skip DRS if frametime is too long --- src/i_video.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/i_video.c b/src/i_video.c index 9a3ea3b4..3f3c903d 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -106,8 +106,6 @@ boolean screenvisible = true; boolean window_focused = true; -static boolean window_event = true; - void *I_GetSDLWindow(void) { return screen; @@ -402,7 +400,6 @@ static void I_GetEvent(void) break; case SDL_WINDOWEVENT: - window_event = true; if (sdlevent.window.windowID == SDL_GetWindowID(screen)) { HandleWindowEvent(&sdlevent.window); @@ -484,17 +481,12 @@ static void ResetLogicalSize(void); static void DynamicResolution(void) { - if (resolution_mode != RES_DRS || frametime_withoutpresent == 0) + if (resolution_mode != RES_DRS || frametime_withoutpresent == 0 || + frametime_withoutpresent > 1000000 / 15) { return; } - if (window_event) - { - window_event = false; - return; - } - // 1.25 milliseconds for SDL render present double target = (1.0 / targetrefresh) - 0.00125; double actual = frametime_withoutpresent / 1000000.0;