[Scummvm-cvs-logs] CVS: scummvm/scumm/imuse_digi dimuse.cpp,1.60,1.61 dimuse_sndmgr.cpp,1.28,1.29 dimuse_sndmgr.h,1.21,1.22

Pawel Kolodziejski aquadran at users.sourceforge.net
Thu Apr 8 14:27:12 CEST 2004


Update of /cvsroot/scummvm/scummvm/scumm/imuse_digi
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14246

Modified Files:
	dimuse.cpp dimuse_sndmgr.cpp dimuse_sndmgr.h 
Log Message:
fix for region code

Index: dimuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse.cpp,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- dimuse.cpp	6 Apr 2004 19:46:42 -0000	1.60
+++ dimuse.cpp	8 Apr 2004 21:13:24 -0000	1.61
@@ -222,21 +222,21 @@
 		return;
 	}
 
-	int jumpId = _sound->getJumpIdByRegionAndHookId(_track[track].soundHandle, _track[track].curRegion, _track[track].curHookId);
+	int jumpId = _sound->getJumpIdByRegion(_track[track].soundHandle, _track[track].curRegion);
 	if (jumpId != -1) {
 		int region = _sound->getRegionIdByJumpId(_track[track].soundHandle, jumpId);
-		if (region != -1) {
-			int sampleHookId = _sound->getJumpHookId(_track[track].soundHandle, jumpId);
-			if (sampleHookId != 0) {
-				if (_track[track].curHookId == sampleHookId) {
-					_track[track].curRegion = region;
-					debug(5, "switchToNextRegion-sound(%d) jump to %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId);
-					_track[track].curHookId = 0;
-				}
-			} else {
+		assert(region != -1);
+		int sampleHookId = _sound->getJumpHookId(_track[track].soundHandle, jumpId);
+		assert(sampleHookId != -1);
+		if (sampleHookId != 0) {
+			if (_track[track].curHookId == sampleHookId) {
 				_track[track].curRegion = region;
 				debug(5, "switchToNextRegion-sound(%d) jump to %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId);
+				_track[track].curHookId = 0;
 			}
+		} else {
+			_track[track].curRegion = region;
+			debug(5, "switchToNextRegion-sound(%d) jump to %d region, curHookId: %d", _track[track].soundId, _track[track].curRegion, _track[track].curHookId);
 		}
 	}
 

Index: dimuse_sndmgr.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_sndmgr.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- dimuse_sndmgr.cpp	6 Apr 2004 19:46:43 -0000	1.28
+++ dimuse_sndmgr.cpp	8 Apr 2004 21:13:25 -0000	1.29
@@ -395,13 +395,12 @@
 	return soundHandle->region[region].offset;
 }
 
-int ImuseDigiSndMgr::getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId) {
+int ImuseDigiSndMgr::getJumpIdByRegion(soundStruct *soundHandle, int region) {
 	assert(soundHandle && checkForProperHandle(soundHandle));
 	assert(region >= 0 && region < soundHandle->numRegions);
 	for (int l = 0; l < soundHandle->numJumps; l++) {
 		if (soundHandle->jump[l].offset == soundHandle->region[region].offset) {
-			if (soundHandle->jump[l].hookId == hookId)
-				return l;
+			return l;
 		}
 	}
 	

Index: dimuse_sndmgr.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse_digi/dimuse_sndmgr.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- dimuse_sndmgr.h	6 Apr 2004 19:46:43 -0000	1.21
+++ dimuse_sndmgr.h	8 Apr 2004 21:13:25 -0000	1.22
@@ -115,7 +115,7 @@
 	int getNumRegions(soundStruct *soundHandle);
 	int getNumJumps(soundStruct *soundHandle);
 	int getRegionOffset(soundStruct *soundHandle, int region);
-	int getJumpIdByRegionAndHookId(soundStruct *soundHandle, int region, int hookId);
+	int getJumpIdByRegion(soundStruct *soundHandle, int region);
 	int getRegionIdByJumpId(soundStruct *soundHandle, int jumpId);
 	int getJumpHookId(soundStruct *soundHandle, int number);
 	int getJumpFade(soundStruct *soundHandle, int number);





More information about the Scummvm-git-logs mailing list