diff options
author | Torbjörn Andersson | 2013-04-21 12:54:19 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2013-04-21 12:54:19 +0200 |
commit | 8d25c558910c1a2e14c32ace568121ab8c643b70 (patch) | |
tree | d92e8ef3dc2a63657aab8aac26362bec1dd27aec | |
parent | 5d7067baaa5aef82b7584403c8f1fa256d9bbb9b (diff) | |
download | scummvm-rg350-8d25c558910c1a2e14c32ace568121ab8c643b70.tar.gz scummvm-rg350-8d25c558910c1a2e14c32ace568121ab8c643b70.tar.bz2 scummvm-rg350-8d25c558910c1a2e14c32ace568121ab8c643b70.zip |
KYRA: Fix MIDI fade-out behaviour
There are two ways that the music volume may be set:
The setSourceVolume() specifies the current music volume, as
ScummVM sees it. This is stored in _sources[].volume.
The MIDI data itself can trigger volume events. These are handled
by send(), which stores the volume - usually (always?) 100 - in
_sources[_curSource].controllers[]. The volume is then adjusted
by _sources[].volume.
When music is faded out, setSourceVolume() is called repeatedly
with progressively smaller values for the volume. What it should
do, then, is to make sure that the volume is set to what was
previously set to in send(), adjusted to the fading volume.
At least, that's how I understand it.
-rw-r--r-- | engines/kyra/sound_midi.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/kyra/sound_midi.cpp b/engines/kyra/sound_midi.cpp index b93b42fa9c..fc6e92abd9 100644 --- a/engines/kyra/sound_midi.cpp +++ b/engines/kyra/sound_midi.cpp @@ -323,7 +323,7 @@ void MidiOutput::setSourceVolume(int source, int volume, bool apply) { for (int i = 0; i < 16; ++i) { // Controller 0 in the state table should always be '7' aka // volume control - byte realVol = (_channels[i].controllers[0].value * volume) >> 8; + byte realVol = (_sources[source].controllers[i][0].value * volume) >> 8; sendIntern(0xB0, i, 0x07, realVol); } } |