aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/gph
diff options
context:
space:
mode:
authorBastien Bouclet2016-09-13 20:33:42 +0200
committerBastien Bouclet2016-09-13 20:33:42 +0200
commit05bc82b6225f79ad42e6259be8e227aed6e7c0dc (patch)
tree6877e323b28cc736ea2fa4913cb41a991237935c /backends/graphics/gph
parent4d68b93abacf78dae480a52e242a0644896e5101 (diff)
downloadscummvm-rg350-05bc82b6225f79ad42e6259be8e227aed6e7c0dc.tar.gz
scummvm-rg350-05bc82b6225f79ad42e6259be8e227aed6e7c0dc.tar.bz2
scummvm-rg350-05bc82b6225f79ad42e6259be8e227aed6e7c0dc.zip
SDL: Switch the surface renderer to use small surfaces for OSD drawing
Diffstat (limited to 'backends/graphics/gph')
-rw-r--r--backends/graphics/gph/gph-graphics.cpp40
1 files changed, 6 insertions, 34 deletions
diff --git a/backends/graphics/gph/gph-graphics.cpp b/backends/graphics/gph/gph-graphics.cpp
index bd0f246286..a19512110f 100644
--- a/backends/graphics/gph/gph-graphics.cpp
+++ b/backends/graphics/gph/gph-graphics.cpp
@@ -277,38 +277,6 @@ void GPHGraphicsManager::internUpdateScreen() {
_forceFull = true;
}
-#ifdef USE_OSD
- // OSD visible (i.e. non-transparent)?
- if (_osdMessageAlpha != SDL_ALPHA_TRANSPARENT) {
- // Updated alpha value
- const int diff = SDL_GetTicks() - _osdMessageFadeStartTime;
- if (diff > 0) {
- if (diff >= kOSDFadeOutDuration) {
- // Back to full transparency
- _osdMessageAlpha = SDL_ALPHA_TRANSPARENT;
- } else {
- // Do a linear fade out...
- const int startAlpha = SDL_ALPHA_TRANSPARENT + kOSDInitialAlpha * (SDL_ALPHA_OPAQUE - SDL_ALPHA_TRANSPARENT) / 100;
- _osdMessageAlpha = startAlpha + diff * (SDL_ALPHA_TRANSPARENT - startAlpha) / kOSDFadeOutDuration;
- }
- _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
-
if (!_overlayVisible) {
origSurf = _screen;
srcSurf = _tmpscreen;
@@ -331,6 +299,10 @@ void GPHGraphicsManager::internUpdateScreen() {
if (_mouseNeedsRedraw)
undrawMouse();
+#ifdef USE_OSD
+ updateOSD();
+#endif
+
// Force a full redraw if requested
if (_forceFull) {
_numDirtyRects = 1;
@@ -440,9 +412,9 @@ void GPHGraphicsManager::internUpdateScreen() {
drawMouse();
#ifdef USE_OSD
- if (_osdMessageAlpha != SDL_ALPHA_TRANSPARENT)
- SDL_BlitSurface(_osdSurface, 0, _hwscreen, 0);
+ drawOSD();
#endif
+
// Finally, blit all our changes to the screen
SDL_UpdateRects(_hwscreen, _numDirtyRects, _dirtyRectList);
}