aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-10-29 17:13:16 -0700
committerEugene Sandulenko2016-10-29 17:13:38 -0700
commit9caee8cbe3dd95022d0d5f520625848c4dfdd230 (patch)
tree882322400fea893dfbea2febd24396ff0f62584e
parent6d2fd12bb4e47939604cc601ecb053fc811e0d6b (diff)
downloadscummvm-rg350-9caee8cbe3dd95022d0d5f520625848c4dfdd230.tar.gz
scummvm-rg350-9caee8cbe3dd95022d0d5f520625848c4dfdd230.tar.bz2
scummvm-rg350-9caee8cbe3dd95022d0d5f520625848c4dfdd230.zip
DIRECTOR Implement CASt member loading
-rw-r--r--engines/director/score.cpp63
1 files changed, 63 insertions, 0 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 4519bfd71a..a197d0e304 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) {