Permalink
Browse files
DIRECTOR: Correctly return TextCast rectangle for D2/3.
- Loading branch information
Showing
with
17 additions
and
6 deletions.
-
+15
−4
engines/director/cast.cpp
-
+2
−2
engines/director/frame.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<SizeType>(stream.readByte()); |
|
|
byte flags = stream.readByte(); |
|
|
if (flags & 0x1) |
|
|
|
|
|
@@ -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; |
|
|
|
This warning and comment looks a bit off here, since this code branch is not for D2