[Scummvm-cvs-logs] SF.net SVN: scummvm: [29390] scummvm/trunk/engines/cruise/mainDraw.cpp

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Sat Nov 3 23:44:27 CET 2007


Revision: 29390
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29390&view=rev
Author:   yazoo
Date:     2007-11-03 15:44:27 -0700 (Sat, 03 Nov 2007)

Log Message:
-----------
More polygon fix

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/mainDraw.cpp

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-11-03 21:25:37 UTC (rev 29389)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-11-03 22:44:27 UTC (rev 29390)
@@ -248,8 +248,7 @@
 		int XMIN = XMIN_XMAX[1+i*2];
 		int XMAX = XMIN_XMAX[1+i*2+1];
 
-		if(XMAX > 0)
-			line(XMIN, currentY, XMAX, currentY, color);
+		line(XMIN, currentY, XMAX, currentY, color);
 	}
 /*	int i;
 
@@ -402,7 +401,7 @@
 
 				do
 				{
-					if((BX < ptrMax) && (BX > ptrMini)) // are we in screen ?
+					if((BX <= ptrMax) && (BX >= ptrMini)) // are we in screen ?
 					{
 						if(CX < BX[0])
 							BX[0] = CX;
@@ -588,7 +587,7 @@
 	}while(--segCount);
 }
 
-char *drawPolyMode1(char *dataPointer, int linesToDraw) {
+unsigned char *drawPolyMode1(unsigned char *dataPointer, int linesToDraw) {
 	int index;
 	int16 *pBufferDest;
 
@@ -638,7 +637,7 @@
 	return dataPointer;
 }
 
-char *drawPolyMode2(char *dataPointer, int linesToDraw)
+unsigned char *drawPolyMode2(unsigned char *dataPointer, int linesToDraw)
 {
 	int index;
 	int16 *pBufferDest;
@@ -805,10 +804,12 @@
 
 	// position of the dataPointer is m_coordCount * 2
 
+	int polygonCount = 0;
+
 	do {
 		int linesToDraw = *dataPointer++;
 
-		if (linesToDraw > 1) {	// if value not zero
+		if (linesToDraw > 1){	// if value not zero
 			uint16 minimumScale;
 
 			m_color = *dataPointer;	// color
@@ -822,9 +823,9 @@
 			if (minimumScale <= scale)
 			{	
 				if (m_flipLeftRight) {
-					drawPolyMode1((char *)dataPointer, linesToDraw);
+					drawPolyMode1((unsigned char *)dataPointer, linesToDraw);
 				} else {
-					drawPolyMode2((char *)dataPointer, linesToDraw);
+					drawPolyMode2((unsigned char *)dataPointer, linesToDraw);
 				}
 
 				if (destBuffer) {
@@ -840,6 +841,8 @@
 		} else {
 			dataPointer += 4;
 		}
+
+		polygonCount ++;
 	} while (*dataPointer != 0xFF);
 }
 


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