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

dkasak13 at users.sourceforge.net dkasak13 at users.sourceforge.net
Sun Aug 9 18:58:04 CEST 2009


Revision: 43176
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43176&view=rev
Author:   dkasak13
Date:     2009-08-09 16:58:04 +0000 (Sun, 09 Aug 2009)

Log Message:
-----------
Implemented GPL function Script::funcObjStat().

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-08-09 16:42:14 UTC (rev 43175)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.cpp	2009-08-09 16:58:04 UTC (rev 43176)
@@ -125,7 +125,7 @@
 		{ "IsObjOn", 	&Script::funcIsObjOn },
 		{ "IsObjOff", 	&Script::funcIsObjOff },
 		{ "IsObjAway", 	&Script::funcIsObjAway },
-		{ "ObjStat", 	NULL },
+		{ "ObjStat", 	&Script::funcObjStat },
 		{ "LastBlock", 	NULL },
 		{ "AtBegin", 	NULL },
 		{ "BlockVar", 	NULL },
@@ -269,6 +269,22 @@
 	return !obj->_visible && obj->_location != -1;
 }
 
+int Script::funcObjStat(int objID) {
+	objID -= 1;
+
+	GameObject *obj = _vm->_game->getObject(objID);
+
+	if (obj->_location == _vm->_game->getRoomNum()) {
+		if (obj->_visible) {
+			return 1; 	// object is ON (in the room and visible)
+		} else {
+			return 2; 	// object is OFF (in the room, not visible)
+		}
+	} else {
+		return 3; 		// object is AWAY (not in the room)
+	}
+}
+
 int Script::funcIsObjAway(int objID) {
 	objID -= 1;
 

Modified: scummvm/branches/gsoc2009-draci/engines/draci/script.h
===================================================================
--- scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-08-09 16:42:14 UTC (rev 43175)
+++ scummvm/branches/gsoc2009-draci/engines/draci/script.h	2009-08-09 16:58:04 UTC (rev 43176)
@@ -147,6 +147,7 @@
 	int funcIsObjOff(int objID);
 	int funcIsObjAway(int objID);
 	int funcActPhase(int objID);
+	int funcObjStat(int objID);
 
 
 	void setupCommandList();


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