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

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Sun Nov 4 02:11:40 CET 2007


Revision: 29397
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29397&view=rev
Author:   yazoo
Date:     2007-11-03 18:11:39 -0700 (Sat, 03 Nov 2007)

Log Message:
-----------
Fix a few script issues

Modified Paths:
--------------
    scummvm/trunk/engines/cruise/cell.cpp
    scummvm/trunk/engines/cruise/ctp.cpp
    scummvm/trunk/engines/cruise/ctp.h
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/script.cpp

Modified: scummvm/trunk/engines/cruise/cell.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cell.cpp	2007-11-04 01:07:47 UTC (rev 29396)
+++ scummvm/trunk/engines/cruise/cell.cpp	2007-11-04 01:11:39 UTC (rev 29397)
@@ -275,7 +275,7 @@
 }
 
 void sortCells(int16 param1, int16 param2, cellStruct *objPtr) {
-	int16 var;
+/*int16 var;
 	cellStruct *var8_;
 	cellStruct *var40;
 	cellStruct *var3E;
@@ -358,7 +358,7 @@
 		}
 
 		temp->prev = match;
-	}
+	}*/
 }
 
 } // End of namespace Cruise

Modified: scummvm/trunk/engines/cruise/ctp.cpp
===================================================================
--- scummvm/trunk/engines/cruise/ctp.cpp	2007-11-04 01:07:47 UTC (rev 29396)
+++ scummvm/trunk/engines/cruise/ctp.cpp	2007-11-04 01:11:39 UTC (rev 29397)
@@ -279,13 +279,22 @@
 	}
 }
 
+int getNode(int nodeResult[2], int nodeId){
+	if(nodeId < 0 || nodeId >= ctp_routeCoordCount)
+		return -1;
+	
+	nodeResult[0] = ctp_routeCoords[nodeId][0];
+	nodeResult[1] = ctp_routeCoords[nodeId][1];
+
+	return 0;
+}
+
 int loadCtp(uint8 *ctpName) {
 	int walkboxCounter;	// si
 	uint8 *ptr;
 	uint8 *dataPointer;	// ptr2
 	char fileType[5];	// string2
 	short int segementSizeTable[7];	// tempTable
-	char string[32];
 
 	if (ctpVar1 == 0) {
 		int i;
@@ -354,7 +363,7 @@
 
 	free(ptr);
 
-	strcpyuint8(string, currentCtpName);
+	strcpyuint8(currentCtpName, ctpName);
 
 	numberOfWalkboxes = segementSizeTable[6] / 2;	// get the number of walkboxes
 

Modified: scummvm/trunk/engines/cruise/ctp.h
===================================================================
--- scummvm/trunk/engines/cruise/ctp.h	2007-11-04 01:07:47 UTC (rev 29396)
+++ scummvm/trunk/engines/cruise/ctp.h	2007-11-04 01:11:39 UTC (rev 29397)
@@ -54,6 +54,8 @@
 int loadCtp(uint8 * ctpName);
 int ctpProc2(int varX, int varY, int paramX, int paramY);
 
+int getNode(int nodeResult[2], int nodeId);
+
 } // End of namespace Cruise
 
 #endif

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2007-11-04 01:07:47 UTC (rev 29396)
+++ scummvm/trunk/engines/cruise/function.cpp	2007-11-04 01:11:39 UTC (rev 29397)
@@ -1389,6 +1389,27 @@
 	return getProcParam(overlayIdx, 40, (uint8 *) var_26);
 }
 
+int16 Op_SetObjectAtNode(void) {
+	int16 node = popVar();
+	int16 obj = popVar();
+	int16 ovl = popVar();
+
+	if(!ovl)
+		ovl = currentScriptPtr->overlayNumber;;
+
+	int nodeInfo[2];
+
+	if(!getNode(nodeInfo, node))
+	{
+		setObjectPosition(ovl, obj, 0, nodeInfo[0]);
+		setObjectPosition(ovl, obj, 1, nodeInfo[1]);
+		setObjectPosition(ovl, obj, 2, nodeInfo[1]);
+		setObjectPosition(ovl, obj, 4, computeZoom(nodeInfo[1]));
+	}
+
+	return 0;
+}
+
 void setupOpcodeTable(void) {
 	int i;
 
@@ -1422,6 +1443,7 @@
 	opcodeTablePtr[0x18] = Op_AddAnimation;
 	opcodeTablePtr[0x19] = Op_RemoveAnimation;
 	opcodeTablePtr[0x1A] = Op_SetZoom;
+	opcodeTablePtr[0x1B] = Op_SetObjectAtNode;
 	opcodeTablePtr[0x1E] = Op_1E;
 	opcodeTablePtr[0x21] = Op_21;
 	opcodeTablePtr[0x22] = Op_22;

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-11-04 01:07:47 UTC (rev 29396)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-11-04 01:11:39 UTC (rev 29397)
@@ -169,7 +169,7 @@
 int16 polyBuffer4[512];
 
 // this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
-void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], char *dataPtr)
+void getPolySize(int positionX, int positionY, int scale, int sizeTable[4], unsigned char *dataPtr)
 {
 	int upperBorder;
 	int lowerBorder;
@@ -1036,7 +1036,7 @@
 	flipPoly(fileIndex, (int16*)dataPtr, scale, &newFrame, X, Y, &newX, &newY, &newScale);
 
 	// this function fills the sizeTable for the poly (OLD: mainDrawSub1Sub2)
-	getPolySize(newX, newY, newScale, sizeTable, (char*)newFrame);
+	getPolySize(newX, newY, newScale, sizeTable, (unsigned char*)newFrame);
 
 	spriteX2 = sizeTable[0] - 2;	// left   border
 	spriteX1 = sizeTable[1] + 18;	// right  border

Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp	2007-11-04 01:07:47 UTC (rev 29396)
+++ scummvm/trunk/engines/cruise/script.cpp	2007-11-04 01:11:39 UTC (rev 29397)
@@ -276,9 +276,9 @@
 				di = currentScriptPtr->overlayNumber;
 			}
 
-			if (var == 0x85)	// Special case to handle...
+			if ((var == 0x85) && !strcmp((char*)currentCtpName, "S26.CTP") && !di && mode == 1) // patch in bar
 			{
-				ASSERT(0);
+				var= 0x87;
 			}
 
 			setObjectPosition(di, var_4, mode, var);
@@ -732,8 +732,7 @@
 		currentScriptOpcodeType = opcodeType & 7;
 
 		if (!opcodeTypeTable[(opcodeType & 0xFB) >> 3]) {
-			printf("Unsupported opcode type %d\n",
-			    (opcodeType & 0xFB) >> 3);
+			printf("Unsupported opcode type %d\n", (opcodeType & 0xFB) >> 3);
 			exit(1);
 			return (-21);
 		}


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