aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2016-11-09 18:48:51 +0100
committerEugene Sandulenko2016-11-09 19:06:49 +0100
commitfc1633513d715fbba1c08a4016077aaf5ce3ee5b (patch)
treed575fbffa1a6455050f078d2feb8b7ac6475fa75
parent93b974cc66bd9e334d426561ed08b9aa1aa36758 (diff)
downloadscummvm-rg350-fc1633513d715fbba1c08a4016077aaf5ce3ee5b.tar.gz
scummvm-rg350-fc1633513d715fbba1c08a4016077aaf5ce3ee5b.tar.bz2
scummvm-rg350-fc1633513d715fbba1c08a4016077aaf5ce3ee5b.zip
DIRECTOR: Parse script CASt resources
-rw-r--r--engines/director/cast.cpp23
-rw-r--r--engines/director/cast.h5
-rw-r--r--engines/director/score.cpp3
3 files changed, 18 insertions, 13 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index 2e4e2c9c3f..667fc248ea 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -20,9 +20,7 @@
*
*/
-#include "common/array.h"
-#include "common/hashmap.h"
-
+#include "director/director.h"
#include "director/cast.h"
#include "director/score.h"
@@ -45,8 +43,8 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint16 version) {
} else {
initialRect = Score::readRect(stream);
boundingRect = Score::readRect(stream);
- regX = 0; // FIXME: HACK
- regY = 0; // FIXME: HACK
+ regX = stream.readUint16();
+ regY = stream.readUint16();
}
modified = 0;
}
@@ -83,7 +81,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
fontSize = stream.readByte();
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
}
modified = 0;
@@ -103,7 +101,7 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
lineDirection = stream.readByte();
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
}
modified = 0;
}
@@ -113,7 +111,7 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC
buttonType = static_cast<ButtonType>(stream.readUint16BE());
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
}
modified = 0;
}
@@ -123,7 +121,14 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
error("Unhandled Script cast");
} else {
initialRect = Score::readRect(stream);
- //boundingRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
+
+ id = stream.readUint32();
+
+ debugC(4, kDebugLoading, "CASt: Script id: %d", id);
+
+ stream.readByte(); // There should be no more data
+ assert(stream.eos());
}
modified = 0;
}
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 82651a757f..69edf8ce89 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -45,13 +45,14 @@ enum CastType {
struct Cast {
CastType type;
Common::Rect initialRect;
+ Common::Rect boundingRect;
+
byte modified;
};
struct BitmapCast : Cast {
BitmapCast(Common::ReadStreamEndian &stream, uint16 version = 2);
- Common::Rect boundingRect;
uint16 regX;
uint16 regY;
uint8 flags;
@@ -136,6 +137,8 @@ struct ButtonCast : TextCast {
struct ScriptCast : Cast {
ScriptCast(Common::ReadStreamEndian &stream, uint16 version = 2);
+
+ uint32 id;
};
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index f2cd673480..294b865e70 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -463,9 +463,6 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id)
_casts[id]->type = kCastButton;
break;
case kCastScript:
- warning("CASt: Script");
- Common::hexdump(data, size1 + 16);
-
_casts[id] = new ScriptCast(castStream, _vm->getVersion());
_casts[id]->type = kCastScript;
break;