diff options
author | Paul Gilbert | 2009-08-05 10:44:37 +0000 |
---|---|---|
committer | Paul Gilbert | 2009-08-05 10:44:37 +0000 |
commit | 26b372603bf84ad050d0c7b0db6896eb5279664e (patch) | |
tree | 0fd7b017de2e33e207adb9146a5248be2ba7060e /engines/tinsel | |
parent | 4af0cfbdbdc9feafca2728cee8deca7ae9b472b1 (diff) | |
download | scummvm-rg350-26b372603bf84ad050d0c7b0db6896eb5279664e.tar.gz scummvm-rg350-26b372603bf84ad050d0c7b0db6896eb5279664e.tar.bz2 scummvm-rg350-26b372603bf84ad050d0c7b0db6896eb5279664e.zip |
Bugfix for music not being stopped when music volume is set to zero
svn-id: r43066
Diffstat (limited to 'engines/tinsel')
-rw-r--r-- | engines/tinsel/music.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 12d9f0393a..06b70874dc 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -303,6 +303,8 @@ int GetMidiVolume() { return volMusic; } +static int priorVolMusic = 0; + /** * Sets the volume of the MIDI music. * @param vol New volume - 0..MAXMIDIVOL @@ -310,23 +312,24 @@ int GetMidiVolume() { void SetMidiVolume(int vol) { assert(vol >= 0 && vol <= Audio::Mixer::kMaxChannelVolume); - if (vol == 0 && volMusic == 0) { + if (vol == 0 && priorVolMusic == 0) { // Nothing to do - } else if (vol == 0 && volMusic != 0) { + } else if (vol == 0 && priorVolMusic != 0) { // Stop current midi sequence StopMidi(); - } else if (vol != 0 && volMusic == 0) { + _vm->_midiMusic->setVolume(vol); + } else if (vol != 0 && priorVolMusic == 0) { // Perhaps restart last midi sequence if (currentLoop) { PlayMidiSequence(currentMidi, true); _vm->_midiMusic->setVolume(vol); } - } else if (vol != 0 && volMusic != 0) { + } else if (vol != 0 && priorVolMusic != 0) { // Alter current volume _vm->_midiMusic->setVolume(vol); } - volMusic = vol; + priorVolMusic = vol; } /** |