[Scummvm-cvs-logs] SF.net SVN: scummvm: [29312] scummvm/trunk

yazoo at users.sourceforge.net yazoo at users.sourceforge.net
Mon Oct 29 21:56:19 CET 2007


Revision: 29312
          http://scummvm.svn.sourceforge.net/scummvm/?rev=29312&view=rev
Author:   yazoo
Date:     2007-10-29 13:56:19 -0700 (Mon, 29 Oct 2007)

Log Message:
-----------
Add more object menu controls

Modified Paths:
--------------
    scummvm/trunk/dists/msvc8/cruise.vcproj
    scummvm/trunk/engines/cruise/actor.cpp
    scummvm/trunk/engines/cruise/actor.h
    scummvm/trunk/engines/cruise/cruise_main.cpp
    scummvm/trunk/engines/cruise/cruise_main.h
    scummvm/trunk/engines/cruise/function.cpp
    scummvm/trunk/engines/cruise/mainDraw.cpp
    scummvm/trunk/engines/cruise/menu.cpp
    scummvm/trunk/engines/cruise/overlay.h
    scummvm/trunk/engines/cruise/saveload.cpp
    scummvm/trunk/engines/cruise/script.cpp
    scummvm/trunk/engines/cruise/script.h
    scummvm/trunk/engines/cruise/vars.cpp
    scummvm/trunk/engines/cruise/vars.h

Modified: scummvm/trunk/dists/msvc8/cruise.vcproj
===================================================================
--- scummvm/trunk/dists/msvc8/cruise.vcproj	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/dists/msvc8/cruise.vcproj	2007-10-29 20:56:19 UTC (rev 29312)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="windows-1250"?>
+<?xml version="1.0" encoding="Windows-1252"?>
 <VisualStudioProject
 	ProjectType="Visual C++"
 	Version="8,00"

