[Scummvm-cvs-logs] SF.net SVN: scummvm: [21724] scummvm/trunk/engines/cine/various.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Sun Apr 9 05:05:08 CEST 2006


Revision: 21724
Author:   eriktorbjorn
Date:     2006-04-09 05:04:33 -0700 (Sun, 09 Apr 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=21724&view=rev

Log Message:
-----------
Casting an array of integers to a pointer to a struct seems like a pretty hacky
thing to do. This replacement hopefully works as intended.

Modified Paths:
--------------
    scummvm/trunk/engines/cine/various.cpp
Modified: scummvm/trunk/engines/cine/various.cpp
===================================================================
--- scummvm/trunk/engines/cine/various.cpp	2006-04-09 12:01:41 UTC (rev 21723)
+++ scummvm/trunk/engines/cine/various.cpp	2006-04-09 12:04:33 UTC (rev 21724)
@@ -263,8 +263,7 @@
 	computeScriptStack(pNewElement->scriptPtr, pNewElement->stack, relTable[entryIdx].size);
 }
 
-int16 getRelEntryForObject(uint16 param1, uint16 param2,
-    selectedObjStruct *pSelectedObject) {
+int16 getRelEntryForObject(uint16 param1, uint16 param2, selectedObjStruct *pSelectedObject) {
 	int16 i;
 	int16 di = -1;
 
@@ -1249,7 +1248,10 @@
 			isDrawCommandEnabled = 1;
 
 			if (playerCommand != -1 && choiceResultTable[playerCommand] == commandVar1) {
-				int16 di = getRelEntryForObject(playerCommand, commandVar1, (selectedObjStruct *) & commandVar3);
+				selectedObjStruct obj;
+				obj.idx = commandVar3[0];
+				obj.param = commandVar3[1];
+				int16 di = getRelEntryForObject(playerCommand, commandVar1, &obj);
 
 				if (di != -1) {
 					runObjectScript(di);
@@ -1838,8 +1840,11 @@
 							int16 relEntry;
 
 							drawMenuBox(commandBuffer, 10, defaultMenuBoxColor);
+							selectedObjStruct obj;
+							obj.idx = commandVar3[0];
+							obj.param = commandVar3[1];
 
-							relEntry = getRelEntryForObject(playerCommand, commandVar1, (selectedObjStruct *)commandVar3);
+							relEntry = getRelEntryForObject(playerCommand, commandVar1, &obj);
 
 							if (relEntry != -1) {
 								runObjectScript(relEntry);


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