[Scummvm-cvs-logs] SF.net SVN: scummvm:[55168] scummvm/trunk/engines/hugo

strangerke at users.sourceforge.net strangerke at users.sourceforge.net
Sat Jan 8 18:26:40 CET 2011


Revision: 55168
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55168&view=rev
Author:   strangerke
Date:     2011-01-08 17:26:39 +0000 (Sat, 08 Jan 2011)

Log Message:
-----------
HUGO: Fix an assert when mouse hit the top of the screen

Modified Paths:
--------------
    scummvm/trunk/engines/hugo/display.cpp
    scummvm/trunk/engines/hugo/display.h

Modified: scummvm/trunk/engines/hugo/display.cpp
===================================================================
--- scummvm/trunk/engines/hugo/display.cpp	2011-01-08 16:56:52 UTC (rev 55167)
+++ scummvm/trunk/engines/hugo/display.cpp	2011-01-08 17:26:39 UTC (rev 55168)
@@ -83,7 +83,7 @@
 /**
 * Move an image from source to destination
 */
-void Screen::moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2) {
+void Screen::moveImage(image_pt srcImage, int16 x1, int16 y1, int16 dx, int16 dy, int16 width1, image_pt dstImage, int16 x2, int16 y2, int16 width2) {
 	debugC(3, kDebugDisplay, "moveImage(srcImage, %d, %d, %d, %d, %d, dstImage, %d, %d, %d)", x1, y1, dx, dy, width1, x2, y2, width2);
 
 	int16 wrap_src = width1 - dx;                   // Wrap to next src row
@@ -112,7 +112,10 @@
 void Screen::displayRect(int16 x, int16 y, int16 dx, int16 dy) {
 	debugC(3, kDebugDisplay, "displayRect(%d, %d, %d, %d)", x, y, dx, dy);
 
-	g_system->copyRectToScreen(&_frontBuffer[x + y * 320], 320, x, y, CLIP<int16>(dx, 0, 320 - x), CLIP<int16>(dy, 0, 200 - y));
+	int16 xClip, yClip;
+	xClip = CLIP<int16>(x, 0, 320);
+	yClip = CLIP<int16>(y, 0, 200);
+	g_system->copyRectToScreen(&_frontBuffer[x + y * 320], 320, xClip, yClip, CLIP<int16>(dx, 0, 320 - x), CLIP<int16>(dy, 0, 200 - y));
 }
 
 /**
@@ -492,7 +495,7 @@
 	}
 }
 
-void Screen::drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color) {
+void Screen::drawRectangle(bool filledFl, int16 x1, int16 y1, int16 x2, int16 y2, int color) {
 	assert(x1 <= x2);
 	assert(y1 <= y2);
 

Modified: scummvm/trunk/engines/hugo/display.h
===================================================================
--- scummvm/trunk/engines/hugo/display.h	2011-01-08 16:56:52 UTC (rev 55167)
+++ scummvm/trunk/engines/hugo/display.h	2011-01-08 17:26:39 UTC (rev 55168)
@@ -92,7 +92,7 @@
 	void     displayFrame(int sx, int sy, seq_t *seq, bool foreFl);
 	void     displayList(dupdate_t update, ...);
 	void     displayRect(int16 x, int16 y, int16 dx, int16 dy);
-	void     drawRectangle(bool filledFl, uint16 x1, uint16 y1, uint16 x2, uint16 y2, int color);
+	void     drawRectangle(bool filledFl, int16 x1, int16 y1, int16 x2, int16 y2, int color);
 	void     drawShape(int x, int y, int color1, int color2);
 	void     drawStatusText();
 	void     freeFonts();
@@ -101,7 +101,7 @@
 	void     initDisplay();
 	void     initNewScreenDisplay();
 	void     loadPalette(Common::File &in);
-	void     moveImage(image_pt srcImage, uint16 x1, uint16 y1, uint16 dx, uint16 dy, uint16 width1, image_pt dstImage, uint16 x2, uint16 y2, uint16 width2);
+	void     moveImage(image_pt srcImage, int16 x1, int16 y1, int16 dx, int16 dy, int16 width1, image_pt dstImage, int16 x2, int16 y2, int16 width2);
 	void     remapPal(uint16 oldIndex, uint16 newIndex);
 	void     resetInventoryObjId();
 	void     restorePal(Common::SeekableReadStream *f);


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