[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.214,1.215

Travis Howell kirben at users.sourceforge.net
Mon Sep 1 10:12:06 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv21036/scumm

Modified Files:
	sound.cpp 
Log Message:

Add sound looping for Amiga zak/maniac


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -d -r1.214 -r1.215
--- sound.cpp	1 Sep 2003 13:43:21 -0000	1.214
+++ sound.cpp	1 Sep 2003 17:11:09 -0000	1.215
@@ -459,10 +459,19 @@
 		// Some very basic sound effects support
 		if (READ_BE_UINT16(ptr + 14) == 0x0880) {
 			size = READ_BE_UINT16(ptr + 6);
+			// Not sure if this is correct start point
+			int start = READ_BE_UINT16(ptr + 8);
 			rate = 11000;
 			sound = (char *)malloc(size);
-			memcpy(sound,ptr + 100,size);
-			_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, 127, 0, soundID);
+			memcpy(sound,ptr + start,size);
+
+			// Experimental sound looping support
+			if (start == 98 | start == 96)
+				_scumm->_mixer->playRaw(NULL, sound, size, rate,
+						SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_LOOP, 127, 0, soundID,
+						start,size);
+			else
+				_scumm->_mixer->playRaw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE, 127, 0, soundID);
 			return;
 		}
 	}
@@ -758,7 +767,7 @@
 		_scumm->_imuse->stopSound(a);
 	} else if (_scumm->_playerV2) {
 		_scumm->_playerV2->stopSound (a);
-	} else 	if ((_scumm->_features & GF_AMIGA) && (_scumm->_version == 3)) {
+	} else 	if ((_scumm->_features & GF_AMIGA) && (_scumm->_version <= 3)) {
 		// this handles stopping looped sounds for now
 		_scumm->_mixer->stopID(a);
 	}





More information about the Scummvm-git-logs mailing list