diff options
author | Martin Kiewitz | 2010-06-27 21:41:30 +0000 |
---|---|---|
committer | Martin Kiewitz | 2010-06-27 21:41:30 +0000 |
commit | a887d4898db9c954f29972e8bfb5155659069e4b (patch) | |
tree | a74f17e2d22ee2a55f9121b7e148bb31fa37ccec /engines/sci | |
parent | 8db94ef9913713185dafebfd040b6f08611f903d (diff) | |
download | scummvm-rg350-a887d4898db9c954f29972e8bfb5155659069e4b.tar.gz scummvm-rg350-a887d4898db9c954f29972e8bfb5155659069e4b.tar.bz2 scummvm-rg350-a887d4898db9c954f29972e8bfb5155659069e4b.zip |
SCI: tell midiparser that he lost ownership of channels in case we take them away
svn-id: r50405
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/sound/midiparser_sci.cpp | 6 | ||||
-rw-r--r-- | engines/sci/sound/midiparser_sci.h | 1 | ||||
-rw-r--r-- | engines/sci/sound/music.cpp | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/sound/midiparser_sci.cpp b/engines/sci/sound/midiparser_sci.cpp index 50a2407dde..099d4572be 100644 --- a/engines/sci/sound/midiparser_sci.cpp +++ b/engines/sci/sound/midiparser_sci.cpp @@ -648,6 +648,12 @@ void MidiParser_SCI::tryToOwnChannels() { } } +void MidiParser_SCI::lostChannels() { + for (int curChannel = 0; curChannel < 15; curChannel++) + if ((_channelUsed[curChannel]) && (curChannel != 9)) + _channelRemap[curChannel] = -1; +} + void MidiParser_SCI::setVolume(byte volume) { // FIXME: This receives values > 127... throw a warning for now and clip the variable if (volume > MUSIC_VOLUME_MAX) { diff --git a/engines/sci/sound/midiparser_sci.h b/engines/sci/sound/midiparser_sci.h index dbd37018b1..8b796d01fc 100644 --- a/engines/sci/sound/midiparser_sci.h +++ b/engines/sci/sound/midiparser_sci.h @@ -81,6 +81,7 @@ public: const byte *getMixedData() const { return _mixedData; } void tryToOwnChannels(); + void lostChannels(); void sendFromScriptToDriver(uint32 midi); void sendToDriver(uint32 midi); void sendToDriver(byte status, byte firstOp, byte secondOp) { diff --git a/engines/sci/sound/music.cpp b/engines/sci/sound/music.cpp index d1555ca7a6..f10ff6d09a 100644 --- a/engines/sci/sound/music.cpp +++ b/engines/sci/sound/music.cpp @@ -287,6 +287,8 @@ void SciMusic::freeChannels(MusicEntry *caller) { if (_usedChannel[i] == caller) _usedChannel[i] = 0; } + // Also tell midiparser, that he lost ownership + caller->pMidiParser->lostChannels(); } void SciMusic::soundPlay(MusicEntry *pSnd) { |