[Scummvm-git-logs] scummvm master -> 9caee8cbe3dd95022d0d5f520625848c4dfdd230

sev- sev at scummvm.org
Sun Oct 30 02:13:45 CEST 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:
9caee8cbe3 DIRECTOR Implement CASt member loading


Commit: 9caee8cbe3dd95022d0d5f520625848c4dfdd230
    https://github.com/scummvm/scummvm/commit/9caee8cbe3dd95022d0d5f520625848c4dfdd230
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2016-10-29T17:13:38-07:00

Commit Message:
DIRECTOR Implement CASt member loading

Changed paths:
    engines/director/score.cpp



diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 4519bfd..a197d0e 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -393,6 +393,69 @@ void Score::loadCastDataD2(Common::SeekableSubReadStreamEndian &stream) {
 }
 
 void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id) {
+	// d4+ variant
+	if (stream.size() == 0)
+		return;
+
+	if (stream.size() < 26) {
+		warning("CAST data id %d is too small", id);
+		return;
+	}
+
+	uint castId = id - 1024;
+
+	uint32 size1, size2, size3, castType;
+	byte blob[3];
+
+	if (_vm->getVersion() < 5) {
+		size1 = stream.readUint16();
+		size2 = stream.readUint32();
+		size3 = 0;
+		castType = stream.readByte();
+		stream.read(blob, 3);
+	} else {
+		// FIXME: only the cast type and the strings are good
+		castType = stream.readUint32();
+		size2 = stream.readUint32();
+		size3 = stream.readUint32();
+		size1 = stream.readUint32();
+		assert(size1 == 0x14);
+		size1 = 0;
+		blob[0] = blob[1] = blob[2] = 0;
+	}
+
+	warning("type: %x", castType);
+
+	Score::readRect(stream);
+	Score::readRect(stream);
+
+	//member.initialRect = readRect(data)
+	//member.boundingRect = readRect(data)
+	//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);
+
+		CastInfo *ci = new CastInfo();
+
+		ci->script = castStrings[0];
+		ci->name = castStrings[1];
+		ci->directory = castStrings[2];
+		ci->fileName = castStrings[3];
+		ci->type = castStrings[4];
+
+		_castsInfo[id] = ci;
+	}
+
+	if (size3)
+		warning("size3: %x", size3);
 }
 
 void Score::loadLabels(Common::SeekableSubReadStreamEndian &stream) {





More information about the Scummvm-git-logs mailing list