diff options
| author | Eugene Sandulenko | 2016-09-03 10:18:03 +0200 | 
|---|---|---|
| committer | Eugene Sandulenko | 2016-09-03 10:18:47 +0200 | 
| commit | e93b52416f110e15bd67367d9cfed8fea3851a2c (patch) | |
| tree | 1d123fc985f5fe7b00008be0d6db503722c8c565 /backends | |
| parent | 58096d909f2cbe77ff70fad6ac416c92bec2a1f6 (diff) | |
| download | scummvm-rg350-e93b52416f110e15bd67367d9cfed8fea3851a2c.tar.gz scummvm-rg350-e93b52416f110e15bd67367d9cfed8fea3851a2c.tar.bz2 scummvm-rg350-e93b52416f110e15bd67367d9cfed8fea3851a2c.zip  | |
LINUXMOTO: Adapt to OSD changes
Diffstat (limited to 'backends')
| -rw-r--r-- | backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp | 26 | 
1 files changed, 18 insertions, 8 deletions
diff --git a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp index 52e5b42e8b..64b4c966bf 100644 --- a/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp +++ b/backends/graphics/linuxmotosdl/linuxmotosdl-graphics.cpp @@ -292,21 +292,33 @@ void LinuxmotoSdlGraphicsManager::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 @@ -439,9 +451,7 @@ void LinuxmotoSdlGraphicsManager::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);  | 
