[Scummvm-git-logs] scummvm master -> c2a1bb76d0c246e77ee515e17514016b7d82b65a

bluegr bluegr at gmail.com
Sat Feb 22 19:16:01 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c2a1bb76d0 MADS: Slight fixes for the new TTS narrator feature


Commit: c2a1bb76d0c246e77ee515e17514016b7d82b65a
    https://github.com/scummvm/scummvm/commit/c2a1bb76d0c246e77ee515e17514016b7d82b65a
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-02-22T21:15:49+02:00

Commit Message:
MADS: Slight fixes for the new TTS narrator feature

The narrator is now stopped when a dialog is closed prematurely. Also,
the header text is not narrated.

Changed paths:
    engines/mads/dialogs.cpp


diff --git a/engines/mads/dialogs.cpp b/engines/mads/dialogs.cpp
index e1ae374..5141e31 100644
--- a/engines/mads/dialogs.cpp
+++ b/engines/mads/dialogs.cpp
@@ -199,6 +199,13 @@ int TextDialog::estimatePieces(int maxLen) {
 }
 
 TextDialog::~TextDialog() {
+#ifdef USE_TTS
+	if (ConfMan.getBool("tts_narrator")) {
+		Common::TextToSpeechManager* _ttsMan = g_system->getTextToSpeechManager();
+		_ttsMan->stop();
+	}
+#endif
+
 	delete _edgeSeries;
 }
 
@@ -361,18 +368,20 @@ void TextDialog::draw() {
 
 			if (_portrait != nullptr)
 				xp += _portrait->w + 5;
-			#ifdef USE_TTS
-			text += _lines[lineNum];
-			#endif
 			_font->writeString(_vm->_screen, _lines[lineNum],
 				Common::Point(xp, yp), 1);
 
 			if (_lineXp[lineNum] & 0x80) {
-				// Draw an underline under the text
+				// Draw an underline under the text - used for the header text
 				int lineWidth = _font->getWidth(_lines[lineNum], 1);
 				_vm->_screen->hLine(xp, yp + _font->getHeight(), xp + lineWidth,
 					TEXTDIALOG_BLACK);
 			}
+#ifdef USE_TTS
+			else {
+				text += _lines[lineNum];
+			}
+#endif
 		}
 
 		lineYp += _font->getHeight() + 1;




More information about the Scummvm-git-logs mailing list