aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/resource_audio.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2010-08-02 18:30:37 +0000
committerMatthew Hoops2010-08-02 18:30:37 +0000
commitbed1e3c164771f4108ebab3d5aaf688e29e8118f (patch)
tree12a0c66ad33aa03970e9f4efe07d59378a8d036c /engines/sci/resource_audio.cpp
parent9c8b4655053063fcdd5311ee0e5df5a4bd19cf92 (diff)
downloadscummvm-rg350-bed1e3c164771f4108ebab3d5aaf688e29e8118f.tar.gz
scummvm-rg350-bed1e3c164771f4108ebab3d5aaf688e29e8118f.tar.bz2
scummvm-rg350-bed1e3c164771f4108ebab3d5aaf688e29e8118f.zip
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. svn-id: r51646
Diffstat (limited to 'engines/sci/resource_audio.cpp')
-rw-r--r--engines/sci/resource_audio.cpp39
1 files changed, 39 insertions, 0 deletions
diff --git a/engines/sci/resource_audio.cpp b/engines/sci/resource_audio.cpp
index 08e05f5ccd..2c7a63b363 100644
--- a/engines/sci/resource_audio.cpp
+++ b/engines/sci/resource_audio.cpp
@@ -235,6 +235,20 @@ void ResourceManager::removeAudioResource(ResourceId resId) {
// 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 @@ int ResourceManager::readAudioMapSCI11(ResourceSource *map) {
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);