diff options
author | uruk | 2014-07-22 20:25:21 +0200 |
---|---|---|
committer | uruk | 2014-07-22 20:25:21 +0200 |
commit | 49f68a89132590ec5ef261451884249721de636b (patch) | |
tree | 58fa1797156568c9beae4e16ac9b289b74c5a680 /engines | |
parent | 848b2650e9427739b79e8b8c6c46f0501d6c3f18 (diff) | |
download | scummvm-rg350-49f68a89132590ec5ef261451884249721de636b.tar.gz scummvm-rg350-49f68a89132590ec5ef261451884249721de636b.tar.bz2 scummvm-rg350-49f68a89132590ec5ef261451884249721de636b.zip |
CGE2: Reimplement checkSaySwitch().
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2.cpp | 2 | ||||
-rw-r--r-- | engines/cge2/cge2.h | 1 | ||||
-rw-r--r-- | engines/cge2/cge2_main.cpp | 27 |
3 files changed, 24 insertions, 6 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index e247cf507e..30529d9fbc 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -92,6 +92,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) _flag[i] = false; _sayCap = true; _sayVox = true; + _oldSayVox = false; _req = 1; _midiNotify = nullptr; _spriteNotify = nullptr; @@ -164,6 +165,7 @@ bool CGE2Engine::hasFeature(EngineFeature f) const { } Common::Error CGE2Engine::run() { + syncSoundSettings(); initGraphics(kScrWidth, kScrHeight, false); init(); diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index 48d9bc84fe..dbde43ae32 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -280,6 +280,7 @@ public: bool _flag[4]; bool _sayCap; bool _sayVox; + bool _oldSayVox; int _req; NotifyFunctionType _midiNotify; NotifyFunctionType _spriteNotify; diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp index 353abb8391..65c5a746b9 100644 --- a/engines/cge2/cge2_main.cpp +++ b/engines/cge2/cge2_main.cpp @@ -26,6 +26,7 @@ */ #include "sound.h" +#include "common/config-manager.h" #include "cge2/cge2_main.h" #include "cge2/cge2.h" #include "cge2/vga13h.h" @@ -540,6 +541,7 @@ void CGE2Engine::showBak(int ref) { void CGE2Engine::mainLoop() { _sound->checkSoundHandle(); + checkSaySwitch(); _vga->show(); _commandHandlerTurbo->runCommand(); @@ -766,7 +768,7 @@ void CGE2Engine::initToolbar() { if (!_music) _midiPlayer->killMidi(); - checkSaySwitch(); + _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr); // Sets the speech caption switch on. _infoLine->gotoxyz(V3D(kInfoX, kInfoY, 0)); _infoLine->setText(nullptr); @@ -807,11 +809,24 @@ void CGE2Engine::releasePocket(Sprite *spr) { } void CGE2Engine::checkSaySwitch() { - warning("STUB: CGE2Engine::checkSaySwitch()"); -// if (SNDDrvInfo.DDEV == DEV_QUIET) -// _sayVox = !(_sayCap = true); - _commandHandlerTurbo->addCommand(kCmdSeq, 129, _sayVox, nullptr); - _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr); + bool mute = false; + if (ConfMan.hasKey("mute")) + mute = ConfMan.getBool("mute"); + bool speechMute = mute; + if (!speechMute) + speechMute = ConfMan.getBool("speech_mute"); + + if (mute || speechMute) { + _sayVox = false; + _sayCap = true; + } + + if (_oldSayVox != _sayVox) { + _commandHandlerTurbo->addCommand(kCmdSeq, 129, _sayVox, nullptr); + _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr); + } + + _oldSayVox = _sayVox; } void CGE2Engine::loadTab() { |