From aafd10d3d1e807b21e064a2be65e85311ed9cc30 Mon Sep 17 00:00:00 2001 From: stevenhoefel Date: Fri, 3 Mar 2017 15:20:59 +1100 Subject: DIRECTOR: Correctly return TextCast rectangle for D2/3. --- engines/director/cast.cpp | 19 +++++++++++++++---- engines/director/frame.cpp | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-) (limited to 'engines/director') diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp index dbfb2c11b4..0f63a96435 100644 --- a/engines/director/cast.cpp +++ b/engines/director/cast.cpp @@ -94,12 +94,23 @@ TextCast::TextCast(Common::ReadStreamEndian &stream, uint16 version) { palinfo2 = stream.readUint16(); palinfo3 = stream.readUint16(); - int t = stream.readUint32(); - if (t != 0) { // In D2 there are values - warning("TextCast: t: %x", t); + if (version == 2) { + int t = stream.readUint16(); + if (t != 0) { // In D2 there are values + warning("TextCast: t: %x", t); + } + + initialRect = Score::readRect(stream); + stream.readUint16(); + } else { + int t = stream.readUint32(); + if (t != 0) { // In D2 there are values + warning("TextCast: t: %x", t); + } + + initialRect = Score::readRect(stream); } - initialRect = Score::readRect(stream); textShadow = static_cast(stream.readByte()); byte flags = stream.readByte(); if (flags & 0x1) diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index df03f998cd..50627d6d16 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -906,8 +906,8 @@ void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteId, Commo int x = _sprites[spriteId]->_startPoint.x; // +rectLeft; int y = _sprites[spriteId]->_startPoint.y; // +rectTop; - int height = _sprites[spriteId]->_height; - int width = _sprites[spriteId]->_width; + int height = _sprites[spriteId]->_cast->initialRect.height(); //_sprites[spriteId]->_height; + int width = _sprites[spriteId]->_cast->initialRect.width(); //_sprites[spriteId]->_width; if (_vm->getVersion() >= 4 && textSize != NULL) width = textCast->initialRect.right; -- cgit v1.2.3