[Scummvm-git-logs] scummvm master -> aafd10d3d1e807b21e064a2be65e85311ed9cc30

stevenhoefel stevenhoefel at hotmail.com
Fri Mar 3 05:21:08 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
aafd10d3d1 DIRECTOR: Correctly return TextCast rectangle for D2/3.


Commit: aafd10d3d1e807b21e064a2be65e85311ed9cc30
    https://github.com/scummvm/scummvm/commit/aafd10d3d1e807b21e064a2be65e85311ed9cc30
Author: stevenhoefel (stevenhoefel at hotmail.com)
Date: 2017-03-03T15:20:59+11:00

Commit Message:
DIRECTOR: Correctly return TextCast rectangle for D2/3.

Changed paths:
    engines/director/cast.cpp
    engines/director/frame.cpp


diff --git a/engines/director/cast.cpp b/engines/director/cast.cpp
index dbfb2c1..0f63a96 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<SizeType>(stream.readByte());
 		byte flags = stream.readByte();
 		if (flags & 0x1)
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index df03f99..50627d6 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;





More information about the Scummvm-git-logs mailing list