From 37469a45c42cf53ba183754a0708957cf686b516 Mon Sep 17 00:00:00 2001 From: stevenhoefel Date: Mon, 16 Jan 2017 10:13:50 +1100 Subject: DIRECTOR: Correctly parse STXT runs to determine formatting. --- engines/director/frame.cpp | 32 +++++++++++++++++--------------- 1 file 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; -- cgit v1.2.3