From 9264bbf9698ff67af349967401a7a3754e0fba53 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Sat, 8 Feb 2020 14:52:11 +0100 Subject: [PATCH] =?UTF-8?q?Revert=20"Some=20graphics=20cards=20return=20(?= =?UTF-8?q?=E2=80=A6)"=20r4315?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit eb9b86269d83f9ba61469eb8f1fc0693e622cf90. --- src/gui/sdlmain.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/gui/sdlmain.cpp b/src/gui/sdlmain.cpp index 83d2fe40..846e8e9f 100644 --- a/src/gui/sdlmain.cpp +++ b/src/gui/sdlmain.cpp @@ -720,24 +720,16 @@ dosurface: case SCREEN_OVERLAY: if (sdl.overlay) { SDL_FreeYUVOverlay(sdl.overlay); - sdl.overlay = 0; + sdl.overlay=0; } - if (!(flags & GFX_CAN_32) || (flags & GFX_RGBONLY)) goto dosurface; + if (!(flags&GFX_CAN_32) || (flags & GFX_RGBONLY)) goto dosurface; if (!GFX_SetupSurfaceScaled(0,0)) goto dosurface; - sdl.overlay = SDL_CreateYUVOverlay(width * 2, height, SDL_UYVY_OVERLAY, sdl.surface); - - if (sdl.overlay && sdl.overlay->pitches[0] < 4 * width) { - // We get a distorted image in this case. Cleanup and go to surface. - LOG_MSG("SDL: overlay pitch is too small. (%u < %u)", sdl.overlay->pitches[0], width * 4); - SDL_FreeYUVOverlay(sdl.overlay); - sdl.overlay = 0; - } + sdl.overlay=SDL_CreateYUVOverlay(width*2,height,SDL_UYVY_OVERLAY,sdl.surface); if (!sdl.overlay) { - LOG_MSG("SDL: Failed to create overlay, switching back to surface."); + LOG_MSG("SDL: Failed to create overlay, switching back to surface"); goto dosurface; } - - sdl.desktop.type = SCREEN_OVERLAY; + sdl.desktop.type=SCREEN_OVERLAY; retFlags = GFX_CAN_32 | GFX_SCALING | GFX_HARDWARE; break; #if C_OPENGL