From 1e0a42170cdb7181b6d62e11432368576eaf5a4b Mon Sep 17 00:00:00 2001
From: Tarek Soliman <tarek@bashasoliman.com>
Date: Fri, 1 Apr 2011 00:11:58 -0500
Subject: [PATCH] SCI: do not fade rhythm channel
Fading currently fades all channels including rhythm.
I believe SSCI doesn't fade rhythm or has another way
of handling the problem that occurs in the QFG2
shema dance sequence.
---
engines/sci/sound/midiparser_sci.cpp | 4 ++--
engines/sci/sound/midiparser_sci.h | 2 +-
engines/sci/sound/music.cpp | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp
index 0b9d761..63f0424 100644
a
|
b
|
void MidiParser_SCI::setMasterVolume(byte masterVolume) {
|
714 | 714 | } |
715 | 715 | } |
716 | 716 | |
717 | | void MidiParser_SCI::setVolume(byte volume) { |
| 717 | void MidiParser_SCI::setVolume(byte volume, bool fade) { |
718 | 718 | assert(volume <= MUSIC_VOLUME_MAX); |
719 | 719 | _volume = volume; |
720 | 720 | |
… |
… |
void MidiParser_SCI::setVolume(byte volume) {
|
732 | 732 | case SCI_VERSION_2_1: |
733 | 733 | // Send previous channel volumes again to actually update the volume |
734 | 734 | for (int i = 0; i < 15; i++) |
735 | | if (_channelRemap[i] != -1) |
| 735 | if (_channelRemap[i] != -1 && !(fade && i == 9)) |
736 | 736 | sendToDriver(0xB0 + i, 7, _channelVolume[i]); |
737 | 737 | break; |
738 | 738 | |
diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
index 39de425..8ea0a73 100644
a
|
b
|
public:
|
66 | 66 | void sendInitCommands(); |
67 | 67 | void unloadMusic(); |
68 | 68 | void setMasterVolume(byte masterVolume); |
69 | | void setVolume(byte volume); |
| 69 | void setVolume(byte volume, bool fade=false); |
70 | 70 | void stop() { |
71 | 71 | _abort_parse = true; |
72 | 72 | allNotesOff(); |
diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
index 956db50..0b8c0fc 100644
a
|
b
|
void MusicEntry::doFade() {
|
771 | 771 | |
772 | 772 | // Only process MIDI streams in this thread, not digital sound effects |
773 | 773 | if (pMidiParser) { |
774 | | pMidiParser->setVolume(volume); |
| 774 | pMidiParser->setVolume(volume, true); |
775 | 775 | } |
776 | 776 | |
777 | 777 | fadeSetVolume = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream |