[Scummvm-cvs-logs] SF.net SVN: scummvm:[49028] scummvm/trunk/engines/sci/graphics/ports.cpp

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri May 14 00:04:54 CEST 2010


Revision: 49028
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49028&view=rev
Author:   m_kiewitz
Date:     2010-05-13 22:04:53 +0000 (Thu, 13 May 2010)

Log Message:
-----------
SCI: fix window, when its too large for screen (fixes sq3 crash at ending, actually caused by script bug)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/ports.cpp

Modified: scummvm/trunk/engines/sci/graphics/ports.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.cpp	2010-05-13 21:29:32 UTC (rev 49027)
+++ scummvm/trunk/engines/sci/graphics/ports.cpp	2010-05-13 22:04:53 UTC (rev 49028)
@@ -229,8 +229,17 @@
 	else
 		_windowList.push_back(pwnd);
 	openPort(pwnd);
+
 	r = dims;
-	pwnd->rect = dims;
+	if (r.width() > _screen->getWidth()) {
+		// We get invalid dimensions at least at the end of sq3 (script bug!)
+		warning("fixing too large window, given left&right was %d, %d", dims.left, dims.right);
+		r.left = 0;
+		r.right = _screen->getWidth() - 1;
+		if ((style != _styleUser) && !(style & SCI_WINDOWMGR_STYLE_NOFRAME))
+			r.right--;
+	}
+	pwnd->rect = r;
 	if (restoreRect)
 		pwnd->restoreRect = *restoreRect;
 
@@ -244,7 +253,7 @@
 		pwnd->title = title;
 	}
 
-	r = dims;
+	r = pwnd->rect;
 	if ((style != _styleUser) && !(style & SCI_WINDOWMGR_STYLE_NOFRAME)) {
 		r.grow(1);
 		if (style & SCI_WINDOWMGR_STYLE_TITLE) {
@@ -253,9 +262,6 @@
 		}
 	}
 
-	// FIXME: it seems as if shadows may result in the window getting moved one upwards
-	//         so that the shadow is visible (lsl5)
-
 	pwnd->dims = r;
 	const Common::Rect *wmprect = &_wmgrPort->rect;
 	int16 oldtop = pwnd->dims.top;
@@ -314,9 +320,9 @@
 			_paint16->frameRect(r);// draw actual window frame
 
 			if (wndStyle & SCI_WINDOWMGR_STYLE_TITLE) {
-				r.bottom = r.top + 10;
 				if (getSciVersion() <= SCI_VERSION_0_LATE) {
 					// draw a black line between titlebar and actual window content for SCI0
+					r.bottom = r.top + 10;
 					_paint16->frameRect(r);
 				}
 				r.grow(-1);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list