diff options
author | Eugene Sandulenko | 2016-09-03 10:13:32 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-09-03 10:18:47 +0200 |
commit | 2fa97f20e89147a9585b08af1505cdceb9c5c19f (patch) | |
tree | dcc519bf0eaf817c5c841a7dbc841d40cabd3551 | |
parent | cda41d2fb4cf45b43358ac3a6848575efb8202de (diff) | |
download | scummvm-rg350-2fa97f20e89147a9585b08af1505cdceb9c5c19f.tar.gz scummvm-rg350-2fa97f20e89147a9585b08af1505cdceb9c5c19f.tar.bz2 scummvm-rg350-2fa97f20e89147a9585b08af1505cdceb9c5c19f.zip |
DINGUX: Adapt to new OSD changes
-rw-r--r-- | backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp index 7a248f1859..af44acd2c1 100644 --- a/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp +++ b/backends/graphics/dinguxsdl/dinguxsdl-graphics.cpp @@ -259,21 +259,33 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() { #ifdef USE_OSD // OSD visible (i.e. non-transparent)? - if (_osdAlpha != SDL_ALPHA_TRANSPARENT) { + if (_osdMessageAlpha != SDL_ALPHA_TRANSPARENT) { // Updated alpha value - const int diff = SDL_GetTicks() - _osdFadeStartTime; + const int diff = SDL_GetTicks() - _osdMessageFadeStartTime; if (diff > 0) { if (diff >= kOSDFadeOutDuration) { // Back to full transparency - _osdAlpha = SDL_ALPHA_TRANSPARENT; + _osdMessageAlpha = SDL_ALPHA_TRANSPARENT; } else { // Do a linear fade out... const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100; - _osdAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration; + _osdMessageAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration; } - SDL_SetAlpha(_osdSurface, SDL_RLEACCEL | SDL_SRCCOLORKEY | SDL_SRCALPHA, _osdAlpha); _forceFull = true; } + + if (_osdMessageAlpha == SDL_ALPHA_TRANSPARENT) { + removeOSDMessage(); + } else { + if (_osdMessageSurface && _osdSurface) { + SDL_Rect dstRect; + dstRect.x = (_osdSurface->w - _osdMessageSurface->w) / 2; + dstRect.y = (_osdSurface->h - _osdMessageSurface->h) / 2; + dstRect.w = _osdMessageSurface->w; + dstRect.h = _osdMessageSurface->h; + blitOSDMessage(dstRect); + } + } } #endif @@ -405,9 +417,7 @@ void DINGUXSdlGraphicsManager::internUpdateScreen() { drawMouse(); #ifdef USE_OSD - if (_osdAlpha != SDL_ALPHA_TRANSPARENT) { - SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0); - } + SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0); #endif // Finally, blit all our changes to the screen SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList); |