mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 00:15:30 +00:00
CGE2: Rework sound system.
This commit is contained in:
parent
c247125469
commit
d7a9ea9e2a
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -306,7 +306,6 @@ public:
|
||||
int _oldMusicVolume;
|
||||
int _oldSfxVolume;
|
||||
bool _music;
|
||||
bool _sfx;
|
||||
|
||||
ResourceManager *_resman;
|
||||
Vga *_vga;
|
||||
|
@ -543,6 +543,7 @@ void CGE2Engine::checkSounds() {
|
||||
_sound->checkSoundHandles();
|
||||
checkVolumeSwitches();
|
||||
_midiPlayer->syncVolume();
|
||||
syncSoundSettings();
|
||||
}
|
||||
|
||||
void CGE2Engine::handleFrame() {
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user