aboutsummaryrefslogtreecommitdiff
path: root/gui/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/options.cpp')
-rw-r--r--gui/options.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index a324ef6338..161742d9bc 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -2154,22 +2154,24 @@ void GlobalOptionsDialog::apply() {
}
#ifdef USE_TTS
Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager();
- if (newLang != oldLang) {
- if (newLang == "C")
- ttsMan->setLanguage("en");
- else {
- ttsMan->setLanguage(newLang);
+ if (ttsMan) {
+ if (newLang != oldLang) {
+ if (newLang == "C")
+ ttsMan->setLanguage("en");
+ else {
+ ttsMan->setLanguage(newLang);
+ }
+ _ttsVoiceSelectionPopUp->setSelectedTag(0);
}
- _ttsVoiceSelectionPopUp->setSelectedTag(0);
+ int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256;
+ if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm"))
+ volume = 0;
+ ttsMan->setVolume(volume);
+ ConfMan.setBool("tts_enabled", _ttsCheckbox->getState(), _domain);
+ int selectedVoice = _ttsVoiceSelectionPopUp->getSelectedTag();
+ ConfMan.setInt("tts_voice", selectedVoice, _domain);
+ ttsMan->setVoice(selectedVoice);
}
- int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256;
- if (ConfMan.hasKey("mute", "scummvm") && ConfMan.getBool("mute", "scummvm"))
- volume = 0;
- ttsMan->setVolume(volume);
- ConfMan.setBool("tts_enabled", _ttsCheckbox->getState(), _domain);
- int selectedVoice = _ttsVoiceSelectionPopUp->getSelectedTag();
- ConfMan.setInt("tts_voice", selectedVoice, _domain);
- ttsMan->setVoice(selectedVoice);
#endif
if (isRebuildNeeded) {