aboutsummaryrefslogtreecommitdiff
path: root/engines/director/cast.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/director/cast.cpp')
-rw-r--r--engines/director/cast.cpp94
1 files changed, 94 insertions, 0 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
new file mode 100644
index 0000000000..e0d0603ca0
--- /dev/null
+++ b/engines/director/cast.cpp
@@ -0,0 +1,94 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/array.h"
+#include "common/hashmap.h"
+
+#include "director/cast.h"
+#include "director/score.h"
+
+namespace Director {
+
+BitmapCast::BitmapCast(Common::SeekableSubReadStreamEndian &stream) {
+ flags = stream.readByte();
+ someFlaggyThing = stream.readUint16();
+ initialRect = Score::readRect(stream);
+ boundingRect = Score::readRect(stream);
+ regY = stream.readUint16();
+ regX = stream.readUint16();
+ unk1 = unk2 = 0;
+
+ if (someFlaggyThing & 0x8000) {
+ unk1 = stream.readUint16();
+ unk2 = stream.readUint16();
+ }
+ modified = 0;
+}
+
+TextCast::TextCast(Common::SeekableSubReadStreamEndian &stream) {
+ flags1 = stream.readByte();
+ borderSize = static_cast<SizeType>(stream.readByte());
+ gutterSize = static_cast<SizeType>(stream.readByte());
+ boxShadow = static_cast<SizeType>(stream.readByte());
+ textType = static_cast<TextType>(stream.readByte());
+ textAlign = static_cast<TextAlignType>(stream.readUint16());
+ palinfo1 = stream.readUint16();
+ palinfo2 = stream.readUint16();
+ palinfo3 = stream.readUint16();
+
+ int t = stream.readUint32();
+ assert(t == 0); // So far we saw only 0 here
+
+ initialRect = Score::readRect(stream);
+ textShadow = static_cast<SizeType>(stream.readByte());
+ byte flags = stream.readByte();
+ if (flags & 0x1)
+ textFlags.push_back(kTextFlagEditable);
+ if (flags & 0x2)
+ textFlags.push_back(kTextFlagAutoTab);
+ if (flags & 0x4)
+ textFlags.push_back(kTextFlagDoNotWrap);
+ if (flags & 0xf8)
+ warning("Unproxessed text cast flags: %x", flags & 0xf8);
+
+ // TODO: FIXME: guesswork
+ fontId = stream.readByte();
+ fontSize = stream.readByte();
+
+ modified = 0;
+}
+
+ShapeCast::ShapeCast(Common::SeekableSubReadStreamEndian &stream) {
+ /*byte flags = */ stream.readByte();
+ /*unk1 = */ stream.readByte();
+ shapeType = static_cast<ShapeType>(stream.readByte());
+ initialRect = Score::readRect(stream);
+ pattern = stream.readUint16BE();
+ fgCol = stream.readByte();
+ bgCol = stream.readByte();
+ fillType = stream.readByte();
+ lineThickness = stream.readByte();
+ lineDirection = stream.readByte();
+ modified = 0;
+}
+
+} // End of namespace Director