[Scummvm-git-logs] scummvm master -> f6f50e6ba0b607bf4c3108dd2feddefed0d8aa6a

sev- sev at scummvm.org
Mon Nov 7 19:53:36 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
f6f50e6ba0 DIRECTOR: Fixed CASt resource loading in RIFX archives


Commit: f6f50e6ba0b607bf4c3108dd2feddefed0d8aa6a
    https://github.com/scummvm/scummvm/commit/f6f50e6ba0b607bf4c3108dd2feddefed0d8aa6a
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-07T19:53:07+01:00

Commit Message:
DIRECTOR: Fixed CASt resource loading in RIFX archives

Changed paths:
    engines/director/archive.cpp



diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index b3e2426..5102b7f 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -410,17 +410,20 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
 	}
 
 	// Parse the CAS*, if present
-	Common::Array<uint32> casEntries;
 	if (casRes) {
 		Common::SeekableSubReadStreamEndian casStream(stream, casRes->offset + 8, casRes->offset + 8 + casRes->size, _isBigEndian, DisposeAfterUse::NO);
-		casEntries.resize(casRes->size / 4);
 
-		debugCN(2, kDebugLoading, "CAS*: %d [", casEntries.size());
+		uint casSize = casRes->size / 4;
 
-		for (uint32 i = 0; i < casEntries.size(); i++) {
-			casEntries[i] = casStream.readUint32();
+		debugCN(2, kDebugLoading, "CAS*: %d [", casSize);
 
-			debugCN(2, kDebugLoading, "%d ", casEntries[i]);
+		for (uint i = 0; i < casSize; i++) {
+			uint32 index = casStream.readUint32();
+
+			const Resource &res = resources[index];
+			_types[MKTAG('C', 'A', 'S', 't')][index] = res;
+
+			debugCN(2, kDebugLoading, "%d ", index);
 		}
 		debugC(2, kDebugLoading, "]");
 	}
@@ -441,16 +444,6 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
 
 		debugC(2, kDebugLoading, "KEY*: index: %d id: %d resTag: %s", index, id, tag2str(resTag));
 
-		// Handle CAS*/CASt nonsense
-		if (resTag == MKTAG('C', 'A', 'S', 't')) {
-			for (uint32 j = 0; j < casEntries.size(); j++) {
-				if (casEntries[j] == index) {
-					id += j + 1;
-					break;
-				}
-			}
-		}
-
 		const Resource &res = resources[index];
 		debug(3, "Found RIFX resource: '%s' 0x%04x, %d @ 0x%08x (%d)", tag2str(resTag), id, res.size, res.offset, res.offset);
 		_types[resTag][id] = res;





More information about the Scummvm-git-logs mailing list