aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
diff options
context:
space:
mode:
authorAlexander Tkachev2016-06-03 19:18:01 +0600
committerAlexander Tkachev2016-08-24 16:07:55 +0600
commit2a15b8b280af4d4beddb142e468f511a65552e2d (patch)
tree1c04f72866b277ee1410ca952be5296db9e06d6f /backends/graphics/opengl
parent9d186929e16ce023222028143a280aca03605fe9 (diff)
downloadscummvm-rg350-2a15b8b280af4d4beddb142e468f511a65552e2d.tar.gz
scummvm-rg350-2a15b8b280af4d4beddb142e468f511a65552e2d.tar.bz2
scummvm-rg350-2a15b8b280af4d4beddb142e468f511a65552e2d.zip
GUI: Add clearOSD() method
So one can erase everything from OSD and then blit something on it.
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp17
-rw-r--r--backends/graphics/opengl/opengl-graphics.h1
2 files changed, 18 insertions, 0 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index e9f26bc7bc..97788be3ad 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -757,6 +757,23 @@ void OpenGLGraphicsManager::copyRectToOSD(const void *buf, int pitch, int x, int
#endif
}
+void OpenGLGraphicsManager::clearOSD() {
+#ifdef USE_OSD
+ // HACK: Actually no client code should use graphics functions from
+ // another thread. But the MT-32 emulator still does, thus we need to
+ // make sure this doesn't happen while a updateScreen call is done.
+ Common::StackLock lock(_osdMutex);
+
+ Graphics::Surface *dst = _osd->getSurface();
+ _osd->fill(0);
+ _osd->flagDirty();
+
+ // Init the OSD display parameters.
+ _osdAlpha = kOSDInitialAlpha;
+ _osdFadeStartTime = g_system->getMillis() + kOSDFadeOutDelay;
+#endif
+}
+
void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
assert(_gameScreen->hasPalette());
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index e0d1664e76..f36d5d17f2 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -116,6 +116,7 @@ public:
virtual void displayMessageOnOSD(const char *msg);
virtual void copyRectToOSD(const void *buf, int pitch, int x, int y, int w, int h);
+ virtual void clearOSD();
// PaletteManager interface
virtual void setPalette(const byte *colors, uint start, uint num);