aboutsummaryrefslogtreecommitdiff
path: root/backends/graphics/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'backends/graphics/opengl')
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index a6f31e64fb..06a0109476 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -50,6 +50,10 @@
#include "image/bmp.h"
#endif
+#ifdef USE_TTS
+#include "common/text-to-speech.h"
+#endif
+
namespace OpenGL {
OpenGLGraphicsManager::OpenGLGraphicsManager()
@@ -780,7 +784,7 @@ void OpenGLGraphicsManager::displayMessageOnOSD(const char *msg) {
_osdMessageChangeRequest = true;
_osdMessageNextData = msg;
-#endif
+#endif // USE_OSD
}
#ifdef USE_OSD
@@ -842,6 +846,14 @@ void OpenGLGraphicsManager::osdMessageUpdateSurface() {
_osdMessageAlpha = kOSDMessageInitialAlpha;
_osdMessageFadeStartTime = g_system->getMillis() + kOSDMessageFadeOutDelay;
+#ifdef USE_TTS
+ if (ConfMan.hasKey("tts_enabled", "scummvm") &&
+ ConfMan.getBool("tts_enabled", "scummvm")) {
+ Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
+ if (ttsMan)
+ ttsMan->say(_osdMessageNextData);
+ }
+#endif // USE_TTS
// Clear the text update request
_osdMessageNextData.clear();
_osdMessageChangeRequest = false;