aboutsummaryrefslogtreecommitdiff
path: root/engines/director/cast.cpp
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-30 13:16:10 +0100
committerEugene Sandulenko2019-12-30 13:16:10 +0100
commit6810957e6db2e9f72170edbebfb11830fe519019 (patch)
treede673194832c5d3d3a4d9618f473c5843d1ace76 /engines/director/cast.cpp
parentb6d73f54dd2c888a5ef575e6e333dc7dac2078fe (diff)
downloadscummvm-rg350-6810957e6db2e9f72170edbebfb11830fe519019.tar.gz
scummvm-rg350-6810957e6db2e9f72170edbebfb11830fe519019.tar.bz2
scummvm-rg350-6810957e6db2e9f72170edbebfb11830fe519019.zip
DIRECTOR: Simplified cast management
Diffstat (limited to 'engines/director/cast.cpp')
-rw-r--r--engines/director/cast.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index e7f30d8461..6e87c7a6de 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -31,6 +31,8 @@
namespace Director {
BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16 version) {
+ _type = kCastBitmap;
+
if (version < 4) {
_pitch = 0;
_flags = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
@@ -106,6 +108,8 @@ BitmapCast::BitmapCast(Common::ReadStreamEndian &stream, uint32 castTag, uint16
}
TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
+ _type = kCastText;
+
_borderSize = kSizeNone;
_gutterSize = kSizeNone;
_boxShadow = kSizeNone;
@@ -260,6 +264,8 @@ void TextCast::setText(const char *text) {
}
ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
+ _type = kCastShape;
+
byte flags, unk1;
_ink = kInkTypeCopy;
@@ -300,6 +306,8 @@ ShapeCast::ShapeCast(Common::ReadStreamEndian &stream, uint16 version) {
}
ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) {
+ _type = kCastButton;
+
if (version < 4) {
_buttonType = static_cast<ButtonType>(stream.readUint16BE());
} else {
@@ -316,6 +324,8 @@ ButtonCast::ButtonCast(Common::ReadStreamEndian &stream, uint16 version) : TextC
}
ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
+ _type = kCastLingoScript;
+
if (version < 4) {
error("Unhandled Script cast");
} else if (version == 4) {
@@ -347,4 +357,21 @@ ScriptCast::ScriptCast(Common::ReadStreamEndian &stream, uint16 version) {
_modified = 0;
}
+RTECast::RTECast(Common::ReadStreamEndian &stream, uint16 version) : TextCast(stream, version) {
+
+ _type = kCastRTE;
+}
+
+void RTECast::loadChunks() {
+ //TODO: Actually load RTEs correctly, don't just make fake STXT.
+#if 0
+ Common::SeekableReadStream *rte1 = _movieArchive->getResource(res->children[child].tag, res->children[child].index);
+ byte *buffer = new byte[rte1->size() + 2];
+ rte1->read(buffer, rte1->size());
+ buffer[rte1->size()] = '\n';
+ buffer[rte1->size() + 1] = '\0';
+ _loadedText->getVal(id)->importRTE(buffer);
+#endif
+}
+
} // End of namespace Director