Ticket #9302: 0001-SCI-do-not-fade-rhythm-channel-revised-1.patch

File 0001-SCI-do-not-fade-rhythm-channel-revised-1.patch, 2.3 KB (added by tsoliman, 13 years ago)

revised patch after using MIDI_RHYTHM_CHANNEL as instructed by thebluegr

  • engines/sci/sound/midiparser_sci.cpp

    From 00dae3bb9926e4e8c938876235ced42cc9dfcf09 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..5de5824 100644
    a b void MidiParser_SCI::setMasterVolume(byte masterVolume) {  
    714714        }
    715715}
    716716
    717 void MidiParser_SCI::setVolume(byte volume) {
     717void MidiParser_SCI::setVolume(byte volume, bool fade) {
    718718        assert(volume <= MUSIC_VOLUME_MAX);
    719719        _volume = volume;
    720720
    void MidiParser_SCI::setVolume(byte volume) {  
    732732        case SCI_VERSION_2_1:
    733733                // Send previous channel volumes again to actually update the volume
    734734                for (int i = 0; i < 15; i++)
    735                         if (_channelRemap[i] != -1)
     735                        if (_channelRemap[i] != -1 && !(fade && i == MIDI_RHYTHM_CHANNEL))
    736736                                sendToDriver(0xB0 + i, 7, _channelVolume[i]);
    737737                break;
    738738
  • engines/sci/sound/midiparser_sci.h

    diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h
    index 39de425..8ea0a73 100644
    a b public:  
    6666        void sendInitCommands();
    6767        void unloadMusic();
    6868        void setMasterVolume(byte masterVolume);
    69         void setVolume(byte volume);
     69        void setVolume(byte volume, bool fade=false);
    7070        void stop() {
    7171                _abort_parse = true;
    7272                allNotesOff();
  • engines/sci/sound/music.cpp

    diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp
    index 956db50..0b8c0fc 100644
    a b void MusicEntry::doFade() {  
    771771
    772772                // Only process MIDI streams in this thread, not digital sound effects
    773773                if (pMidiParser) {
    774                         pMidiParser->setVolume(volume);
     774                        pMidiParser->setVolume(volume, true);
    775775                }
    776776
    777777                fadeSetVolume = true; // set flag so that SoundCommandParser::cmdUpdateCues will set the volume of the stream