diff options
author | Jaromir Wysoglad | 2019-07-30 16:17:56 +0200 |
---|---|---|
committer | Filippos Karapetis | 2019-09-01 22:47:55 +0300 |
commit | bbbb608c528699f281fdd5a8a7d814dd44b9aa41 (patch) | |
tree | bd64682386ec79e1a8f3b00fe94885a52996e3cc /backends/graphics/surfacesdl | |
parent | f89ca9ad5c28731b5a95525eb220d43fca55d14b (diff) | |
download | scummvm-rg350-bbbb608c528699f281fdd5a8a7d814dd44b9aa41.tar.gz scummvm-rg350-bbbb608c528699f281fdd5a8a7d814dd44b9aa41.tar.bz2 scummvm-rg350-bbbb608c528699f281fdd5a8a7d814dd44b9aa41.zip |
TTS: Implement OSD message reading
Diffstat (limited to 'backends/graphics/surfacesdl')
-rw-r--r-- | backends/graphics/surfacesdl/surfacesdl-graphics.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp index 4b4f218caf..6434e5c295 100644 --- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp +++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp @@ -44,6 +44,9 @@ #include "common/file.h" #include "image/png.h" #endif +#ifdef USE_TTS +#include "common/text-to-speech.h" +#endif static const OSystem::GraphicsMode s_supportedShaders[] = { {"NONE", "Normal (no shader)", 0}, @@ -2303,6 +2306,9 @@ void SurfaceSdlGraphicsManager::drawMouse() { void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) { assert(_transactionMode == kTransactionNone); assert(msg); +#ifdef USE_TTS + Common::String textToSay = msg; +#endif // USE_TTS Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends @@ -2376,6 +2382,14 @@ void SurfaceSdlGraphicsManager::displayMessageOnOSD(const char *msg) { // Ensure a full redraw takes place next time the screen is updated _forceRedraw = true; +#ifdef USE_TTS + if (ConfMan.hasKey("tts_enabled", "scummvm") && + ConfMan.getBool("tts_enabled", "scummvm")) { + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + if (ttsMan) + ttsMan->say(textToSay); + } +#endif // USE_TTS } SDL_Rect SurfaceSdlGraphicsManager::getOSDMessageRect() const { |