[Scummvm-cvs-logs] SF.net SVN: scummvm: [28291] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Jul 29 17:21:33 CEST 2007


Revision: 28291
          http://scummvm.svn.sourceforge.net/scummvm/?rev=28291&view=rev
Author:   peres001
Date:     2007-07-29 08:21:33 -0700 (Sun, 29 Jul 2007)

Log Message:
-----------
Removed direct references to callable functions (opcodes). They are now only available via a virtual member function in the engine.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/animation.cpp
    scummvm/trunk/engines/parallaction/commands.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parallaction_ns.cpp

Modified: scummvm/trunk/engines/parallaction/animation.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/animation.cpp	2007-07-29 14:32:30 UTC (rev 28290)
+++ scummvm/trunk/engines/parallaction/animation.cpp	2007-07-29 15:21:33 UTC (rev 28291)
@@ -566,7 +566,7 @@
 
 
 			case INST_CALL: // call
-				_callables[(*inst)->_opBase._index](0);
+				_vm->callFunction((*inst)->_opBase._index, 0);
 				break;
 
 			case INST_WAIT: // wait

Modified: scummvm/trunk/engines/parallaction/commands.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/commands.cpp	2007-07-29 14:32:30 UTC (rev 28290)
+++ scummvm/trunk/engines/parallaction/commands.cpp	2007-07-29 15:21:33 UTC (rev 28291)
@@ -302,7 +302,7 @@
 			break;
 
 		case CMD_CALL:	// call
-			_callables[u->_callable](z);
+			callFunction(u->_callable, z);
 			break;
 
 		case CMD_QUIT:	// quit

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2007-07-29 14:32:30 UTC (rev 28290)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2007-07-29 15:21:33 UTC (rev 28291)
@@ -478,6 +478,10 @@
 	int16 		pickupItem(Zone *z);
 	int16 		isItemInInventory(int32 v);
 	int16		getHoverInventoryItem(int16 x, int16 y);
+
+public:
+	virtual	void callFunction(uint index, void* parm) { }
+
 };
 
 class Parallaction_ns : public Parallaction {
@@ -487,6 +491,9 @@
 	~Parallaction_ns() { }
 
 	int init();
+
+public:
+	virtual	void callFunction(uint index, void* parm);
 };
 
 class Parallaction_br : public Parallaction {

Modified: scummvm/trunk/engines/parallaction/parallaction_ns.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2007-07-29 14:32:30 UTC (rev 28290)
+++ scummvm/trunk/engines/parallaction/parallaction_ns.cpp	2007-07-29 15:21:33 UTC (rev 28291)
@@ -66,4 +66,11 @@
 	return 0;
 }
 
+void Parallaction_ns::callFunction(uint index, void* parm) {
+	assert(index >= 0 && index < 25);	// magic value 25 is maximum # of callables for Nippon Safes
+
+	_callables[index](parm);
+}
+
+
 } // namespace Parallaction


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