diff options
-rw-r--r-- | base/main.cpp | 8 | ||||
-rw-r--r-- | engines/engine.cpp | 12 | ||||
-rw-r--r-- | gui/gui-manager.h | 2 |
3 files changed, 21 insertions, 1 deletions
diff --git a/base/main.cpp b/base/main.cpp index 656a24b94b..ccd213eb31 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -558,9 +558,17 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) { break; } #endif +#ifdef USE_TTS + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + ttsMan->pushState(); +#endif // Try to run the game Common::Error result = runGame(plugin, system, specialDebug); +#ifdef USE_TTS + ttsMan->popState(); +#endif + #ifdef ENABLE_EVENTRECORDER // Flush Event recorder file. The recorder does not get reinitialized for next game // which is intentional. Only single game per session is allowed. diff --git a/engines/engine.cpp b/engines/engine.cpp index b9859776fc..d34f1a6510 100644 --- a/engines/engine.cpp +++ b/engines/engine.cpp @@ -61,6 +61,10 @@ #include "graphics/pixelformat.h" #include "image/bmp.h" +#ifdef USE_TTS +#include "common/text-to-speech.h" +#endif + #ifdef _WIN32_WCE extern bool isSmartphone(); #endif @@ -515,6 +519,11 @@ void Engine::pauseEngineIntern(bool pause) { void Engine::openMainMenuDialog() { if (!_mainMenuDialog) _mainMenuDialog = new MainMenuDialog(this); +#ifdef USE_TTS + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + ttsMan->pushState(); + GUI::GuiManager::initTextToSpeech(); +#endif setGameToLoadSlot(-1); @@ -536,6 +545,9 @@ void Engine::openMainMenuDialog() { } syncSoundSettings(); +#ifdef USE_TTS + ttsMan->popState(); +#endif } bool Engine::warnUserAboutUnsupportedGame() { diff --git a/gui/gui-manager.h b/gui/gui-manager.h index fa5e715bcb..866bc42e04 100644 --- a/gui/gui-manager.h +++ b/gui/gui-manager.h @@ -107,6 +107,7 @@ public: * only be deleted when that dialog is the top level dialog. */ void addToTrash(GuiObject*, Dialog* parent = 0); + static void initTextToSpeech(); bool _launched; @@ -177,7 +178,6 @@ protected: void giveFocusToDialog(Dialog *dialog); void setLastMousePos(int16 x, int16 y); - void initTextToSpeech(); }; } // End of namespace GUI |