[Scummvm-cvs-logs] CVS: scummvm sound.cpp,1.109,1.110

James Brown ender at users.sourceforge.net
Thu Jul 25 08:38:02 CEST 2002


Update of /cvsroot/scummvm/scummvm
In directory usw-pr-cvs1:/tmp/cvs-serv20399

Modified Files:
	sound.cpp 
Log Message:
Add Zak256 sound



Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -d -r1.109 -r1.110
--- sound.cpp	24 Jul 2002 09:38:42 -0000	1.109
+++ sound.cpp	25 Jul 2002 15:37:31 -0000	1.110
@@ -221,7 +221,32 @@
 		return;
 	}
 
-	if ((_features & GF_OLD256) || (_gameId == GID_MONKEY_VGA))
+	if ((_features & GF_OLD256) && (ptr != NULL)) {
+		char *sound;
+		int size = READ_LE_UINT32(ptr);
+		ptr+=0x16;
+
+		if (size == 30) {
+#ifdef COMPRESSED_SOUND_FILE
+        	        if (playMP3CDTrack(*ptr, 0, 0, 0) == -1)
+#endif
+	                _system->play_cdrom(*ptr, 0, 0, 0);
+			return;
+		}
+
+		sound = (char*)malloc(size-0x36);
+		for (int x=0; x<(size-0x36); x++) {
+			int bit = *ptr++;
+			if (bit<0x80) sound[x] = 0x7F-bit; else sound[x] = bit;
+		}
+
+		// FIXME: Something in the header signifies looping. Need to track it down and add a 
+		//	  mixer flag or something.
+		_mixer->play_raw(NULL, sound, size-0x36, 11000, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE);
+		return;
+	}
+
+	if (_gameId == GID_MONKEY_VGA)
 		return;											/* FIXME */
 
 	if (se) {





More information about the Scummvm-git-logs mailing list