[Scummvm-cvs-logs] SF.net SVN: scummvm: [25863] scummvm/trunk/engines/scumm/he/cup_player_he. cpp

cyx at users.sourceforge.net cyx at users.sourceforge.net
Sun Feb 25 20:15:03 CET 2007


Revision: 25863
          http://scummvm.svn.sourceforge.net/scummvm/?rev=25863&view=rev
Author:   cyx
Date:     2007-02-25 11:15:00 -0800 (Sun, 25 Feb 2007)

Log Message:
-----------
fixed background music in catalog_cup_demo_de : only stop sfx if it was started in a previous block

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/cup_player_he.cpp

Modified: scummvm/trunk/engines/scumm/he/cup_player_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/cup_player_he.cpp	2007-02-25 19:10:59 UTC (rev 25862)
+++ scummvm/trunk/engines/scumm/he/cup_player_he.cpp	2007-02-25 19:15:00 UTC (rev 25863)
@@ -128,6 +128,7 @@
 }
 
 void CUP_Player::updateSfx() {
+	int lastSfxChannel = _lastSfxChannel;
 	for (int i = 0; i < _sfxQueuePos; ++i) {
 		const CUP_Sfx *sfx = &_sfxQueue[i];
 		if (sfx->num == -1) {
@@ -148,7 +149,7 @@
 		CUP_SfxChannel *sfxChannel = 0;
 		for (int ch = 0; ch < kSfxChannels; ++ch) {
 			if (!_mixer->isSoundHandleActive(_sfxChannels[ch].handle)) {
-				_lastSfxChannel = ch;
+				lastSfxChannel = ch;
 				sfxChannel = &_sfxChannels[ch];
 				sfxChannel->sfxNum = sfx->num;
 				sfxChannel->flags = sfx->flags;
@@ -156,7 +157,7 @@
 			}
 		}
 		if (sfxChannel) {
-			debug(1, "Start sound %d channel %d flags 0x%X", sfx->num, _lastSfxChannel, sfx->flags);
+			debug(1, "Start sound %d channel %d flags 0x%X", sfx->num, lastSfxChannel, sfx->flags);
 			int sfxIndex = sfxChannel->sfxNum - 1;
 			assert(sfxIndex >= 0 && sfxIndex < _sfxCount);
 			uint32 offset = READ_LE_UINT32(_sfxBuffer + sfxIndex * 4) - 8;
@@ -175,6 +176,7 @@
 			warning("Unable to find a free channel to play sound %d", sfx->num);
 		}
 	}
+	_lastSfxChannel = lastSfxChannel;
 	_sfxQueuePos = 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