From: Holger Schemel Date: Thu, 3 Sep 2020 23:48:46 +0000 (+0200) Subject: added storing current video vsync mode after setting it X-Git-Tag: 4.2.0.2~11 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d2245fbf4b1bf52125ad6324df26a9426b29fc77;p=rocksndiamonds.git added storing current video vsync mode after setting it --- diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index e561b177..ab914a4e 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -876,7 +876,16 @@ void SDLSetScreenVsyncMode(char *vsync_mode) // if adaptive vsync requested, but not supported, retry with normal vsync if (result == -1 && interval == VSYNC_MODE_ADAPTIVE) - SDL_GL_SetSwapInterval(VSYNC_MODE_NORMAL); + { + interval = VSYNC_MODE_NORMAL; + + result = SDL_GL_SetSwapInterval(interval); + } + + if (result == -1) + interval = VSYNC_MODE_OFF; + + video.vsync_mode = interval; } void SDLRedrawWindow(void)