[Scummvm-cvs-logs] SF.net SVN: scummvm:[42732] scummvm/branches/gsoc2009-draci/engines/draci

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sat Jul 25 05:37:23 CEST 2009


Revision: 42732
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42732&view=rev
Author:   dkasak13
Date:     2009-07-25 03:37:22 +0000 (Sat, 25 Jul 2009)

Log Message:
-----------
Implemented ExecUse, ExecLook and ExecInit GPL commands.

Modified Paths:
--------------
    scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
    scummvm/branches/gsoc2009-draci/engines/draci/script.h

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-07-25 03:28:04 UTC (rev 42731)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-07-25 03:37:22 UTC (rev 42732)
@@ -67,9 +67,9 @@
 		{ 13, 1, "FadePalette", 		3, { 1, 1, 1 }, NULL },
 		{ 13, 2, "FadePalettePlay", 	3, { 1, 1, 1 }, NULL },
 		{ 14, 1, "NewRoom", 			2, { 3, 1 }, NULL },
-		{ 15, 1, "ExecInit", 			1, { 3 }, NULL },
-		{ 15, 2, "ExecLook", 			1, { 3 }, NULL },
-		{ 15, 3, "ExecUse", 			1, { 3 }, NULL },
+		{ 15, 1, "ExecInit", 			1, { 3 }, &Script::execInit },
+		{ 15, 2, "ExecLook", 			1, { 3 }, &Script::execLook },
+		{ 15, 3, "ExecUse", 			1, { 3 }, &Script::execUse },
 		{ 16, 1, "RepaintInventory", 	0, { 0 }, NULL },
 		{ 16, 2, "ExitInventory", 		0, { 0 }, NULL },
 		{ 17, 1, "ExitMap", 			0, { 0 }, NULL },
@@ -369,6 +369,39 @@
 	}	
 }
 
+void Script::execInit(Common::Queue<int> &params) {
+	if (_vm->_game->getLoopStatus() == kStatusInventory) {
+		return;
+	}
+
+	int objID = params.pop() - 1;
+
+	GameObject *obj = _vm->_game->getObject(objID);
+	run(obj->_program, obj->_init);
+}
+
+void Script::execLook(Common::Queue<int> &params) {
+	if (_vm->_game->getLoopStatus() == kStatusInventory) {
+		return;
+	}
+
+	int objID = params.pop() - 1;
+
+	GameObject *obj = _vm->_game->getObject(objID);
+	run(obj->_program, obj->_look);
+}
+
+void Script::execUse(Common::Queue<int> &params) {
+	if (_vm->_game->getLoopStatus() == kStatusInventory) {
+		return;
+	}
+
+	int objID = params.pop() - 1;
+
+	GameObject *obj = _vm->_game->getObject(objID);
+	run(obj->_program, obj->_use);
+}
+
 /**
  * @brief Evaluates mathematical expressions
  * @param reader Stream reader set to the beginning of the expression

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-07-25 03:28:04 UTC (rev 42731)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-07-25 03:37:22 UTC (rev 42732)
@@ -108,6 +108,9 @@
 	void release(Common::Queue<int> &params);
 	void objStat(Common::Queue<int> &params);
 	void objStatOn(Common::Queue<int> &params);
+	void execInit(Common::Queue<int> &params);
+	void execLook(Common::Queue<int> &params);
+	void execUse(Common::Queue<int> &params);
 
 	int operAnd(int op1, int op2);
 	int operOr(int op1, int op2);


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