From 5968618af5e62ea54219a978897dd0d7e85396ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20Luis=20Rodr=C3=ADguez=20Gonz=C3=A1lez?= Date: Wed, 11 Aug 2021 21:48:55 +0200 Subject: [PATCH] Enable triple buffer for hardware scaling modes only if configured. --- src/sdl-dingux/sdl_video.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sdl-dingux/sdl_video.cpp b/src/sdl-dingux/sdl_video.cpp index bd5aeff67..0a7b1fbe0 100644 --- a/src/sdl-dingux/sdl_video.cpp +++ b/src/sdl-dingux/sdl_video.cpp @@ -1991,10 +1991,11 @@ int VideoInit() } } + flags = (options.vsync ? (SDL_HWSURFACE | SDL_TRIPLEBUF) : (SDL_HWSURFACE)); if (options.rotate == 1 || options.rotate == 3) { - screen = SDL_SetVideoMode(VideoBufferHeight, VideoBufferWidth, 16, SDL_HWSURFACE | SDL_TRIPLEBUF); + screen = SDL_SetVideoMode(VideoBufferHeight, VideoBufferWidth, 16, flags); } else { - screen = SDL_SetVideoMode(VideoBufferWidth, VideoBufferHeight, 16, SDL_HWSURFACE | SDL_TRIPLEBUF); + screen = SDL_SetVideoMode(VideoBufferWidth, VideoBufferHeight, 16, flags); } } else {