[Scummvm-cvs-logs] CVS: scummvm/scumm sound.cpp,1.494,1.495 sound_he.cpp,2.6,2.7

kirben kirben at users.sourceforge.net
Thu Jan 5 03:39:04 CET 2006


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

Modified Files:
	sound.cpp sound_he.cpp 
Log Message:

Fix sound resource loading in HE games.
The main resource header and size was been cut off in some cases.


Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.494
retrieving revision 1.495
diff -u -d -r1.494 -r1.495
--- sound.cpp	5 Jan 2006 07:49:49 -0000	1.494
+++ sound.cpp	5 Jan 2006 11:38:45 -0000	1.495
@@ -1267,7 +1267,6 @@
 
 	case MKID('Mac1'):
 	case MKID('RIFF'):
-	case MKID('HSHD'):
 	case MKID('TALK'):
 	case MKID('DIGI'):
 	case MKID('Crea'):
@@ -1279,6 +1278,15 @@
 		//dumpResource("sound-", idx, ptr);
 		return 1;
 
+	case MKID('HSHD'):
+		// HE sound type without SOUN header
+		_fileHandle->seek(-16, SEEK_CUR);
+		total_size = max_total_size + 8;
+		ptr = res.createResource(type, idx, total_size);
+		_fileHandle->read(ptr, total_size - 8);
+		//dumpResource("sound-", idx, ptr);
+		return 1;
+
 	case MKID('FMUS'): {
 		// Used in 3DO version of puttputt joins the parade and probably others
 		// Specifies a separate file to be used for music from what I gather.

Index: sound_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound_he.cpp,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- sound_he.cpp	5 Jan 2006 09:27:02 -0000	2.6
+++ sound_he.cpp	5 Jan 2006 11:38:45 -0000	2.7
@@ -398,19 +398,13 @@
 		_vm->_mixer->playRaw(&_heSoundChannels[heChannel], sound, size, rate, flags, soundID);
 	}
 	// Support for sound in Humongous Entertainment games
-	else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK') || READ_UINT32(ptr) == MKID('HSHD')) {
+	else if (READ_UINT32(ptr) == MKID('DIGI') || READ_UINT32(ptr) == MKID('TALK')) {
 		byte *sndPtr = ptr;
 		int priority;
 
-		if (READ_UINT32(ptr) == MKID('HSHD')) {
-			priority = READ_LE_UINT16(ptr + 10);
-			rate = READ_LE_UINT16(ptr + 14);
-			ptr += READ_BE_UINT32(ptr + 4);
-		} else {
-			priority = READ_LE_UINT16(ptr + 18);
-			rate = READ_LE_UINT16(ptr + 22);
-			ptr += 8 + READ_BE_UINT32(ptr + 12);
-		}
+		priority = READ_LE_UINT16(ptr + 18);
+		rate = READ_LE_UINT16(ptr + 22);
+		ptr += 8 + READ_BE_UINT32(ptr + 12);
 
 		if (_vm->_mixer->isSoundHandleActive(_heSoundChannels[heChannel])) {
 			int curSnd = _heChannel[heChannel].sound;
@@ -498,8 +492,11 @@
 
 	_sfxMode |= 2;
 	_vm->res.nukeResource(rtSound, 1);
+
 	_sfxFile->seek(offset + 4, SEEK_SET);
-	 size = _sfxFile->readUint32BE() - 8;
+	 size = _sfxFile->readUint32BE();
+	_sfxFile->seek(offset, SEEK_SET);
+
 	_vm->res.createResource(rtSound, 1, size);
 	ptr = _vm->getResourceAddress(rtSound, 1);
 	_sfxFile->read(ptr, size);





More information about the Scummvm-git-logs mailing list