Modified: scummvm/trunk/engines/cruise/actor.cpp
===================================================================
--- scummvm/trunk/engines/cruise/actor.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/actor.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -27,16 +27,18 @@
 
 namespace Cruise {
 
-int16 mainProc13(int overlayIdx, int param1, actorStruct *pStartEntry,
-	    int param2) {
+int16 mainProc13(int overlayIdx, int param1, actorStruct *pStartEntry, int param2) {
 	actorStruct *pCurrentEntry = pStartEntry->next;
 
 	while (pCurrentEntry) {
-		if ((pCurrentEntry->overlayNumber == overlayIdx
-			|| overlayIdx == -1) && (pCurrentEntry->idx == param1
-			|| param1 == -1) && (pCurrentEntry->type == param2
-			|| param2 == -1) && (pCurrentEntry->pathId != -2)) {
-			return 0;
+		if ((pCurrentEntry->overlayNumber == overlayIdx || overlayIdx == -1) &&
+			(pCurrentEntry->idx == param1 || param1 == -1) &&
+			(pCurrentEntry->type == param2 || param2 == -1))
+		{
+			if(pCurrentEntry->pathId != -2)
+			{
+				return 0;
+			}
 		}
 
 		pCurrentEntry = pCurrentEntry->next;
@@ -45,15 +47,14 @@
 	return 1;
 }
 
-actorStruct *findActor(int overlayIdx, int param1, actorStruct *pStartEntry,
-	    int param2) {
+actorStruct *findActor(actorStruct *pStartEntry, int overlayIdx, int objIdx, int type) {
 	actorStruct *pCurrentEntry = pStartEntry->next;
 
 	while (pCurrentEntry) {
 		if ((pCurrentEntry->overlayNumber == overlayIdx
-			|| overlayIdx == -1) && (pCurrentEntry->idx == param1
-			|| param1 == -1) && (pCurrentEntry->type == param2
-			|| param2 == -1)) {
+			|| overlayIdx == -1) && (pCurrentEntry->idx == objIdx
+			|| objIdx == -1) && (pCurrentEntry->type == type
+			|| type == -1)) {
 			return pCurrentEntry;
 		}
 
@@ -598,7 +599,8 @@
 		}
 	}
 
-	if (!flagCt) {
+	//if (!flagCt)
+	{
 		int i;
 		int16 *ptr;
 

Modified: scummvm/trunk/engines/cruise/actor.h
===================================================================
--- scummvm/trunk/engines/cruise/actor.h	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/actor.h	2007-10-29 20:56:19 UTC (rev 29312)
@@ -67,7 +67,7 @@
 extern int raoul_invstat[][13];
 
 int16 mainProc13(int overlayIdx, int param1, actorStruct * pStartEntry, int param2);
-actorStruct *findActor(int overlayIdx, int param1, actorStruct * pStartEntry, int param2);
+actorStruct *findActor(actorStruct *pStartEntry, int overlayIdx, int objIdx, int type);
 void processAnimation(void);
 void getPixel(int x, int y);
 

Modified: scummvm/trunk/engines/cruise/cruise_main.cpp
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/cruise_main.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -34,6 +34,8 @@
 
 unsigned int timer = 0;
 
+gfxEntryStruct* linkedMsgList = NULL;
+
 void drawSolidBox(int32 x1, int32 y1, int32 x2, int32 y2, uint8 color) {
 	int32 i;
 	int32 j;
@@ -567,7 +569,7 @@
 	if (bootOverlayNumber) {
 		positionInStack = 0;
 
-		attacheNewScriptToTail(bootOverlayNumber, &procHead, 0, 20, 0, 0, scriptType_PROC);
+		attacheNewScriptToTail(&procHead, bootOverlayNumber, 0, 20, 0, 0, scriptType_PROC);
 		scriptFunc2(bootOverlayNumber, &procHead, 1, 0);
 	}
 
@@ -836,7 +838,8 @@
 	return NULL;
 }
 
-bool findRelation(int objOvl, int objIdx, int x, int y) {
+bool findRelation(int objOvl, int objIdx, int x, int y)
+{
 	bool found = false;
 	bool first = true;
 	int testState;
@@ -924,12 +927,12 @@
 							if( (!first) && ((testState==-1) || (testState==objectState)))
 							{
 								if(!strlen(verbe_name))
-									attacheNewScriptToTail(j, &relHead, ptrHead->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+									attacheNewScriptToTail(&relHead, j, ptrHead->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
 								else if(ovl2->nameVerbGlob)
 								{
 									found = true;
 									ptr = getObjectName(ptrHead->verbNumber, ovl2->nameVerbGlob);
-									addSelectableMenuEntry(i, j, menuTable[0], 1, -1, ptr);
+									addSelectableMenuEntry(j, i, menuTable[0], 1, -1, ptr);
 								}
 							}
 						}
@@ -944,15 +947,14 @@
 
 int processInventory(void) {
 	if (menuTable[1]) {
-		menuElementSubStruct *pMenuElementSub =
-		    getSelectedEntryInMenu(menuTable[1]);
+		menuElementSubStruct *pMenuElementSub = getSelectedEntryInMenu(menuTable[1]);
 
 		if (pMenuElementSub) {
 			//int var2;
 			//int var4;
 
-			var2 = pMenuElementSub->var2;
-			var4 = pMenuElementSub->var4;
+			var2 = pMenuElementSub->ovlIdx;
+			var4 = pMenuElementSub->header;
 
 			freeMenu(menuTable[1]);
 			menuTable[1] = NULL;
@@ -969,6 +971,122 @@
 	return 0;
 }
 
+void callSubRelation(menuElementSubStruct *pMenuElement, int nOvl, int nObj)
+{
+	if(pMenuElement == NULL)
+		return;
+
+	menuElementSubStruct* pCurrent = pMenuElement;
+
+	while(pCurrent != NULL)
+	{
+		int ovlIdx = pCurrent->ovlIdx;
+		int header = pCurrent->header;
+
+		linkDataStruct* pHeader = &overlayTable[ovlIdx].ovlData->arrayMsgRelHeader[header];
+
+		int obj2Ovl = pHeader->obj2Overlay;
+		if(obj2Ovl == 0)
+		{
+			obj2Ovl = ovlIdx;
+		}
+
+		if((obj2Ovl == nOvl) && (pHeader->obj2Number != -1) && (pHeader->obj2Number == nObj))
+		{
+			int x = 60;
+			int y = 60;
+
+			objectParamsQuery params;
+			memset(&params, 0, sizeof(objectParamsQuery)); // to remove warning
+
+			if(pHeader->obj2Number >= 0)
+			{
+				getMultipleObjectParam(obj2Ovl, pHeader->obj2Number, &params);
+			}
+
+			if((pHeader->field_1C != -1) || (params.scale == pHeader->field_1C))
+			{
+				if(pHeader->type == 30)
+				{
+					ASSERT(0);
+				}
+				else
+				if(pHeader->type == 50)
+				{
+					ASSERT(0);
+				}
+			}
+		}
+
+		pCurrent = pCurrent->pNext;
+	}
+}
+
+void callRelation(menuElementSubStruct *pMenuElement, int nObj2)
+{
+	if(pMenuElement == NULL)
+		return;
+
+	menuElementSubStruct* pCurrent = pMenuElement;
+
+	while(pCurrent != NULL)
+	{
+		int ovlIdx = pCurrent->ovlIdx;
+		int header = pCurrent->header;
+
+		linkDataStruct* pHeader = &overlayTable[ovlIdx].ovlData->arrayMsgRelHeader[header];
+
+		if(pHeader->obj2Number == nObj2)
+		{
+			if(pHeader->type == 30)
+			{
+				attacheNewScriptToTail(&relHead, ovlIdx, pHeader->id, 30, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_REL);
+
+				if((narratorOvl > 0) && (pHeader->field_12 != -1) && (pHeader->field_14 != -1))
+				{
+					actorStruct* pTrack = findActor(&actorHead, narratorOvl, narratorIdx, 0);
+
+					if(pTrack)
+					{
+						animationStart = false;
+
+						if(pHeader->field_1E == 9999)
+						{
+							ASSERT(0);
+						}
+						else if((pHeader->field_12 == 9999) && (pHeader->field_14 == 9999))
+						{
+							ASSERT(0);
+						}
+						else
+						{
+							pTrack->x_dest = pHeader->field_12;
+							pTrack->y_dest = pHeader->field_14;
+							pTrack->endDirection = pHeader->field_1E;
+						}
+
+						pTrack->flag = 1;
+
+						autoTrack = true;
+						userEnabled = 0;
+						changeScriptParamInList(ovlIdx, pHeader->id, &relHead, 9998, 0);
+					}
+				}
+			}
+			else
+			{
+				ASSERT(0);
+			}
+		}
+		else
+		{
+			linkedRelation = pMenuElement;
+		}
+
+		pCurrent = pCurrent->pNext;
+	}
+}
+
 int processInput(void)
 {
 	int16 mouseX = 0;
@@ -1026,72 +1144,93 @@
 		ASSERT(0);
 	}
 	else
+	if ((button & 1) && (buttonDown == 0))
 	{
-		// not in dialogue
+		// left click
+		buttonDown = 1;
 
-		// left click
-		if ((button & 1) && (buttonDown == 0))
+		// is there a relation
+		if (linkedRelation)
 		{
-			buttonDown = 1;
+			// call sub relation when clicking on an object
+			if(menuDown == 0)
+			{
+				if(menuTable[0])
+				{
+					int objOvl;
+					int objIdx;
+					int objType;
 
-			// is there a relation
-			if (linkedRelation)
+					objType = findObject(mouseX, mouseY, &objOvl, &objIdx);
+
+					if (objType != -1)
+					{
+						callSubRelation(linkedRelation, objOvl, objIdx);
+					}
+					freeMenu(menuTable[0]);
+					menuTable[0] = NULL;
+				}
+
+				if(linkedMsgList)
+				{
+					ASSERT(0);
+//					freeMsgList(linkedMsgList);
+				}
+				linkedMsgList = NULL;
+				linkedRelation = NULL;
+				changeCursor(CURSOR_NORMAL);
+			}
+			// call sub relation when clicking in inventory
+			else
 			{
 				ASSERT(0);
 			}
-			else
+		}
+		else
+		{
+			// manage click on object menu
+			if (menuDown == 0)
 			{
-				// manage click on object menu
-				if (menuDown == 0)
+				// Handle left click on an object
+				if (menuTable[0] == 0)
 				{
-					// Handle left click on an object
-					if (menuTable[0] == 0)
-					{
-						int objOvl;
-						int objIdx;
-						int objType;
+					int objOvl;
+					int objIdx;
+					int objType;
 
-						objType = findObject(mouseX, mouseY, &objOvl, &objIdx);
+					objType = findObject(mouseX, mouseY, &objOvl, &objIdx);
 
-						if (objType != -1)
+					if (objType != -1)
+					{
+						int relation = findRelation(objOvl, objIdx, mouseX, mouseY);
+						if(menuTable[0])
 						{
-							int relation = findRelation(objOvl, objIdx, mouseX, mouseY);
-							if(menuTable[0])
+							if(relation)
 							{
-								if(relation)
-								{
-									currentActiveMenu = 0;
-									selectDown = 1;
-								}
-								else
-								{
-									// object has a name but no relation, just move the character
-									freeMenu(menuTable[0]);
-									menuTable[0] = NULL;
-
-									aniX = mouseX;
-									aniY = mouseY;
-									animationStart = true;
-									buttonDown = 0;
-								}
+								currentActiveMenu = 0;
+								selectDown = 1;
 							}
 							else
 							{
+								// object has a name but no relation, just move the character
+								freeMenu(menuTable[0]);
+								menuTable[0] = NULL;
+
 								aniX = mouseX;
 								aniY = mouseY;
 								animationStart = true;
 								buttonDown = 0;
 							}
-						}else {
-							// No object found, we move the character to the cursor
+						}
+						else
+						{
 							aniX = mouseX;
 							aniY = mouseY;
 							animationStart = true;
 							buttonDown = 0;
 						}
-					}
-					else
-					{
+					}else {
+						// No object found, we move the character to the cursor
 						aniX = mouseX;
 						aniY = mouseY;
 						animationStart = true;
@@ -1100,48 +1239,76 @@
 				}
 				else
 				{
-					// Handle left click in inventory
-					if (processInventory())
+					// handle click in menu
+					if (menuTable[0])
 					{
-						currentActiveMenu = 0;
-						selectDown = 1;
-						menuDown = 0;
-					} else {
-						currentActiveMenu = -1;
-						menuDown = 0;
+						menuElementSubStruct *pMenuElementSub = getSelectedEntryInMenu(menuTable[0]);
+
+						callRelation(pMenuElementSub, -1);
+
+						// if there is a linked relation, close menu
+						if(!linkedRelation)
+						{
+							freeMenu(menuTable[0]);
+							menuTable[0] = NULL;
+							changeCursor(CURSOR_NORMAL);
+						}
+						// else create the message for the linked relation
+						else
+						{
+							char text[80];
+							strcpy(text, menuTable[0]->stringPtr);
+							strcat(text, ":");
+							strcat(text, currentMenuElement->string);
+							linkedMsgList = renderText(320, (const uint8 *)text);
+							changeCursor(CURSOR_CROSS);
+						}
 					}
 				}
 			}
-		}
-		// test right button
-		else if ((button & 2) || (keyboardVar == 0x43) || (keyboardVar == 0x52))
-		{
-			if (buttonDown == 0)
+			else
 			{
-				keyboardVar = 0;
-
-				// close object menu if there is no linked relation
-				if ((linkedRelation == 0) && (menuTable[0])) {
-					freeMenu(menuTable[0]);
-					menuTable[0] = NULL;
-					selectDown = 0;
+				// Handle left click in inventory
+				if (processInventory())
+				{
+					currentActiveMenu = 0;
+					selectDown = 1;
 					menuDown = 0;
+				} else {
 					currentActiveMenu = -1;
+					menuDown = 0;
 				}
+			}
+		}
+	}
+	// test right button
+	else if ((button & 2) || (keyboardVar == 0x43) || (keyboardVar == 0x52))
+	{
+		if (buttonDown == 0)
+		{
+			keyboardVar = 0;
 
-				if ((!selectDown) && (!menuDown) && (menuTable[1] == NULL))
-				{
-					buildInventory(mouseX, mouseY);
+			// close object menu if there is no linked relation
+			if ((linkedRelation == 0) && (menuTable[0])) {
+				freeMenu(menuTable[0]);
+				menuTable[0] = NULL;
+				selectDown = 0;
+				menuDown = 0;
+				currentActiveMenu = -1;
+			}
 
-					if (menuTable[1]) {
-						currentActiveMenu = 1;
-						menuDown = 1;
-					} else {
-						menuDown = 1;
-					}
+			if ((!selectDown) && (!menuDown) && (menuTable[1] == NULL))
+			{
+				buildInventory(mouseX, mouseY);
+
+				if (menuTable[1]) {
+					currentActiveMenu = 1;
+					menuDown = 1;
+				} else {
+					menuDown = 1;
 				}
-				buttonDown = 1;
 			}
+			buttonDown = 1;
 		}
 	}
 	return 0;
@@ -1321,7 +1488,7 @@
 	main22 = 0;
 	main7 = 0;
 	main8 = 0;
-	main15 = 0;
+	autoTrack = 0;
 
 	if (initAllData()) {
 		int playerDontAskQuit = 1;
@@ -1335,7 +1502,7 @@
 //      readKeyboard();
 			playerDontAskQuit = processInput();
 
-			//if (enableUser)
+			if (enableUser)
 			{
 				userEnabled = 1;
 				enableUser = 0;
@@ -1380,7 +1547,7 @@
 				mainDraw(0);
 				flipScreen();
 
-				if (userEnabled && !main7 && !main15)
+				if (userEnabled && !main7 && !autoTrack)
 				{
 					if(currentActiveMenu == -1)
 					{
@@ -1433,8 +1600,24 @@
 					ASSERT(0);
 				}
 
-				if (main15) {
-					ASSERT(0);
+				// wait for character to finish auto track
+				if (autoTrack)
+				{
+					if(mainProc13(narratorOvl, narratorIdx, &actorHead, 0))
+					{
+						if(main14 != -1)
+						{
+							ASSERT(0);
+						}
+
+						changeScriptParamInList(-1, -1, &relHead, 9998, 0);
+						autoTrack = 0;
+						enableUser = 1;
+					}
+					else
+					{
+						userEnabled = false;
+					}
 				}
 
 				if (main14 != -1) {

Modified: scummvm/trunk/engines/cruise/cruise_main.h
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.h	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/cruise_main.h	2007-10-29 20:56:19 UTC (rev 29312)
@@ -78,6 +78,8 @@
 #define	OBJ_TYPE_POLY		  8
 #define	OBJ_TYPE_EXIT		  9
 
+extern gfxEntryStruct* linkedMsgList;
+
 bool delphineUnpack(byte *dst, const byte *src, int len);
 
 ovlData3Struct *getOvlData3Entry(int32 scriptNumber, int32 param);

Modified: scummvm/trunk/engines/cruise/function.cpp
===================================================================
--- scummvm/trunk/engines/cruise/function.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/function.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -104,7 +104,7 @@
 		ovlIdx = currentScriptPtr->overlayNumber;
 	}
 
-	ptr = attacheNewScriptToTail(ovlIdx, &procHead, scriptIdx, currentScriptPtr->type, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_MinusPROC);
+	ptr = attacheNewScriptToTail(&procHead, ovlIdx, scriptIdx, currentScriptPtr->type, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_MinusPROC);
 
 	if (!ptr)
 		return (0);
@@ -142,7 +142,7 @@
 	if (!overlay)
 		return (0);
 
-	attacheNewScriptToTail(overlay, &procHead, pop2, currentScriptPtr->type, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_PROC);
+	attacheNewScriptToTail(&procHead, overlay, pop2, currentScriptPtr->type, currentScriptPtr->scriptNumber, currentScriptPtr->overlayNumber, scriptType_PROC);
 
 	if (pop1 > 0) {
 		printf("Unsupported art send in op6!\n");
@@ -159,8 +159,8 @@
 	if (!pop2)
 		pop2 = currentScriptPtr->overlayNumber;
 
-	var30 = pop2;
-	var31 = pop1;
+	narratorOvl = pop2;
+	narratorIdx = pop1;
 
 	return (0);
 }
@@ -405,8 +405,7 @@
 
 int16 Op_62(void) {
 	if (currentScriptPtr->var1A == 20) {
-		changeScriptParamInList(currentScriptPtr->var18,
-		    currentScriptPtr->var16, &procHead, 9997, -1);
+		changeScriptParamInList(currentScriptPtr->var18, currentScriptPtr->var16, &procHead, 9997, -1);
 	} else if (currentScriptPtr->var1A == 30) {
 		changeScriptParamInList(currentScriptPtr->var18,
 		    currentScriptPtr->var16, &relHead, 9997, -1);
@@ -1201,7 +1200,7 @@
 		overlay = currentScriptPtr->overlayNumber;
 	}
 
-	pActor = findActor(overlay, var2, &actorHead, var1);
+	pActor = findActor(&actorHead, overlay, var2, var1);
 
 	if (!pActor) {
 		return 1;
@@ -1310,9 +1309,8 @@
 	return 0;
 }
 
-void Op_60Sub(int overlayIdx, actorStruct * pActorHead, int _var0, int _var1,
-	    int _var2, int _var3) {
-	actorStruct *pActor = findActor(overlayIdx, _var0, pActorHead, _var3);
+void Op_60Sub(int overlayIdx, actorStruct * pActorHead, int _var0, int _var1, int _var2, int _var3) {
+	actorStruct *pActor = findActor(pActorHead, overlayIdx, _var0, _var3);
 
 	if (pActor) {
 		if ((pActor->freeze == _var2) || (_var2 == -1)) {

Modified: scummvm/trunk/engines/cruise/mainDraw.cpp
===================================================================
--- scummvm/trunk/engines/cruise/mainDraw.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/mainDraw.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -1006,8 +1006,9 @@
 			return;
 		}
 	}
-
-	if (linkedRelation) {
+	else
+	if ((linkedRelation) && (linkedMsgList))
+	{
 		ASSERT(0);
 		// TODO: draw mouse here
 	}

Modified: scummvm/trunk/engines/cruise/menu.cpp
===================================================================
--- scummvm/trunk/engines/cruise/menu.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/menu.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -46,8 +46,7 @@
 }
 
 // TODO: rewrite to remove the goto
-void addSelectableMenuEntry(int param0, int param1, menuStruct *pMenu,
-	    int param2, int color, const char *menuText) {
+void addSelectableMenuEntry(int ovlIdx, int headerIdx, menuStruct *pMenu, int param2, int color, const char *menuText) {
 	menuElementStruct *di;
 	menuElementStruct *var_6;
 	menuElementStruct *pNewElement;
@@ -70,8 +69,8 @@
 						ASSERT(pSubStruct);
 
 						pSubStruct->pNext = NULL;
-						pSubStruct->var2 = param0;
-						pSubStruct->var4 = param1;
+						pSubStruct->ovlIdx = ovlIdx;
+						pSubStruct->header = headerIdx;
 
 						pSubStructCurrent =
 						    pNewElement->ptrSub;
@@ -129,8 +128,8 @@
 		pNewElement->ptrSub = pSubStruct;
 
 		pSubStruct->pNext = NULL;
-		pSubStruct->var2 = param0;
-		pSubStruct->var4 = param1;
+		pSubStruct->ovlIdx = ovlIdx;
+		pSubStruct->header = headerIdx;
 
 		pMenu->numElements++;
 	}

Modified: scummvm/trunk/engines/cruise/overlay.h
===================================================================
--- scummvm/trunk/engines/cruise/overlay.h	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/overlay.h	2007-10-29 20:56:19 UTC (rev 29312)
@@ -67,15 +67,15 @@
 };
 
 struct linkDataStruct {
-	uint16 type;
-	uint16 id;
-	uint16 offsetVerbeName;
-	uint16 verbOverlay;
-	uint16 verbNumber;
-	uint16 obj1Overlay;
-	uint16 obj1Number;
-	uint16 obj2Overlay;
-	uint16 obj2Number;
+	int16 type;
+	int16 id;
+	int16 offsetVerbeName;
+	int16 verbOverlay;
+	int16 verbNumber;
+	int16 obj1Overlay;
+	int16 obj1Number;
+	int16 obj2Overlay;
+	int16 obj2Number;
 
 	int16 field_12;
 	int16 field_14;

Modified: scummvm/trunk/engines/cruise/saveload.cpp
===================================================================
--- scummvm/trunk/engines/cruise/saveload.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/saveload.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -222,8 +222,8 @@
 
 	//
 
-	fread(&var30, 2, 1, fileHandle);
-	fread(&var31, 2, 1, fileHandle);
+	fread(&narratorOvl, 2, 1, fileHandle);
+	fread(&narratorIdx, 2, 1, fileHandle);
 	fread(&aniX, 2, 1, fileHandle);
 	fread(&aniY, 2, 1, fileHandle);
 	int16 bTemp;

Modified: scummvm/trunk/engines/cruise/script.cpp
===================================================================
--- scummvm/trunk/engines/cruise/script.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/script.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -595,9 +595,7 @@
 	return (0);
 }
 
-uint8 *attacheNewScriptToTail(int16 overlayNumber,
-		  scriptInstanceStruct *scriptHandlePtr, int16 param, int16 arg0,
-		  int16 arg1, int16 arg2, scriptTypeEnum scriptType) {
+uint8 *attacheNewScriptToTail(scriptInstanceStruct *scriptHandlePtr, int16 overlayNumber, int16 param, int16 arg0, int16 arg1, int16 arg2, scriptTypeEnum scriptType) {
 	int useArg3Neg = 0;
 	ovlData3Struct *data3Ptr;
 	scriptInstanceStruct *tempPtr;

Modified: scummvm/trunk/engines/cruise/script.h
===================================================================
--- scummvm/trunk/engines/cruise/script.h	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/script.h	2007-10-29 20:56:19 UTC (rev 29312)
@@ -60,9 +60,7 @@
 uint8 getByteFromScript(void);
 
 int removeScript(int overlay, int idx, scriptInstanceStruct * headPtr);
-uint8 *attacheNewScriptToTail(int16 overlayNumber,
-    scriptInstanceStruct * scriptHandlePtr, int16 param, int16 arg0,
-    int16 arg1, int16 arg2, scriptTypeEnum scriptType);
+uint8 *attacheNewScriptToTail(scriptInstanceStruct *scriptHandlePtr, int16 overlayNumber, int16 param, int16 arg0, int16 arg1, int16 arg2, scriptTypeEnum scriptType);
 void manageScripts(scriptInstanceStruct * scriptHandle);
 
 } // End of namespace Cruise

Modified: scummvm/trunk/engines/cruise/vars.cpp
===================================================================
--- scummvm/trunk/engines/cruise/vars.cpp	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/vars.cpp	2007-10-29 20:56:19 UTC (rev 29312)
@@ -57,7 +57,7 @@
 uint8 scriptNameBuffer[15];
 int16 currentActiveMenu;
 int16 main14;
-int16 linkedRelation;
+menuElementSubStruct* linkedRelation;
 int16 main21;
 int16 main22;
 int16 main7;
@@ -103,8 +103,8 @@
 
 int16 saveOpcodeVar;
 
-int16 var30 = 0;
-int16 var31 = 0;
+int16 narratorOvl = 0;
+int16 narratorIdx = 0;
 
 int16 var1;
 int16 var2;

Modified: scummvm/trunk/engines/cruise/vars.h
===================================================================
--- scummvm/trunk/engines/cruise/vars.h	2007-10-28 19:19:12 UTC (rev 29311)
+++ scummvm/trunk/engines/cruise/vars.h	2007-10-29 20:56:19 UTC (rev 29312)
@@ -32,8 +32,8 @@
 
 struct menuElementSubStruct {
 	struct menuElementSubStruct *pNext;
-	int16 var2;
-	int16 var4;
+	int16 ovlIdx;
+	int16 header;
 };
 
 struct menuElementStruct {
@@ -159,7 +159,7 @@
 extern uint8 scriptNameBuffer[15];
 extern int16 currentActiveMenu;
 extern int16 main14;
-extern int16 linkedRelation;
+extern menuElementSubStruct* linkedRelation;
 extern int16 main21;
 extern int16 main22;
 extern int16 main7;
@@ -204,8 +204,8 @@
 
 extern int16 saveOpcodeVar;
 
-extern int16 var30;
-extern int16 var31;
+extern int16 narratorOvl;
+extern int16 narratorIdx;
 
 extern int16 var1;
 extern int16 var2;


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