mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
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.
This commit is contained in:
parent
0ffbce5bb1
commit
bf85ad820c
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user