diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/gui-manager.cpp | 2 | ||||
-rw-r--r-- | gui/options.cpp | 5 | ||||
-rw-r--r-- | gui/widget.cpp | 5 | ||||
-rw-r--r-- | gui/widgets/popup.cpp | 7 |
4 files changed, 12 insertions, 7 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 666e079aa6..c77af7c71f 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -626,6 +626,8 @@ void GuiManager::setLastMousePos(int16 x, int16 y) { #ifdef USE_TTS void GuiManager::initTextToSpeech() { Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + if (ttsMan == nullptr) + return; #ifdef USE_TRANSLATION Common::String currentLanguage = TransMan.getCurrentLanguage(); if (currentLanguage != "C") { diff --git a/gui/options.cpp b/gui/options.cpp index 3195694935..71f8cadd15 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -1800,7 +1800,10 @@ void GlobalOptionsDialog::build() { _ttsCheckbox->setState(false); _ttsVoiceSelectionPopUp = new PopUpWidget(tab, "GlobalOptions_Accessibility.TTSVoiceSelection"); - Common::Array<Common::TTSVoice> voices = g_system->getTextToSpeechManager()->getVoicesArray(); + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + Common::Array<Common::TTSVoice> voices; + if (ttsMan != nullptr) + voices = ttsMan->getVoicesArray(); for(unsigned i = 0; i < voices.size(); i++) { _ttsVoiceSelectionPopUp->appendEntry(voices[i].getDescription(), i); diff --git a/gui/widget.cpp b/gui/widget.cpp index 3269a5fd6c..f870eb52dc 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -260,7 +260,10 @@ void Widget::read(Common::String str) { #ifdef USE_TTS if (ConfMan.hasKey("tts_enabled", "scummvm") && ConfMan.getBool("tts_enabled", "scummvm")) { - g_system->getTextToSpeechManager()->say(str); + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + if (ttsMan == nullptr) + return; + ttsMan->say(str); } #endif } diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp index fe51b39c10..532127a422 100644 --- a/gui/widgets/popup.cpp +++ b/gui/widgets/popup.cpp @@ -227,11 +227,8 @@ void PopUpDialog::read(Common::String str) { #ifdef USE_TTS if (ConfMan.hasKey("tts_enabled", "scummvm") && ConfMan.getBool("tts_enabled", "scummvm")) { - int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; - if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm")) - volume = 0; - g_system->getTextToSpeechManager()->setVolume(volume); - g_system->getTextToSpeechManager()->say(str); + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + ttsMan->say(str); } #endif } |