[Scummvm-cvs-logs] SF.net SVN: scummvm:[53350] scummvm/trunk/engines/sword25/gfx/opengl/ glimage.cpp

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 01:48:32 CEST 2010


Revision: 53350
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53350&view=rev
Author:   sev
Date:     2010-10-12 23:48:32 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: Bugfix to not draw off-screen images

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp

Modified: scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp	2010-10-12 23:48:09 UTC (rev 53349)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp	2010-10-12 23:48:32 UTC (rev 53350)
@@ -226,13 +226,13 @@
 
 	// Handle off-screen clipping
 	if (posY < 0) {
-		img->h -= -posY;
+		img->h = MAX(0, (int)img->h - -posY);
 		img->pixels = (byte *)img->pixels + img->pitch * -posY;
 		posY = 0;
 	}
 
 	if (posX < 0) {
-		img->w -= -posX;
+		img->w = MAX(0, (int)img->w - -posX);
 		img->pixels = (byte *)img->pixels + (-posX * 4);
 		posX = 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