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

sev- sev at scummvm.org
Tue Nov 8 10:51:06 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:
b0f30906df DIRECTOR: More debug output to CASt resource loading


Commit: b0f30906df2e96342f976f09a376b5b5022e37d5
    https://github.com/scummvm/scummvm/commit/b0f30906df2e96342f976f09a376b5b5022e37d5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-11-08T10:50:52+01:00

Commit Message:
DIRECTOR: More debug output to CASt resource loading

Changed paths:
    engines/director/archive.cpp
    engines/director/score.cpp
    engines/director/score.h



diff --git a/engines/director/archive.cpp b/engines/director/archive.cpp
index 5102b7f..6e1da0c 100644
--- a/engines/director/archive.cpp
+++ b/engines/director/archive.cpp
@@ -421,7 +421,7 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
 			uint32 index = casStream.readUint32();
 
 			const Resource &res = resources[index];
-			_types[MKTAG('C', 'A', 'S', 't')][index] = res;
+			_types[MKTAG('C', 'A', 'S', 't')][i + 1] = res;
 
 			debugCN(2, kDebugLoading, "%d ", index);
 		}
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index c1b5589..181ed9a 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -392,17 +392,20 @@ void Score::loadCastDataD2(Common::SeekableSubReadStreamEndian &stream) {
 	}
 }
 
-void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id) {
+void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 castId) {
 	// d4+ variant
 	if (stream.size() == 0)
 		return;
 
 	if (stream.size() < 26) {
-		warning("CAST data id %d is too small", id);
+		warning("CAST data id %d is too small", castId);
 		return;
 	}
 
-	uint castId = id - 1024;
+	debugC(3, kDebugLoading, "CASt: id: %d", castId);
+
+	if (debugChannelSet(5, kDebugLoading))
+		stream.hexdump(stream.size());
 
 	uint32 size1, size2, size3, castType;
 	byte blob[3];
@@ -424,7 +427,32 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
 		blob[0] = blob[1] = blob[2] = 0;
 	}
 
-	warning("type: %x", castType);
+	debugC(3, kDebugLoading, "CASt: id: %d type: %x size1: %d size2: %d (%x) size3: %d", castId, castType, size1, size2, size2, size3);
+
+#if 0
+	switch (castType) {
+	case kCastBitmap:
+		_casts[id] = new BitmapCast(stream);
+		_casts[id]->type = kCastBitmap;
+		break;
+	case kCastText:
+		_casts[id] = new TextCast(stream);
+		_casts[id]->type = kCastText;
+		break;
+	case kCastShape:
+		_casts[id] = new ShapeCast(stream);
+		_casts[id]->type = kCastShape;
+		break;
+	case kCastButton:
+		_casts[id] = new ButtonCast(stream);
+		_casts[id]->type = kCastButton;
+		break;
+	default:
+		warning("Unhandled cast type: %d", castType);
+		stream.skip(size - 1);
+		break;
+	}
+#endif
 
 	Score::readRect(stream);
 	Score::readRect(stream);
@@ -434,14 +462,18 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
 	//member.regX = 0 // FIXME: HACK
 	//member.regY = 0 // FIXME: HACK
 
-	byte *data = (byte *)calloc(size1, 1);
-	stream.read(data, size1);
-	Common::hexdump(data, size1);
-	free(data);
-
 	if (size2) {
 		uint32 entryType = 0;
-		Common::Array<Common::String> castStrings = loadStrings(stream, entryType);
+		Common::Array<Common::String> castStrings = loadStrings(stream, entryType, false);
+
+		debugCN(4, kDebugLoading, "str(%d): '", castStrings.size());
+
+		for (uint i = 0; i < castStrings.size(); i++) {
+			debugCN(4, kDebugLoading, "%s'", castStrings[i].c_str());
+			if (i != castStrings.size() - 1)
+				debugCN(4, kDebugLoading, ", '");
+		}
+		debugC(4, kDebugLoading, "'");
 
 		CastInfo *ci = new CastInfo();
 
@@ -451,7 +483,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
 		ci->fileName = castStrings[3];
 		ci->type = castStrings[4];
 
-		_castsInfo[id] = ci;
+		_castsInfo[castId] = ci;
 	}
 
 	if (size3)
diff --git a/engines/director/score.h b/engines/director/score.h
index 5721532..a60f2d7 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -42,16 +42,16 @@ class Sprite;
 
 enum CastType {
 	kCastBitmap = 1,
-	kCastFilmLoop,
-	kCastText,
-	kCastPalette,
-	kCastPicture,
-	kCastSound,
-	kCastButton,
-	kCastShape,
-	kCastMovie,
-	kCastDigitalVideo,
-	kCastScript
+	kCastFilmLoop = 2,
+	kCastText = 3,
+	kCastPalette = 4,
+	kCastPicture = 5,
+	kCastSound = 6,
+	kCastButton = 7,
+	kCastShape = 8,
+	kCastMovie = 9,
+	kCastDigitalVideo = 10,
+	kCastScript = 11
 };
 
 enum ScriptType {





More information about the Scummvm-git-logs mailing list