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

kirben at users.sourceforge.net kirben at users.sourceforge.net
Sat Mar 18 20:56:07 CET 2006


Revision: 21374
Author:   kirben
Date:     2006-03-18 20:55:34 -0800 (Sat, 18 Mar 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21374&view=rev

Log Message:
-----------
Move the sound loop detection, so it is used by all HE70+ games

Modified Paths:
--------------
    scummvm/trunk/engines/scumm/he/sound_he.cpp
Modified: scummvm/trunk/engines/scumm/he/sound_he.cpp
===================================================================
--- scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-03-19 04:41:43 UTC (rev 21373)
+++ scummvm/trunk/engines/scumm/he/sound_he.cpp	2006-03-19 04:55:34 UTC (rev 21374)
@@ -370,11 +370,11 @@
 			strcpy(buf, buf1);
 		}
 		if (musicFile.open(buf) == false) {
-			warning("playSound: Can't open music file %s", buf);
+			warning("playHESound: Can't open music file %s", buf);
 			return;
 		}
 		if (!getHEMusicDetails(soundID, music_offs, size)) {
-			debug(0, "playSound: musicID %d not found", soundID);
+			debug(0, "playHESound: musicID %d not found", soundID);
 			return;
 		}
 
@@ -402,11 +402,6 @@
 		return;
 	}
 
-	// TODO: Extra sound flags
-	if (heFlags & 1) {
-		flags |= Audio::Mixer::FLAG_LOOP;
-	}
-
 	// Support for sound in later Backyard sports games
 	if (READ_BE_UINT32(ptr) == MKID_BE('RIFF') || READ_BE_UINT32(ptr) == MKID_BE('WSOU')) {
 		uint16 compType;
@@ -420,7 +415,7 @@
 		Common::MemoryReadStream stream(ptr, size);
 
 		if (!loadWAVFromStream(stream, size, rate, flags, &compType, &blockAlign)) {
-			error("playSound: Not a valid WAV file");
+			error("playHESound: Not a valid WAV file (%d)", soundID);
 		}
 
 		if (compType == 17) {
@@ -435,6 +430,12 @@
 			sound = (char *)malloc(size);
 			memcpy(sound, ptr + stream.pos(), size);
 		}
+
+		// TODO: Extra sound flags
+		if (heFlags & 1) {
+			flags |= Audio::Mixer::FLAG_LOOP;
+		}
+
 		_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
 		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID, 255, 0, 0,0, type);
 	}
@@ -466,7 +467,6 @@
 		size = READ_BE_UINT32(ptr + 4) - 8;
 		if (heOffset < 0 || heOffset > size) {
 			// Occurs when making fireworks in puttmoon
-			debug(0, "playSound: Invalid sound offset (offset %d, size %d) in sound %d", heOffset, size, soundID);
 			heOffset = 0;
 		}
 		size -= heOffset;
@@ -477,6 +477,11 @@
 			_overrideFreq = 0;
 		}
 
+		// TODO: Extra sound flags
+		if (heFlags & 1) {
+			flags |= Audio::Mixer::FLAG_LOOP;
+		}
+
 		_vm->_mixer->stopHandle(_heSoundChannels[heChannel]);
 		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], ptr + heOffset + 8, size, rate, flags, soundID, 255, 0, 0,0, type);
 


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