[Scummvm-cvs-logs] scummvm master -> d7a9ea9e2a3e29dd99872fff567bbab7f304568c
urukgit
urukgit at users.noreply.github.com
Wed Aug 13 20:59:03 CEST 2014
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c247125469 CGE2: Rename _soundHandle to _sfxHandle.
d7a9ea9e2a CGE2: Rework sound system.
Commit: c24712546906d505ce5030c9494fadfe46f64632
https://github.com/scummvm/scummvm/commit/c24712546906d505ce5030c9494fadfe46f64632
Author: uruk (koppirnyo at gmail.com)
Date: 2014-08-13T20:35:31+02:00
Commit Message:
CGE2: Rename _soundHandle to _sfxHandle.
Changed paths:
engines/cge2/sound.cpp
engines/cge2/sound.h
diff --git a/engines/cge2/sound.cpp b/engines/cge2/sound.cpp
index a3accdf..32f94b1 100644
--- a/engines/cge2/sound.cpp
+++ b/engines/cge2/sound.cpp
@@ -93,7 +93,7 @@ void Sound::sndDigiStart(SmpInfo *PSmpInfo, Audio::Mixer::SoundType soundType) {
Audio::SoundHandle *handle = nullptr;
switch (soundType) {
case Audio::Mixer::kSFXSoundType:
- handle = &_soundHandle;
+ handle = &_sfxHandle;
break;
case Audio::Mixer::kSpeechSoundType:
handle = &_speechHandle;
@@ -114,13 +114,13 @@ void Sound::sndDigiStart(SmpInfo *PSmpInfo, Audio::Mixer::SoundType soundType) {
}
void Sound::stop() {
- sndDigiStop(_soundHandle);
+ sndDigiStop(_sfxHandle);
sndDigiStop(_speechHandle);
_audioStream = nullptr;
}
void Sound::checkSoundHandles() {
- if (!_vm->_mixer->isSoundHandleActive(_speechHandle) && !_vm->_mixer->isSoundHandleActive(_soundHandle))
+ if (!_vm->_mixer->isSoundHandleActive(_speechHandle) && !_vm->_mixer->isSoundHandleActive(_sfxHandle))
_smpinf._counter = 0;
}
diff --git a/engines/cge2/sound.h b/engines/cge2/sound.h
index 2960dc3..6673b67 100644
--- a/engines/cge2/sound.h
+++ b/engines/cge2/sound.h
@@ -80,7 +80,7 @@ public:
private:
int _soundRepeatCount;
CGE2Engine *_vm;
- Audio::SoundHandle _soundHandle;
+ Audio::SoundHandle _sfxHandle;
Audio::SoundHandle _speechHandle;
Audio::RewindableAudioStream *_audioStream;
Commit: d7a9ea9e2a3e29dd99872fff567bbab7f304568c
https://github.com/scummvm/scummvm/commit/d7a9ea9e2a3e29dd99872fff567bbab7f304568c
Author: uruk (koppirnyo at gmail.com)
Date: 2014-08-13T20:58:22+02:00
Commit Message:
CGE2: Rework sound system.
Changed paths:
engines/cge2/cge2.cpp
engines/cge2/cge2.h
engines/cge2/cge2_main.cpp
engines/cge2/toolbar.cpp
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp
index 5084351..59d9fa9 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 cf03d09..4750d4a 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 328af08..bb12c52 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 501a25c..2b7604a 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();
More information about the Scummvm-git-logs
mailing list