aboutsummaryrefslogtreecommitdiff
path: root/engines/lure/surface.cpp
diff options
context:
space:
mode:
authorneuromancer2019-12-20 18:50:44 -0300
committerFilippos Karapetis2019-12-20 23:50:44 +0200
commitd0571e6ab5e235e60884ebeffa0da7a3181d2ba6 (patch)
tree6ca739925cf1c40f3102b29651eb26cd76743c9f /engines/lure/surface.cpp
parent986ceec96cbbd4b794033634d78d9b858d4ba123 (diff)
downloadscummvm-rg350-d0571e6ab5e235e60884ebeffa0da7a3181d2ba6.tar.gz
scummvm-rg350-d0571e6ab5e235e60884ebeffa0da7a3181d2ba6.tar.bz2
scummvm-rg350-d0571e6ab5e235e60884ebeffa0da7a3181d2ba6.zip
LURE: Enable the optional use of TTS to read descriptions as a narrator
Diffstat (limited to 'engines/lure/surface.cpp')
-rw-r--r--engines/lure/surface.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/lure/surface.cpp b/engines/lure/surface.cpp
index 55ba28de9a..9881256502 100644
--- a/engines/lure/surface.cpp
+++ b/engines/lure/surface.cpp
@@ -30,6 +30,11 @@
#include "lure/strings.h"
#include "lure/surface.h"
#include "common/endian.h"
+#include "common/config-manager.h"
+
+#ifdef USE_TTS
+#include "common/text-to-speech.h"
+#endif
namespace Lure {
@@ -467,13 +472,28 @@ Surface *Surface::newDialog(uint16 width, uint8 numLines, const char **lines, bo
Surface *s = new Surface(width, size.y);
s->createDialog();
+ #ifdef USE_TTS
+ Common::String text;
+ #endif
uint16 yP = Surface::textY();
for (uint8 ctr = 0; ctr < numLines; ++ctr) {
+ #ifdef USE_TTS
+ text += lines[ctr];
+ #endif
s->writeString(Surface::textX(), yP, lines[ctr], true, color, varLength);
yP += squashedLines ? FONT_HEIGHT - 1 : FONT_HEIGHT;
}
+
+ #ifdef USE_TTS
+ if (ConfMan.getBool("tts_narrator")) {
+ Common::TextToSpeechManager *_ttsMan = g_system->getTextToSpeechManager();
+ _ttsMan->stop();
+ _ttsMan->say(text.c_str());
+ }
+ #endif
+
return s;
}