[Scummvm-cvs-logs] CVS: scummvm/queen structs.h,1.12,1.13 graphics.h,1.25,1.26 graphics.cpp,1.28,1.29

Gregory Montoir cyx at users.sourceforge.net
Sat Oct 18 10:18:04 CEST 2003


Update of /cvsroot/scummvm/scummvm/queen
In directory sc8-pr-cvs1:/tmp/cvs-serv9919

Modified Files:
	structs.h graphics.h graphics.cpp 
Log Message:
fix bob clipping errors

Index: structs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/structs.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- structs.h	16 Oct 2003 19:40:29 -0000	1.12
+++ structs.h	18 Oct 2003 17:12:50 -0000	1.13
@@ -26,28 +26,28 @@
 
 
 struct Box {
-	uint16 x1, y1, x2, y2;
+	int16 x1, y1, x2, y2;
 
 	void readFrom(byte *&ptr) {
-		x1 = READ_BE_UINT16(ptr); ptr += 2;
-		y1 = READ_BE_UINT16(ptr); ptr += 2;
-		x2 = READ_BE_UINT16(ptr); ptr += 2;
-		y2 = READ_BE_UINT16(ptr); ptr += 2;
+		x1 = (int16)READ_BE_UINT16(ptr); ptr += 2;
+		y1 = (int16)READ_BE_UINT16(ptr); ptr += 2;
+		x2 = (int16)READ_BE_UINT16(ptr); ptr += 2;
+		y2 = (int16)READ_BE_UINT16(ptr); ptr += 2;
 	}
 
 	int16 xDiff() const {
-		return (int16)(x2 - x1);
+		return x2 - x1;
 	}
 
 	int16 yDiff() const {
-		return (int16)(y2 - y1);
+		return y2 - y1;
 	}
 
-	bool intersects(uint16 x, uint16 y, uint16 w, uint16 h) const {
+	bool intersects(int16 x, int16 y, uint16 w, uint16 h) const {
 		return (x + w > x1) && (y + h > y1) && (x <= x2) && (y <= y2);
 	}
 
-	bool contains(uint16 x, uint16 y) const {
+	bool contains(int16 x, int16 y) const {
 		return (x >= x1) && (x <= x2) && (y >= y1) && (y <= y2);
 	}
 };

Index: graphics.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- graphics.h	18 Oct 2003 16:19:36 -0000	1.25
+++ graphics.h	18 Oct 2003 17:12:50 -0000	1.26
@@ -125,10 +125,10 @@
 	void bobSetupControl();
 	void bobAnimString(uint32 bobnum, const AnimFrame *buf); // stringanim()
 	void bobAnimNormal(uint32 bobnum, uint16 firstFrame, uint16 lastFrame, uint16 speed, bool rebound, bool xflip); // makeanim()
-	void bobMove(uint32 bobnum, uint16 endx, uint16 endy, int16 speed); // movebob()
-	void bobDraw(uint32 bobnum, uint16 x, uint16 y, uint16 scale, bool xflip, const Box& box); // bob()
+	void bobMove(uint32 bobnum, int16 endx, int16 endy, int16 speed); // movebob()
+	void bobDraw(uint32 bobnum, int16 x, int16 y, uint16 scale, bool xflip, const Box& box); // bob()
 	void bobDrawInventoryItem(uint32 bobnum, uint16 x, uint16 y); // invbob()
-	void bobPaste(uint32 bobnum, uint16 x, uint16 y); // bobpaste()
+	void bobPaste(uint32 bobnum, int16 x, int16 y); // bobpaste()
 	void bobShrink(const BobFrame* pbf, uint16 percentage); // shrinkbob()
 	void bobClear(uint32 bobnum); // clearbob()
 	void bobSortAll(); // sortbobs()

Index: graphics.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/graphics.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- graphics.cpp	18 Oct 2003 16:19:36 -0000	1.28
+++ graphics.cpp	18 Oct 2003 17:12:50 -0000	1.29
@@ -170,7 +170,7 @@
 }
 
 
-void Graphics::bobMove(uint32 bobnum, uint16 endx, uint16 endy, int16 speed) {
+void Graphics::bobMove(uint32 bobnum, int16 endx, int16 endy, int16 speed) {
 
 	debug(9, "Graphics::bobMove(%d, %d, %d, %d)", bobnum, endx, endy, speed);
 
@@ -296,7 +296,7 @@
 }
           
 
-void Graphics::bobDraw(uint32 bobnum, uint16 x, uint16 y, uint16 scale, bool xflip, const Box& box) {
+void Graphics::bobDraw(uint32 bobnum, int16 x, int16 y, uint16 scale, bool xflip, const Box& box) {
 
 	uint16 w, h;
 
@@ -366,7 +366,7 @@
 }
 
 
-void Graphics::bobPaste(uint32 bobnum, uint16 x, uint16 y) {
+void Graphics::bobPaste(uint32 bobnum, int16 x, int16 y) {
 
 	BobFrame *pbf = &_frames[bobnum];
 	_display->blit(RB_BACKDROP, x, y, pbf->data, pbf->width, pbf->height, pbf->width, false, true);





More information about the Scummvm-git-logs mailing list