aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2020-01-08 22:11:52 +0100
committerEugene Sandulenko2020-01-08 23:08:13 +0100
commit8b8aebadcb45876027fdc8c80880bb51f7ff1055 (patch)
tree58b7745c721130c4a30677d7e06ae12ac74d4f7b
parent30b9a43a4c60e4edcc8201735c3ad2433ff2dbfb (diff)
downloadscummvm-rg350-8b8aebadcb45876027fdc8c80880bb51f7ff1055.tar.gz
scummvm-rg350-8b8aebadcb45876027fdc8c80880bb51f7ff1055.tar.bz2
scummvm-rg350-8b8aebadcb45876027fdc8c80880bb51f7ff1055.zip
DIRECTOR: Parse script cast types
-rw-r--r--engines/director/cast.cpp17
-rw-r--r--engines/director/cast.h1
-rw-r--r--engines/director/score.cpp5
-rw-r--r--engines/director/types.h5
4 files changed, 21 insertions, 7 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 4537742e19..8e547f0471 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -348,15 +348,26 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
if (version < 4) {
error("Unhandled Script cast");
} else if (version == 4) {
- stream.readByte();
- stream.readByte();
+ byte unk1 = stream.readByte();
+ byte type = stream.readByte();
+
+ switch (type) {
+ case 1:
+ _scriptType = kScoreScript;
+ break;
+ case 3:
+ _scriptType = kMovieScript;
+ break;
+ default:
+ error("ScriptCast: Unprocessed script type: %d", type);
+ }
_initialRect = Score::readRect(stream);
_boundingRect = Score::readRect(stream);
_id = stream.readUint32();
- debugC(4, kDebugLoading, "CASt: Script id: %d", _id);
+ debugC(4, kDebugLoading, "CASt: Script id: %d type: %s (%d) unk1: %d", _id, scriptType2str(_scriptType), type, unk1);
stream.readByte(); // There should be no more data
assert(stream.eos());
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 3e1479d041..5123ef8034 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -124,6 +124,7 @@ public:
ScriptCast(Common::ReadStreamEndian &stream, uint16 version);
uint32 _id;
+ ScriptType _scriptType;
};
class RTECast : public TextCast {
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b81aae701c..533c684677 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -50,7 +50,8 @@ const char *scriptTypes[] = {
"SpriteScript",
"FrameScript",
"CastScript",
- "GlobalScript"
+ "GlobalScript",
+ "ScoreScript"
};
const char *scriptType2str(ScriptType scr) {
@@ -615,7 +616,7 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
// TODO: Determine if there really is a minimum size.
// This value was too small for Shape Casts.
if (stream.size() < 10) {
- warning("Score::loadCastData(): CAST data id %d is too small", id);
+ warning("Score::loadCastData(): CASt data id %d is too small", id);
return;
}
diff --git a/engines/director/types.h b/engines/director/types.h
index 0a170ffc23..4a9bcc8f4a 100644
--- a/engines/director/types.h
+++ b/engines/director/types.h
@@ -42,13 +42,14 @@ enum CastType {
};
enum ScriptType {
+ kNoneScript = -1,
kMovieScript = 0,
kSpriteScript = 1,
kFrameScript = 2,
kCastScript = 3,
kGlobalScript = 4,
- kNoneScript = -1,
- kMaxScriptType = 4 // Sync with score.cpp:45, array scriptTypes[]
+ kScoreScript = 5,
+ kMaxScriptType = 5 // Sync with score.cpp:45, array scriptTypes[]
};
enum ShapeType {