aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/sound
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-28 10:48:09 +0000
committerMartin Kiewitz2010-06-28 10:48:09 +0000
commit22a8b2236ee57884929b71eb8cbf1adb5a071b37 (patch)
tree4a647b0c5373470d2389e4384ecacda120b98a3b /engines/sci/sound
parentcaa4479bdf593241e3a93525387f98ba4fd969bf (diff)
downloadscummvm-rg350-22a8b2236ee57884929b71eb8cbf1adb5a071b37.tar.gz
scummvm-rg350-22a8b2236ee57884929b71eb8cbf1adb5a071b37.tar.bz2
scummvm-rg350-22a8b2236ee57884929b71eb8cbf1adb5a071b37.zip
SCI: set volume all the time, fixes volume being 0 after fading in sci0
svn-id: r50418
Diffstat (limited to 'engines/sci/sound')
-rw-r--r--engines/sci/sound/midiparser_sci.cpp42
1 files changed, 20 insertions, 22 deletions
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 4172d05888..2a86ef8942 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -673,30 +673,28 @@ void MidiParser_SCI::setVolume(byte volume) {
}
assert(volume <= MUSIC_VOLUME_MAX);
- if (_volume != volume) {
- _volume = volume;
-
- switch (_soundVersion) {
- case SCI_VERSION_0_EARLY:
- case SCI_VERSION_0_LATE: {
- // SCI0 adlib driver doesn't support channel volumes, so we need to go this way
- // TODO: this should take the actual master volume into account
- int16 globalVolume = _volume * 15 / 127;
- ((MidiPlayer *)_driver)->setVolume(globalVolume);
- break;
- }
+ _volume = volume;
+
+ switch (_soundVersion) {
+ case SCI_VERSION_0_EARLY:
+ case SCI_VERSION_0_LATE: {
+ // SCI0 adlib driver doesn't support channel volumes, so we need to go this way
+ // TODO: this should take the actual master volume into account
+ int16 globalVolume = _volume * 15 / 127;
+ ((MidiPlayer *)_driver)->setVolume(globalVolume);
+ break;
+ }
- case SCI_VERSION_1_EARLY:
- case SCI_VERSION_1_LATE:
- // Send previous channel volumes again to actually update the volume
- for (int i = 0; i < 15; i++)
- if (_channelRemap[i] != -1)
- sendToDriver(0xB0 + i, 7, _channelVolume[i]);
- break;
+ case SCI_VERSION_1_EARLY:
+ case SCI_VERSION_1_LATE:
+ // Send previous channel volumes again to actually update the volume
+ for (int i = 0; i < 15; i++)
+ if (_channelRemap[i] != -1)
+ sendToDriver(0xB0 + i, 7, _channelVolume[i]);
+ break;
- default:
- error("MidiParser_SCI::setVolume: Unsupported soundVersion");
- }
+ default:
+ error("MidiParser_SCI::setVolume: Unsupported soundVersion");
}
}