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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Mon Aug 2 15:41:58 CEST 2010


Revision: 51615
          http://scummvm.svn.sourceforge.net/scummvm/?rev=51615&view=rev
Author:   m_kiewitz
Date:     2010-08-02 13:41:58 +0000 (Mon, 02 Aug 2010)

Log Message:
-----------
SCI: clipping plane rects for sci32

fixes crash in hires gk1 on cemetary

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

Modified: scummvm/trunk/engines/sci/graphics/frameout.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-08-02 12:48:28 UTC (rev 51614)
+++ scummvm/trunk/engines/sci/graphics/frameout.cpp	2010-08-02 13:41:58 UTC (rev 51615)
@@ -109,10 +109,12 @@
 			planeRect.bottom = readSelectorValue(_segMan, object, SELECTOR(bottom)) + 1;
 			planeRect.right = readSelectorValue(_segMan, object, SELECTOR(right)) + 1;
 
-			planeRect.top = (planeRect.top * _screen->getHeight()) / scriptsRunningHeight;
-			planeRect.left = (planeRect.left * _screen->getWidth()) / scriptsRunningWidth;
-			planeRect.bottom = (planeRect.bottom * _screen->getHeight()) / scriptsRunningHeight;
-			planeRect.right = (planeRect.right * _screen->getWidth()) / scriptsRunningWidth;
+			Common::Rect screenRect(_screen->getWidth(), _screen->getHeight());
+			planeRect.top = (planeRect.top * screenRect.height()) / scriptsRunningHeight;
+			planeRect.left = (planeRect.left * screenRect.width()) / scriptsRunningWidth;
+			planeRect.bottom = (planeRect.bottom * screenRect.height()) / scriptsRunningHeight;
+			planeRect.right = (planeRect.right * screenRect.width()) / scriptsRunningWidth;
+			planeRect.clip(screenRect); // we need to do this, at least in gk1 on cemetary we get bottom right -> 201, 321
 			// Blackout removed plane rect
 			_paint32->fillRect(planeRect, 0);
 			return;
@@ -220,10 +222,12 @@
 		// Update priority here, sq6 sets it w/o UpdatePlane
 		uint16 planePriority = it->priority = readSelectorValue(_segMan, planeObject, SELECTOR(priority));
 
-		planeRect.top = (planeRect.top * _screen->getHeight()) / scriptsRunningHeight;
-		planeRect.left = (planeRect.left * _screen->getWidth()) / scriptsRunningWidth;
-		planeRect.bottom = (planeRect.bottom * _screen->getHeight()) / scriptsRunningHeight;
-		planeRect.right = (planeRect.right * _screen->getWidth()) / scriptsRunningWidth;
+		Common::Rect screenRect(_screen->getWidth(), _screen->getHeight());
+		planeRect.top = (planeRect.top * screenRect.height()) / scriptsRunningHeight;
+		planeRect.left = (planeRect.left * screenRect.width()) / scriptsRunningWidth;
+		planeRect.bottom = (planeRect.bottom * screenRect.height()) / scriptsRunningHeight;
+		planeRect.right = (planeRect.right * screenRect.width()) / scriptsRunningWidth;
+		planeRect.clip(screenRect); // we need to do this, at least in gk1 on cemetary we get bottom right -> 201, 321
 
 		int16 planeOffsetX = 0;
 


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