aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-28 10:36:10 +0000
committerMartin Kiewitz2010-06-28 10:36:10 +0000
commitcaa4479bdf593241e3a93525387f98ba4fd969bf (patch)
tree1002cd4a0e8dd3a9470d306c79c9c918449e961d
parent10a9dfc0d7a521d7f9815fd21edc5e7b82d8344c (diff)
downloadscummvm-rg350-caa4479bdf593241e3a93525387f98ba4fd969bf.tar.gz
scummvm-rg350-caa4479bdf593241e3a93525387f98ba4fd969bf.tar.bz2
scummvm-rg350-caa4479bdf593241e3a93525387f98ba4fd969bf.zip
SCI: changed the way setVolume works for sci0 back to the way it was from r50414, because adlib driver doesn't support channel volume changes for sci0 games, fixes fading in those games
svn-id: r50417
-rw-r--r--engines/sci/sound/midiparser_sci.cpp16
1 files changed, 4 insertions, 12 deletions
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 4503e97628..4172d05888 100644
--- a/engines/sci/sound/midiparser_sci.cpp
+++ b/engines/sci/sound/midiparser_sci.cpp
@@ -673,20 +673,14 @@ void MidiParser_SCI::setVolume(byte volume) {
}
assert(volume <= MUSIC_VOLUME_MAX);
- _volume = volume;
- // 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]);
- return;
- // TODO: old code, should be left here till we figured out that new code works fine
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;
@@ -694,12 +688,10 @@ void MidiParser_SCI::setVolume(byte volume) {
case SCI_VERSION_1_EARLY:
case SCI_VERSION_1_LATE:
- // sending volume change to all currently mapped channels
- // FIXME?: maybe we should better store new volume if music isn't playing currently and adjust volume
- // when playing
+ // 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, _volume);
+ sendToDriver(0xB0 + i, 7, _channelVolume[i]);
break;
default: