From b93fefebe8f449d7522047283bab163b8c91d8a4 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Sat, 11 Nov 2017 00:11:50 +0000 Subject: SDL: Fix display artefacts with transparent OSD message If we do not update the area below the message, it is just blitted on top of itself again and again and gets progressively less transparent. It also causes artefacts when the mouse pass below the OSD message. --- backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'backends/graphics/surfacesdl') diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 90f9f7e1a1..4a6061c428 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -2366,6 +2366,7 @@ void SurfaceSdlGraphicsManager::removeOSDMessage() { // Remove the previous message if (_osdMessageSurface) { SDL_FreeSurface(_osdMessageSurface); + _forceRedraw = true; } _osdMessageSurface = NULL; @@ -2387,7 +2388,6 @@ void SurfaceSdlGraphicsManager::updateOSD() { _osdMessageAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration; } SDL_SetAlpha(_osdMessageSurface, SDL_RLEACCEL | SDL_SRCALPHA, _osdMessageAlpha); - _forceRedraw = true; } if (_osdMessageAlpha == SDL_ALPHA_TRANSPARENT) { @@ -2395,8 +2395,8 @@ void SurfaceSdlGraphicsManager::updateOSD() { } } - if (_osdIconSurface) { - // Redraw the area below the icon for the transparent blit to give correct results. + if (_osdIconSurface || _osdMessageSurface) { + // Redraw the area below the icon and message for the transparent blit to give correct results. _forceRedraw = true; } } -- cgit v1.2.3