aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/surfacesdl
diff options
context:
space:
mode:
authorPatrik Dahlstrom2017-11-09 22:39:42 +0000
committerThierry Crozat2017-11-10 19:56:28 +0000
commitbf85ad820c48da5e1820f56496817d36161ec61f (patch)
tree099ac77f4b04a675fb345efdd4eee75dde823a79 /backends/graphics/surfacesdl
parent0ffbce5bb13738c58b69ea55a83c24cc973c2a6e (diff)
downloadscummvm-rg350-bf85ad820c48da5e1820f56496817d36161ec61f.tar.gz
scummvm-rg350-bf85ad820c48da5e1820f56496817d36161ec61f.tar.bz2
scummvm-rg350-bf85ad820c48da5e1820f56496817d36161ec61f.zip
SDL: fix various OSD message artifacts
On the OpenPandora handheld, the OSD message would not render unless you moved the cursor in the area where it was supposed to show. Additionally, the OSD message was not transparent like in v1.8. This commit fixes both these issues.
Diffstat (limited to 'backends/graphics/surfacesdl')
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 262ea84096..90f9f7e1a1 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -2293,6 +2293,11 @@ void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) {
// Init the OSD display parameters, and the fade out
_osdMessageAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100;
_osdMessageFadeStartTime = SDL_GetTicks() + kOSDFadeOutDelay;
+ // Enable alpha blending
+ SDL_SetAlpha(_osdMessageSurface, SDL_RLEACCEL | SDL_SRCALPHA, _osdMessageAlpha);
+
+ // Ensure a full redraw takes place next time the screen is updated
+ _forceRedraw = true;
}
SDL_Rect SurfaceSdlGraphicsManager::getOSDMessageRect() const {
@@ -2381,7 +2386,7 @@ void SurfaceSdlGraphicsManager::updateOSD() {
const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100;
_osdMessageAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration;
}
- SDL_SetAlpha(_osdMessageSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdMessageAlpha);
+ SDL_SetAlpha(_osdMessageSurface, SDL_RLEACCEL | SDL_SRCALPHA, _osdMessageAlpha);
_forceRedraw = true;
}