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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sat Jul 25 04:23:00 CEST 2009


Revision: 42730
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42730&view=rev
Author:   dkasak13
Date:     2009-07-25 02:23:00 +0000 (Sat, 25 Jul 2009)

Log Message:
-----------
* Added handlers for the ObjStat and ObjStat_On GPL commands
* Removed temporary hack I accidentally committed

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

Modified: scummvm/branches/gsoc2009-draci/engines/draci/game.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/game.h	2009-07-25 01:01:41 UTC (rev 42729)
+++ scummvm/branches/gsoc2009-draci/engines/draci/game.h	2009-07-25 02:23:00 UTC (rev 42730)
@@ -134,9 +134,6 @@
 
 class Game {
 
-	// HACK: Remove this before committing; if anyone sees this, remind me :D
-	friend class Animation;
-
 public:
 
 	Game(DraciEngine *vm);

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.cpp
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-07-25 01:01:41 UTC (rev 42729)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-07-25 02:23:00 UTC (rev 42730)
@@ -50,8 +50,8 @@
 		{ 5,  3, "JustTalk", 			0, { 0 }, NULL },
 		{ 5,  4, "JustStay", 			0, { 0 }, NULL },
 		{ 6,  1, "Talk", 				2, { 3, 2 }, NULL },
-		{ 7,  1, "ObjStat", 			2, { 3, 3 }, NULL },
-		{ 7,  2, "ObjStat_On", 			2, { 3, 3 }, NULL },
+		{ 7,  1, "ObjStat", 			2, { 3, 3 }, &Script::objStat },
+		{ 7,  2, "ObjStat_On", 			2, { 3, 3 }, &Script::objStatOn },
 		{ 8,  1, "IcoStat", 			2, { 3, 3 }, NULL },
 		{ 9,  1, "Dialogue", 			1, { 2 }, NULL },
 		{ 9,  2, "ExitDialogue", 		0, { 0 }, NULL },
@@ -249,7 +249,7 @@
 	GameObject *obj = _vm->_game->getObject(objID);
 
 	// We index locations from 0 (as opposed to the original player where it was from 1)
-	// That's why the "invalid" location 0 from the data files is converted to -1
+	// That's why the "away" location 0 from the data files is converted to -1
 	return !obj->_visible && obj->_location != -1;
 }
 
@@ -331,6 +331,36 @@
 	_vm->_anims->deleteAfterIndex(markedIndex);
 }
 
+void Script::objStatOn(Common::Queue<int> &params) {
+	int objID = params.pop() - 1;
+	int roomID = params.pop() - 1;
+
+	GameObject *obj = _vm->_game->getObject(objID);
+
+	obj->_location = roomID;
+	obj->_visible = true;
+}
+
+void Script::objStat(Common::Queue<int> &params) {
+	int status = params.pop();
+	int objID = params.pop() - 1;
+
+	GameObject *obj = _vm->_game->getObject(objID);
+
+	if (status == 1) {
+		return;
+	} else if (status == 2) {
+		obj->_visible = false;
+	} else {
+		obj->_visible = false;
+		obj->_location = -1;
+	}
+		
+	for (uint i = 0; i < obj->_anims.size(); ++i) {
+		_vm->_anims->stop(obj->_anims[i]);
+	}	
+}
+
 /**
  * @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 01:01:41 UTC (rev 42729)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-07-25 02:23:00 UTC (rev 42730)
@@ -106,6 +106,8 @@
 	void start(Common::Queue<int> &params);
 	void mark(Common::Queue<int> &params);
 	void release(Common::Queue<int> &params);
+	void objStat(Common::Queue<int> &params);
+	void objStatOn(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