[Scummvm-cvs-logs] SF.net SVN: scummvm:[51646] scummvm/trunk/engines/sci/resource_audio.cpp

mthreepwood at users.sourceforge.net mthreepwood at users.sourceforge.net
Mon Aug 2 20:30:37 CEST 2010


Revision: 51646
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51646&view=rev
Author:   mthreepwood
Date:     2010-08-02 18:30:37 +0000 (Mon, 02 Aug 2010)

Log Message:
-----------
SCI: Fix bug #3037401 - LB2Floppy: No SFX

Laura Bow 2 floppy and Mixed-Up Mother Goose SCI1.1 use an 8-byte entry 0.map format to store their entries.

Modified Paths:
--------------
    scummvm/trunk/engines/sci/resource_audio.cpp

Modified: scummvm/trunk/engines/sci/resource_audio.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource_audio.cpp	2010-08-02 18:30:25 UTC (rev 51645)
+++ scummvm/trunk/engines/sci/resource_audio.cpp	2010-08-02 18:30:37 UTC (rev 51646)
@@ -235,6 +235,20 @@
 // w nEntry
 // tb offset (cumulative)
 
+// QFG3 Demo 0.MAP structure:
+// =========
+// 10-byte entries:
+// w nEntry
+// dw offset
+// dw size
+
+// LB2 Floppy/Mother Goose SCI1.1 0.MAP structure:
+// =========
+// 8-byte entries:
+// w nEntry
+// w 0xffff
+// dw offset
+
 // Early SCI1.1 MAP structure:
 // ===============
 // 10-byte entries:
@@ -318,6 +332,31 @@
 
 			addResource(ResourceId(kResourceTypeAudio, n), src, offset, size);
 		}
+	} else if (map->_volumeNumber == 0 && entrySize == 8 && READ_LE_UINT16(ptr + 2) == 0xffff) {
+		// LB2 Floppy/Mother Goose SCI1.1 format
+		Common::SeekableReadStream *stream = getVolumeFile(src);
+
+		while (ptr < mapRes->data + mapRes->size) {
+			uint16 n = READ_LE_UINT16(ptr);
+			ptr += 4;
+
+			if (n == 0xffff)
+				break;
+
+			offset = READ_LE_UINT32(ptr);
+			ptr += 4;
+
+			// The size is not stored in the map and the entries have no order.
+			// We need to dig into the audio resource in the volume to get the size.
+			stream->seek(offset + 1);
+			byte headerSize = stream->readByte();
+			assert(headerSize == 11 || headerSize == 12);
+			
+			stream->skip(5);
+			uint32 size = stream->readUint32LE() + headerSize + 2;
+
+			addResource(ResourceId(kResourceTypeAudio, n), src, offset, size);
+		}
 	} else {
 		bool isEarly = (entrySize != 11); 
 


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