[Scummvm-cvs-logs] SF.net SVN: scummvm:[44372] scummvm/trunk/engines/cruise/mainDraw.cpp

dreammaster at users.sourceforge.net dreammaster at users.sourceforge.net
Sat Sep 26 06:37:20 CEST 2009


Revision: 44372
          http://scummvm.svn.sourceforge.net/scummvm/?rev=44372&view=rev
Author:   dreammaster
Date:     2009-09-26 04:37:19 +0000 (Sat, 26 Sep 2009)

Log Message:
-----------
Bugfix for the dirty rects for drawn sprites when the sprite is partially off-screen

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/mainDraw.cpp

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2009-09-26 04:13:44 UTC (rev 44371)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2009-09-26 04:37:19 UTC (rev 44372)
@@ -1211,7 +1211,11 @@
 	int y = 0;
 
 	// Flag the given area as having been changed
-	gfxModuleData_addDirtyRect(Common::Rect(xs, ys, xs + width, ys + height));
+	Common::Point ps = Common::Point(MAX(MIN(xs, 320), 0), MAX(MIN(ys, 200), 0));
+	Common::Point pe = Common::Point(MAX(MIN(xs + width, 320), 0), MAX(MIN(ys + height, 200), 0));
+	if ((ps.x != pe.x) && (ps.y != pe.y))
+		// At least part of sprite is on-screen
+		gfxModuleData_addDirtyRect(Common::Rect(ps.x, ps.y, pe.x, pe.y));
 
 	cellStruct* plWork = currentObjPtr;
 	int workBufferSize = height * (width / 8);


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