[Scummvm-cvs-logs] CVS: scummvm/scumm script_v7he.cpp,2.142,2.143 wiz_he.cpp,2.51,2.52

kirben kirben at users.sourceforge.net
Tue Apr 12 06:19:22 CEST 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20091/scumm

Modified Files:
	script_v7he.cpp wiz_he.cpp 
Log Message:

Not all polygons should be cleared in startScene().
A few minor corrections.


Index: script_v7he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v7he.cpp,v
retrieving revision 2.142
retrieving revision 2.143
diff -u -d -r2.142 -r2.143
--- script_v7he.cpp	10 Apr 2005 06:17:49 -0000	2.142
+++ script_v7he.cpp	12 Apr 2005 13:18:40 -0000	2.143
@@ -1038,8 +1038,8 @@
 
 void ScummEngine_v70he::o70_polygonOps() {
 	int vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y;
-	int id;
-	int fromId, toId;
+	int id, fromId, toId;
+	bool flag;
 
 	byte subOp = fetchScriptByte();
 
@@ -1056,8 +1056,9 @@
 		vert2x = pop();
 		vert1y = pop();
 		vert1x = pop();
+		flag = (subOp == 69 || subOp == 248);
 		id = pop();
-		_wiz.polygonStore(id, (subOp == 69 || subOp == 248), vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y);
+		_wiz.polygonStore(id, flag, vert1x, vert1y, vert2x, vert2y, vert3x, vert3y, vert4x, vert4y);
 		break;
 	case 28: // HE 100
 	case 247:

Index: wiz_he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/wiz_he.cpp,v
retrieving revision 2.51
retrieving revision 2.52
diff -u -d -r2.51 -r2.52
--- wiz_he.cpp	12 Apr 2005 06:06:56 -0000	2.51
+++ wiz_he.cpp	12 Apr 2005 13:18:40 -0000	2.52
@@ -41,7 +41,10 @@
 }
 
 void Wiz::polygonClear() {
-	memset(&_polygons, 0, sizeof(_polygons));
+	for (int i = 0; i < ARRAYSIZE(_polygons); i++) {
+		if (_polygons[i].flag == 1)
+			memset(&_polygons[i], 0, sizeof(WizPolygon));
+	}
 }
 
 void Wiz::polygonLoad(const uint8 *polData) {
@@ -157,10 +160,10 @@
 	bool r = false;
 
 	for (int i = 0; i < pol.numVerts; i++) {
-		curdir = (y <= pol.vert[i].y);
+		curdir = (y < pol.vert[i].y);
 
 		if (curdir != diry) {
-			if (((pol.vert[pi].y - pol.vert[i].y) * (pol.vert[i].x - x) <=
+			if (((pol.vert[pi].y - pol.vert[i].y) * (pol.vert[i].x - x) <
 				 (pol.vert[pi].x - pol.vert[i].x) * (pol.vert[i].y - y)) == diry)
 				r = !r;
 		}





More information about the Scummvm-git-logs mailing list