aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstevenhoefel2017-01-16 10:13:50 +1100
committerstevenhoefel2017-01-16 10:13:50 +1100
commit37469a45c42cf53ba183754a0708957cf686b516 (patch)
treefa2a9d346d375deb9462f52ad0e6170361913f5a
parent9f5004ceda75e17e4d42e4fc57979c26c8679902 (diff)
downloadscummvm-rg350-37469a45c42cf53ba183754a0708957cf686b516.tar.gz
scummvm-rg350-37469a45c42cf53ba183754a0708957cf686b516.tar.bz2
scummvm-rg350-37469a45c42cf53ba183754a0708957cf686b516.zip
DIRECTOR: Correctly parse STXT runs to determine formatting.
-rw-r--r--engines/director/frame.cpp32
1 files changed, 17 insertions, 15 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 47cf0b4be1..4a478de884 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -824,21 +824,23 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo
if (strLen < 200)
debugC(3, kDebugText, "text: '%s'", text.c_str());
- uint16 a = textStream->readUint16();
- uint32 b = textStream->readUint32();
- uint16 c = textStream->readUint16();
- uint16 d = textStream->readUint16();
-
- debugC(3, kDebugText, "text: a: %x b: %x c: %x d: %x", a, b, c, d);
-
- textCast->fontId = textStream->readUint16();
- textCast->textSlant = textStream->readByte();
- textStream->readByte();
- textCast->fontSize = textStream->readUint16();
-
- textCast->palinfo1 = textStream->readUint16();
- textCast->palinfo2 = textStream->readUint16();
- textCast->palinfo3 = textStream->readUint16();
+ uint16 formattingCount = textStream->readUint16();
+ while (formattingCount) {
+ uint32 formatStartOffset = textStream->readUint32();
+ textStream->readUint16();
+ textStream->readUint16();
+
+ textCast->fontId = textStream->readUint16();
+ textCast->textSlant = textStream->readByte();
+ textStream->readByte();
+ textCast->fontSize = textStream->readUint16();
+
+ textCast->palinfo1 = textStream->readUint16();
+ textCast->palinfo2 = textStream->readUint16();
+ textCast->palinfo3 = textStream->readUint16();
+
+ formattingCount--;
+ }
uint16 boxShadow = (uint16)textCast->boxShadow;
uint16 borderSize = (uint16)textCast->borderSize;