[Scummvm-cvs-logs] CVS: scummvm/backends/ps2 systemps2.cpp,1.2,1.3

Robert Göffringmann lavosspawn at users.sourceforge.net
Thu Mar 31 19:01:22 CEST 2005


Update of /cvsroot/scummvm/scummvm/backends/ps2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18908/backends/ps2

Modified Files:
	systemps2.cpp 
Log Message:
ps2: clip coordinates in copyRectToScreen, necessary for The Dig

Index: systemps2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/ps2/systemps2.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- systemps2.cpp	31 Mar 2005 07:50:33 -0000	1.2
+++ systemps2.cpp	1 Apr 2005 03:00:51 -0000	1.3
@@ -367,7 +367,22 @@
 }
 
 void OSystem_PS2::copyRectToScreen(const byte *buf, int pitch, int x, int y, int w, int h) {
-	_screen->copyScreenRect((const uint8*)buf, (uint16)pitch, (uint16)x, (uint16)y, (uint16)w, (uint16)h);
+	if (x < 0) {
+		w += x;
+		buf -= x;
+		x = 0;
+	}
+	if (y < 0) {
+		h += y;
+		buf -= y * pitch;
+		y = 0;
+	}
+	if (w > x + _width)
+		w = _width - x;
+	if (h > y + _height)
+		h = _height - y;
+	if ((w > 0) && (h > 0))
+		_screen->copyScreenRect((const uint8*)buf, (uint16)pitch, (uint16)x, (uint16)y, (uint16)w, (uint16)h);
 }
 
 void OSystem_PS2::updateScreen(void) {





More information about the Scummvm-git-logs mailing list