From: Holger Schemel Date: Sat, 5 Sep 2020 23:54:33 +0000 (+0200) Subject: added check if setting vsync mode to selected value was successful X-Git-Tag: 4.2.0.2~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=35487ddb762f2f8a424a713dc00bf7a04e9a40e3;p=rocksndiamonds.git added check if setting vsync mode to selected value was successful --- diff --git a/src/screens.c b/src/screens.c index 1808e9bc..a4db11b2 100644 --- a/src/screens.c +++ b/src/screens.c @@ -5332,8 +5332,23 @@ static void execSetupGraphics(void) // screen rendering mode may have changed at this point SDLSetScreenRenderingMode(setup.screen_rendering_mode); + int setup_vsync_mode = VSYNC_MODE_STR_TO_INT(setup.vsync_mode); + int video_vsync_mode = video.vsync_mode; + // screen vsync mode may have changed at this point ChangeVsyncModeIfNeeded(); + + // check if setting vsync mode to selected value failed + if (setup_vsync_mode != video_vsync_mode && + setup_vsync_mode != video.vsync_mode) + { + // changing vsync mode to selected value failed -- reset displayed value + execSetupGraphics_setVsyncModes(TRUE); + + Request("Setting VSync failed!", REQ_CONFIRM); + + DrawSetupScreen(); + } } static void execSetupChooseWindowSize(void)