aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/cast.cpp22
-rw-r--r--engines/director/cast.h4
-rw-r--r--engines/director/types.h6
3 files changed, 13 insertions, 19 deletions
diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index a38674441a..825c3b2093 100644
--- a/engines/director/cast.cpp
+++ b/engines/director/cast.cpp
@@ -117,7 +117,8 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_gutterSize = kSizeNone;
_boxShadow = kSizeNone;
- _flags1 = 0;
+ _flags = 0;
+ _textFlags = 0;
_fontId = 0;
_fontSize = 12;
_textType = kTextTypeFixed;
@@ -127,7 +128,7 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
_palinfo1 = _palinfo2 = _palinfo3 = 0;
if (version <= 3) {
- _flags1 = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
+ _flags = stream.readByte(); // region: 0 - auto, 1 - matte, 2 - disabled
_borderSize = static_cast<SizeType>(stream.readByte());
_gutterSize = static_cast<SizeType>(stream.readByte());
_boxShadow = static_cast<SizeType>(stream.readByte());
@@ -141,7 +142,6 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
uint16 pad3;
uint16 pad4 = 0;
uint16 totalTextHeight;
- byte flags = 0;
if (version == 2) {
pad2 = stream.readUint16();
@@ -153,15 +153,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
pad3 = stream.readUint16();
_textShadow = static_cast<SizeType>(stream.readByte());
- 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("Unprocessed text cast flags: %x", flags & 0xf8);
+ _textFlags = stream.readByte();
+ if (_textFlags & 0xf8)
+ warning("Unprocessed text cast flags: %x", _textFlags & 0xf8);
totalTextHeight = stream.readUint16();
} else {
@@ -173,9 +167,9 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) {
}
debugC(2, kDebugLoading, "TextCast(): flags1: %d, border: %d gutter: %d shadow: %d pad1: %x align: %04x",
- _flags1, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign);
+ _flags, _borderSize, _gutterSize, _boxShadow, pad1, _textAlign);
debugC(2, kDebugLoading, "TextCast(): rgb: 0x%04x 0x%04x 0x%04x, pad2: %x pad3: %d pad4: %d shadow: %d flags: %d totHeight: %d",
- _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, flags, totalTextHeight);
+ _palinfo1, _palinfo2, _palinfo3, pad2, pad3, pad4, _textShadow, _textFlags, totalTextHeight);
if (debugChannelSet(2, kDebugLoading)) {
_initialRect.debugPrint(2, "TextCast(): rect:");
}
diff --git a/engines/director/cast.h b/engines/director/cast.h
index 03767ecea2..3d8db523c7 100644
--- a/engines/director/cast.h
+++ b/engines/director/cast.h
@@ -92,14 +92,14 @@ public:
SizeType _gutterSize;
SizeType _boxShadow;
- byte _flags1;
+ byte _flags;
uint32 _fontId;
uint16 _fontSize;
TextType _textType;
TextAlignType _textAlign;
SizeType _textShadow;
byte _textSlant;
- Common::Array<TextFlag> _textFlags;
+ byte _textFlags;
uint16 _palinfo1, _palinfo2, _palinfo3;
Common::String _ftext;
diff --git a/engines/director/types.h b/engines/director/types.h
index 4a203f9f73..0a170ffc23 100644
--- a/engines/director/types.h
+++ b/engines/director/types.h
@@ -71,9 +71,9 @@ enum TextAlignType {
};
enum TextFlag {
- kTextFlagEditable,
- kTextFlagAutoTab,
- kTextFlagDoNotWrap
+ kTextFlagEditable = (1 << 0),
+ kTextFlagAutoTab = (1 << 1),
+ kTextFlagDoNotWrap = (1 << 2)
};
enum SizeType {