aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-07-24 16:50:36 +0200
committeruruk2014-07-24 16:50:36 +0200
commit755fedcceba70267ea41ea5fed5a4e021c05b0e7 (patch)
tree2905393047702ee4ae6866235ba2ede5cbd62d8f
parenta6eb08903351d916d2c243ca031392a5ebd2240a (diff)
downloadscummvm-rg350-755fedcceba70267ea41ea5fed5a4e021c05b0e7.tar.gz
scummvm-rg350-755fedcceba70267ea41ea5fed5a4e021c05b0e7.tar.bz2
scummvm-rg350-755fedcceba70267ea41ea5fed5a4e021c05b0e7.zip
CGE2: Set speech only/text only/both modes according to Launcher options.
-rw-r--r--engines/cge2/cge2.cpp9
-rw-r--r--engines/cge2/cge2.h2
-rw-r--r--engines/cge2/saveload.cpp2
-rw-r--r--engines/cge2/sound.cpp2
-rw-r--r--engines/cge2/toolbar.cpp45
5 files changed, 27 insertions, 33 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index 55ac835637..94b876c724 100644
--- a/engines/cge2/cge2.cpp
+++ b/engines/cge2/cge2.cpp
@@ -91,6 +91,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
_endGame = false;
for (int i = 0; i < 4; i++)
_flag[i] = false;
+ _enaVox = true;
_sayCap = true;
_sayVox = true;
_oldSayVox = false;
@@ -98,7 +99,6 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
_midiNotify = nullptr;
_spriteNotify = nullptr;
_enaCap = true;
- _enaVox = true;
}
void CGE2Engine::init() {
@@ -177,4 +177,11 @@ Common::Error CGE2Engine::run() {
return Common::kNoError;
}
+void CGE2Engine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+
+ _enaCap = _sayCap = ConfMan.getBool("subtitles");
+ _enaVox = _sayVox = !ConfMan.getBool("speech_mute");
+}
+
} // End of namespace CGE2
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
index b7b2dd3b65..62db99a4ab 100644
--- a/engines/cge2/cge2.h
+++ b/engines/cge2/cge2.h
@@ -133,6 +133,7 @@ private:
void syncHeader(Common::Serializer &s);
bool loadGame(int slotNumber);
void resetGame();
+ void syncSoundSettings();
public:
CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription);
virtual bool hasFeature(EngineFeature f) const;
@@ -175,6 +176,7 @@ public:
Sprite *locate(int ref);
bool isHero(Sprite *spr);
void loadUser();
+ void switchSay();
void checkSaySwitch();
void loadPos();
void releasePocket(Sprite *spr);
diff --git a/engines/cge2/saveload.cpp b/engines/cge2/saveload.cpp
index b9a856f5f4..6d7bb2492a 100644
--- a/engines/cge2/saveload.cpp
+++ b/engines/cge2/saveload.cpp
@@ -366,9 +366,9 @@ bool CGE2Engine::loadGame(int slotNumber) {
// Get in the savegame
syncGame(readStream, nullptr);
-
delete readStream;
+ syncSoundSettings();
initToolbar();
loadHeroes();
diff --git a/engines/cge2/sound.cpp b/engines/cge2/sound.cpp
index 7e886e5639..b42ba188b2 100644
--- a/engines/cge2/sound.cpp
+++ b/engines/cge2/sound.cpp
@@ -62,7 +62,7 @@ void Sound::close() {
void Sound::open() {
setRepeat(1);
if (_vm->_commandHandlerTurbo != nullptr)
- _vm->checkSaySwitch();
+ _vm->switchSay();
play(_vm->_fx->load(99, 99));
}
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp
index 693d940a21..e643632bbe 100644
--- a/engines/cge2/toolbar.cpp
+++ b/engines/cge2/toolbar.cpp
@@ -137,47 +137,32 @@ void CGE2Engine::setVolume(int idx, int cnt) {
}
void CGE2Engine::switchCap() {
- if (_enaCap) {
+ if (_enaCap && _enaVox) {
_sayCap = !_sayCap;
- if (!_sayCap)
+ if (!_sayCap && _enaVox)
_sayVox = true;
- checkSaySwitch();
+ keyClick();
+ switchSay();
}
}
void CGE2Engine::switchVox() {
- if (_enaVox) {
+ if (_enaVox && _enaCap) {
_sayVox = !_sayVox;
- if (!_sayVox)
+ if (!_sayVox && _enaCap)
_sayCap = true;
- checkSaySwitch();
+ keyClick();
+ switchSay();
}
}
-void CGE2Engine::checkSaySwitch() {
- bool mute = false;
- if (ConfMan.hasKey("mute"))
- mute = ConfMan.getBool("mute");
- bool speechMute = mute;
- if (!speechMute)
- speechMute = ConfMan.getBool("speech_mute");
- if (!speechMute) {
- int speechVolume = ConfMan.getInt("speech_volume");
- speechMute = speechVolume == 0;
- }
-
- if (speechMute) {
- _sayVox = false;
- _sayCap = true;
- }
-
- if (_oldSayVox != _sayVox) {
- _commandHandlerTurbo->addCommand(kCmdSeq, 129, _sayVox, nullptr);
- _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr);
- keyClick();
- }
+void CGE2Engine::switchSay() {
+ _commandHandlerTurbo->addCommand(kCmdSeq, 129, _sayVox, nullptr);
+ _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr);
+}
- _oldSayVox = _sayVox;
+void CGE2Engine::checkSaySwitch() {
+ warning("STUB: checkSaySwitch()");
}
void CGE2Engine::initToolbar() {
@@ -187,7 +172,7 @@ void CGE2Engine::initToolbar() {
if (!_music)
_midiPlayer->killMidi();
- _commandHandlerTurbo->addCommand(kCmdSeq, 128, _sayCap, nullptr); // Sets the speech caption switch on.
+ switchSay();
_infoLine->gotoxyz(V3D(kInfoX, kInfoY, 0));
_infoLine->setText(nullptr);