From 562f8a9463a23e7dfac01d81b6e11c13b4c66600 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 18 Jun 2010 13:36:29 +0000 Subject: [PATCH] SCI: implementing fading for sci1 only for used channels of the object, fixes lsl1 music issues when going right at the start svn-id: r50018 --- engines/sci/sound/midiparser_sci.cpp | 8 ++++---- engines/sci/sound/midiparser_sci.h | 3 +++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index b6f4a6802bc..931919b2b59 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -646,10 +646,10 @@ void MidiParser_SCI::setVolume(byte volume) { case SCI_VERSION_1_EARLY: case SCI_VERSION_1_LATE: - // sending volume change to all active channels - for (int i = 0; i < _track->channelCount; i++) - if (_track->channels[i].number <= 0xF) - _driver->send(0xB0 + _track->channels[i].number, 7, _volume); + // sending volume change to all used channels + for (int i = 0; i < 15; i++) + if (_channelUsed[i]) + sendToDriver(0xB0 + i, 7, _volume); break; default: diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index 89d1e63d8cb..abedafdde08 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -77,6 +77,9 @@ public: void tryToOwnChannels(); void sendToDriver(uint32 b); + void sendToDriver(byte status, byte firstOp, byte secondOp) { + sendToDriver(status | ((uint32)firstOp << 8) | ((uint32)secondOp << 16)); + } protected: void parseNextEvent(EventInfo &info);