aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoruruk2014-08-13 20:58:22 +0200
committeruruk2014-08-13 20:58:22 +0200
commitd7a9ea9e2a3e29dd99872fff567bbab7f304568c (patch)
treefb9333b0ad8419c73a42396ea9e5386a79e87a0e
parentc24712546906d505ce5030c9494fadfe46f64632 (diff)
downloadscummvm-rg350-d7a9ea9e2a3e29dd99872fff567bbab7f304568c.tar.gz
scummvm-rg350-d7a9ea9e2a3e29dd99872fff567bbab7f304568c.tar.bz2
scummvm-rg350-d7a9ea9e2a3e29dd99872fff567bbab7f304568c.zip
CGE2: Rework sound system.
-rw-r--r--engines/cge2/cge2.cpp3
-rw-r--r--engines/cge2/cge2.h1
-rw-r--r--engines/cge2/cge2_main.cpp1
-rw-r--r--engines/cge2/toolbar.cpp11
4 files changed, 6 insertions, 10 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index 50843514a8..59d9fa9cbe 100644
--- a/engines/cge2/cge2.cpp
+++ b/engines/cge2/cge2.cpp
@@ -101,12 +101,11 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
_sayVox = !ConfMan.getBool("speech_mute");
if (ConfMan.getBool("mute")) {
_oldMusicVolume = _oldSfxVolume = 0;
- _music = _sfx = false;
+ _music = false;
} else {
_oldMusicVolume = ConfMan.getInt("music_volume");
_oldSfxVolume = ConfMan.getInt("sfx_volume");
_music = _oldMusicVolume != 0;
- _sfx = _oldSfxVolume != 0;
}
}
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
index cf03d098eb..4750d4a996 100644
--- a/engines/cge2/cge2.h
+++ b/engines/cge2/cge2.h
@@ -306,7 +306,6 @@ public:
int _oldMusicVolume;
int _oldSfxVolume;
bool _music;
- bool _sfx;
ResourceManager *_resman;
Vga *_vga;
diff --git a/engines/cge2/cge2_main.cpp b/engines/cge2/cge2_main.cpp
index 328af08f53..bb12c52746 100644
--- a/engines/cge2/cge2_main.cpp
+++ b/engines/cge2/cge2_main.cpp
@@ -543,6 +543,7 @@ void CGE2Engine::checkSounds() {
_sound->checkSoundHandles();
checkVolumeSwitches();
_midiPlayer->syncVolume();
+ syncSoundSettings();
}
void CGE2Engine::handleFrame() {
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp
index 501a25cb9a..2b7604a447 100644
--- a/engines/cge2/toolbar.cpp
+++ b/engines/cge2/toolbar.cpp
@@ -123,11 +123,11 @@ void CGE2Engine::setVolume(int idx, int cnt) {
int newVolume = p * kSoundStatetoNumRate;
switch (idx) {
case 0:
+ _oldSfxVolume = ConfMan.getInt("sfx_volume");
ConfMan.setInt("sfx_volume", newVolume);
break;
case 1:
- if (newVolume == 0)
- _oldMusicVolume = ConfMan.getInt("music_volume");
+ _oldMusicVolume = ConfMan.getInt("music_volume");
ConfMan.setInt("music_volume", newVolume);
break;
default:
@@ -143,11 +143,8 @@ void CGE2Engine::checkVolumeSwitches() {
_vol[1]->step(musicVolume / kSoundNumtoStateRate);
int sfxVolume = ConfMan.getInt("sfx_volume");
- if (sfxVolume != _oldSfxVolume) {
+ if (sfxVolume != _oldSfxVolume)
_vol[0]->step(sfxVolume / kSoundNumtoStateRate);
- _oldSfxVolume = sfxVolume;
- _sfx = true;
- }
}
void CGE2Engine::switchCap() {
@@ -159,8 +156,8 @@ void CGE2Engine::switchCap() {
}
void CGE2Engine::switchVox() {
- _mixer->muteSoundType(Audio::Mixer::kSpeechSoundType, _sayVox);
_sayVox = !_sayVox;
+ _mixer->muteSoundType(Audio::Mixer::kSpeechSoundType, _sayVox);
if (!_sayVox)
_sayCap = true;
keyClick();