mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-21 19:51:49 +00:00
CGE2: Add checkMute().
This keeps the "Mute All" option of ScummVM and the music on/off and speech on/off buttons of Sfinx's toolbar in sync.
This commit is contained in:
parent
d7a9ea9e2a
commit
12a894a803
@ -99,9 +99,9 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription)
|
||||
|
||||
_sayCap = ConfMan.getBool("subtitles");
|
||||
_sayVox = !ConfMan.getBool("speech_mute");
|
||||
if (ConfMan.getBool("mute")) {
|
||||
if (_muteAll = ConfMan.getBool("mute")) {
|
||||
_oldMusicVolume = _oldSfxVolume = 0;
|
||||
_music = false;
|
||||
_music = _sayVox = false;
|
||||
} else {
|
||||
_oldMusicVolume = ConfMan.getInt("music_volume");
|
||||
_oldSfxVolume = ConfMan.getInt("sfx_volume");
|
||||
|
@ -225,6 +225,7 @@ public:
|
||||
void switchSay();
|
||||
void initToolbar();
|
||||
void initVolumeSwitch(Sprite *volSwitch, int val);
|
||||
void checkMute();
|
||||
|
||||
void checkSounds();
|
||||
|
||||
@ -306,6 +307,7 @@ public:
|
||||
int _oldMusicVolume;
|
||||
int _oldSfxVolume;
|
||||
bool _music;
|
||||
bool _muteAll;
|
||||
|
||||
ResourceManager *_resman;
|
||||
Vga *_vga;
|
||||
|
@ -540,6 +540,7 @@ void CGE2Engine::mainLoop() {
|
||||
}
|
||||
|
||||
void CGE2Engine::checkSounds() {
|
||||
checkMute();
|
||||
_sound->checkSoundHandles();
|
||||
checkVolumeSwitches();
|
||||
_midiPlayer->syncVolume();
|
||||
|
@ -212,4 +212,14 @@ void CGE2Engine::initVolumeSwitch(Sprite *volSwitch, int val) {
|
||||
volSwitch->step(state);
|
||||
}
|
||||
|
||||
void CGE2Engine::checkMute() {
|
||||
bool mute = ConfMan.getBool("mute");
|
||||
bool mutedChanged = mute != _muteAll;
|
||||
if (mutedChanged) {
|
||||
switchMusic();
|
||||
switchVox();
|
||||
_muteAll = mute;
|
||||
}
|
||||
}
|
||||
|
||||
} // End of namespace CGE2
|
||||
|
Loading…
x
Reference in New Issue
Block a user