From d99e1e3be8de5bf6babf525d4a122a9c645b10d4 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 18 Feb 2024 16:22:03 +0700 Subject: [PATCH] improve frame times, attempt to fix capped mode issue (#1492) * apply patch by Ceski (don't use frame limiter for capped mode) * Revert "add ability to set SDL render driver (#1359)" This reverts commit 801c93872b74da35ab829c59e7c7eb096d25e73c. * fix comment, bring back render info --- src/d_loop.c | 3 +-- src/i_video.c | 9 +-------- src/i_video.h | 2 -- src/m_misc.c | 18 ------------------ 4 files changed, 2 insertions(+), 30 deletions(-) diff --git a/src/d_loop.c b/src/d_loop.c index 82c157e6..d1844258 100644 --- a/src/d_loop.c +++ b/src/d_loop.c @@ -729,8 +729,7 @@ void TryRunTics (void) // [AM] If we've uncapped the framerate and there are no tics // to run, return early instead of waiting around. - // Only check counts so that I_FinishUpdate() can handle frame timing. - #define return_early (counts == 0) + #define return_early (uncapped && counts == 0) // get real tics entertic = I_GetTime() / ticdup; diff --git a/src/i_video.c b/src/i_video.c index 8c609d9b..9e4d0aab 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -73,8 +73,6 @@ fixed_t fractionaltic; boolean disk_icon; // killough 10/98 int fps; // [FG] FPS counter widget -char *sdl_renderdriver = ""; - // [FG] rendering window, renderer, intermediate ARGB frame buffer and texture static SDL_Window *screen; @@ -372,7 +370,7 @@ static void UpdateLimiter(void) } else { - use_limiter = (targetrefresh > 0); + use_limiter = false; } } @@ -1492,11 +1490,6 @@ static void I_InitGraphicsMode(void) flags |= SDL_RENDERER_PRESENTVSYNC; } - if (*sdl_renderdriver) - { - SDL_SetHint(SDL_HINT_RENDER_DRIVER, sdl_renderdriver); - } - // [FG] create renderer renderer = SDL_CreateRenderer(screen, -1, flags); diff --git a/src/i_video.h b/src/i_video.h index de446814..9105ac02 100644 --- a/src/i_video.h +++ b/src/i_video.h @@ -68,8 +68,6 @@ void I_DynamicResolution(void); extern boolean drs_skip_frame; -extern char *sdl_renderdriver; - extern boolean use_vsync; // killough 2/8/98: controls whether vsync is called extern boolean disk_icon; // killough 10/98 extern int current_video_height; diff --git a/src/m_misc.c b/src/m_misc.c index 1b43c11d..aa3e7b5c 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -142,24 +142,6 @@ default_t defaults[] = { "1 to enable dynamic resolution" }, - { - "sdl_renderdriver", - (config_t *) &sdl_renderdriver, NULL, -#if defined(_WIN32) - {.s = "direct3d11"}, -#else - {.s = ""}, -#endif - {0}, string, ss_none, wad_no, - "SDL render driver, possible values are " -#if defined(_WIN32) - "direct3d, direct3d11, direct3d12, " -#elif defined(__APPLE__) - "metal, " -#endif - "opengl, opengles2, opengles, software" - }, - { "correct_aspect_ratio", (config_t *) &use_aspect, NULL,