[Scummvm-cvs-logs] CVS: scummvm/queen display.h,1.10,1.11 display.cpp,1.15,1.16

Gregory Montoir cyx at users.sourceforge.net
Tue Oct 28 11:58:10 CET 2003


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

Modified Files:
	display.h display.cpp 
Log Message:
handle (x,y) negative coordinates in dynalum

Index: display.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- display.h	28 Oct 2003 15:05:34 -0000	1.10
+++ display.h	28 Oct 2003 19:55:12 -0000	1.11
@@ -67,7 +67,7 @@
 	~Display();
 
 	void dynalumInit(Resource *resource, const char *roomName, uint16 roomNum);
-	void dynalumUpdate(int x, int y);
+	void dynalumUpdate(int16 x, int16 y);
 
 	void palConvert(uint8 *outPal, const uint8 *inPal, int start, int end);
 	void palSet(const uint8 *pal, int start, int end, bool updateScreen = false);
@@ -83,7 +83,7 @@
 	void screenMode(int comPanel, bool inCutaway);
 
 	void prepareUpdate();
-	void update(bool dynalum, int dynaX, int dynaY);
+	void update(bool dynalum, int16 dynaX, int16 dynaY);
 
 	void blit(RenderingBuffer dstBuf, uint16 dstX, uint16 dstY, const uint8 *srcBuf, uint16 srcW, uint16 srcH, uint16 srcPitch, bool xflip, bool masked);
 	void fill(RenderingBuffer dstBuf, uint16 x, uint16 y, uint16 w, uint16 h, uint8 color);

Index: display.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/queen/display.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- display.cpp	28 Oct 2003 15:05:35 -0000	1.15
+++ display.cpp	28 Oct 2003 19:55:12 -0000	1.16
@@ -161,19 +161,25 @@
 }
 
 
-void Display::dynalumUpdate(int x, int y) {
+void Display::dynalumUpdate(int16 x, int16 y) {
 
 	if (!_dynalum.valid)
 		return;
 
-	if (x >= _bdWidth) {
+	if (x < 0) {
+		x = 0;
+	}
+	else if (x >= _bdWidth) {
 		x = _bdWidth;
 	}
-	if (y >= ROOM_ZONE_HEIGHT - 1) {
+	if (y < 0) {
+		y = 0;
+	}
+	else if (y >= ROOM_ZONE_HEIGHT - 1) {
 		y = ROOM_ZONE_HEIGHT - 1;
 	}
 
-	unsigned offset = (y / 4) * 160 + (x / 4);
+	uint offset = (y / 4) * 160 + (x / 4);
 	if (offset >= sizeof(_dynalum.msk)) {
 		debug(0, "Graphics::dynalumUpdate(%d, %d) - invalid offset: %08x", x, y, offset);
 		return;
@@ -654,7 +660,7 @@
 }
 
 
-void Display::update(bool dynalum, int dynaX, int dynaY) {
+void Display::update(bool dynalum, int16 dynaX, int16 dynaY) {
 
 	if (dynalum) {
 		dynalumUpdate(dynaX, dynaY);





More information about the Scummvm-git-logs mailing list