aboutsummaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorJaromir Wysoglad2019-07-17 23:51:58 +0200
committerFilippos Karapetis2019-09-01 22:47:55 +0300
commitce64528129d4a1ba51e339bd8be3548c4d8cc3bf (patch)
treea16ca7f095685ea95ea4ffa5c845db0f45ce9e46 /base
parent33f8aadfeb81ead60ce1264f0af681dcdbd4931f (diff)
downloadscummvm-rg350-ce64528129d4a1ba51e339bd8be3548c4d8cc3bf.tar.gz
scummvm-rg350-ce64528129d4a1ba51e339bd8be3548c4d8cc3bf.tar.bz2
scummvm-rg350-ce64528129d4a1ba51e339bd8be3548c4d8cc3bf.zip
TTS: Make sure that TTS lang matches transMan lang
Diffstat (limited to 'base')
-rw-r--r--base/main.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/base/main.cpp b/base/main.cpp
index 352dbf9ab4..656a24b94b 100644
--- a/base/main.cpp
+++ b/base/main.cpp
@@ -51,6 +51,7 @@
#include "common/textconsole.h"
#include "common/tokenizer.h"
#include "common/translation.h"
+#include "common/text-to-speech.h"
#include "common/osd_message_queue.h"
#include "gui/gui-manager.h"
@@ -260,8 +261,16 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
&& ConfMan.getBool("gui_use_game_language")
&& ConfMan.hasKey("language")) {
TransMan.setLanguage(ConfMan.get("language"));
+#ifdef USE_TTS
+ Common::TextToSpeechManager *ttsMan;
+ if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr) {
+ Common::String language = ConfMan.get("language");
+ language.setChar(2, '\0');
+ ttsMan->setLanguage(language);
+ }
+#endif // USE_TTS
}
-#endif
+#endif // USE_TRANSLATION
// Initialize any game-specific keymaps
engine->initKeymap();
@@ -289,7 +298,15 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common
#ifdef USE_TRANSLATION
TransMan.setLanguage(previousLanguage);
-#endif
+#ifdef USE_TTS
+ Common::TextToSpeechManager *ttsMan;
+ if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr) {
+ Common::String language = ConfMan.get("language");
+ language.setChar(2, '\0');
+ ttsMan->setLanguage(language);
+ }
+#endif // USE_TTS
+#endif // USE_TRANSLATION
// Return result (== 0 means no error)
return result;