[Scummvm-cvs-logs] SF.net SVN: scummvm:[49922] scummvm/trunk/engines/sci/sound
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Thu Jun 17 10:41:04 CEST 2010
Revision: 49922
http://scummvm.svn.sourceforge.net/scummvm/?rev=49922&view=rev
Author: m_kiewitz
Date: 2010-06-17 08:41:04 +0000 (Thu, 17 Jun 2010)
Log Message:
-----------
SCI: fixes regressions of r49905 (thx to digitall) - first we now find out what channels are used in sci0 as well, we are doing straight mapping for sci0 though - this fixes music in sci0 games, also fixing crash in sq1vga because of using null pMidiParser
Modified Paths:
--------------
scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
scummvm/trunk/engines/sci/sound/music.cpp
Modified: scummvm/trunk/engines/sci/sound/midiparser_sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/midiparser_sci.cpp 2010-06-17 07:53:57 UTC (rev 49921)
+++ scummvm/trunk/engines/sci/sound/midiparser_sci.cpp 2010-06-17 08:41:04 UTC (rev 49922)
@@ -545,6 +545,10 @@
break;
default: // MIDI command
+ // remember which channel got used for channel remapping
+ byte midiChannel = command & 0xF;
+ _channelUsed[midiChannel] = true;
+
if (lastCommand != command) {
*outData++ = command;
debugC(4, kDebugLevelSound, "%02X ", command);
Modified: scummvm/trunk/engines/sci/sound/music.cpp
===================================================================
--- scummvm/trunk/engines/sci/sound/music.cpp 2010-06-17 07:53:57 UTC (rev 49921)
+++ scummvm/trunk/engines/sci/sound/music.cpp 2010-06-17 08:41:04 UTC (rev 49922)
@@ -232,6 +232,9 @@
// This one checks, if requested channel is available -> in that case give caller that channel
// Otherwise look for an unused one
int16 SciMusic::tryToOwnChannel(MusicEntry *caller, int16 bestChannel) {
+ // Don't even try this for SCI0
+ if (_soundVersion <= SCI_VERSION_0_LATE)
+ return bestChannel;
if (!_usedChannel[bestChannel]) {
// currently unused, so give it to caller directly
_usedChannel[bestChannel] = caller;
@@ -308,9 +311,9 @@
DisposeAfterUse::NO);
}
} else {
- pSnd->pMidiParser->tryToOwnChannels();
_mutex.lock();
if (pSnd->pMidiParser) {
+ pSnd->pMidiParser->tryToOwnChannels();
pSnd->pMidiParser->setVolume(pSnd->volume);
if (pSnd->status == kSoundStopped)
pSnd->pMidiParser->jumpToTick(0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list