[Scummvm-cvs-logs] SF.net SVN: scummvm: [24663] scummvm/trunk/engines/agos

kirben at users.sourceforge.net kirben at users.sourceforge.net
Thu Nov 9 11:41:40 CET 2006


Revision: 24663
          http://svn.sourceforge.net/scummvm/?rev=24663&view=rev
Author:   kirben
Date:     2006-11-09 02:41:29 -0800 (Thu, 09 Nov 2006)

Log Message:
-----------
Add debugger command, to allow object flag vlaues to be altered.

Modified Paths:
--------------
    scummvm/trunk/engines/agos/debugger.cpp
    scummvm/trunk/engines/agos/debugger.h

Modified: scummvm/trunk/engines/agos/debugger.cpp
===================================================================
--- scummvm/trunk/engines/agos/debugger.cpp	2006-11-09 05:28:36 UTC (rev 24662)
+++ scummvm/trunk/engines/agos/debugger.cpp	2006-11-09 10:41:29 UTC (rev 24663)
@@ -41,6 +41,7 @@
 	DCmd_Register("voice",    WRAP_METHOD(Debugger, Cmd_PlayVoice));
 	DCmd_Register("bit",      WRAP_METHOD(Debugger, Cmd_SetBit));
 	DCmd_Register("var",      WRAP_METHOD(Debugger, Cmd_SetVar));
+	DCmd_Register("obj",      WRAP_METHOD(Debugger, Cmd_SetObjectFlag));
 	DCmd_Register("sub",      WRAP_METHOD(Debugger, Cmd_StartSubroutine));
 
 }
@@ -162,6 +163,41 @@
 	return true;
 }
 
+bool Debugger::Cmd_SetObjectFlag(int argc, const char **argv) {
+	uint obj, prop, value;
+	if (argc > 2) {
+		obj = atoi(argv[1]);
+		prop = atoi(argv[2]);
+
+		if (obj >= 1 && obj < _vm->_itemArraySize) {
+			SubObject *o = (SubObject *)_vm->findChildOfType(_vm->derefItem(obj), 2);
+			if (o != NULL) {
+				if (o->objectFlags & (1 << prop) && prop < 16) {
+					uint offs = _vm->getOffsetOfChild2Param(o, 1 << prop);
+					if (argc > 3) {
+						value = atoi(argv[3]);
+						o->objectFlagValue[offs] = value;
+						DebugPrintf("Object %d Flag %d set to %d\n", obj, prop, value);
+					} else {
+						value = o->objectFlagValue[offs];
+						DebugPrintf("Object %d Flag %d is %d\n", obj, prop, value);
+					}
+				} else {
+					DebugPrintf("Object flag out of range\n");
+				}
+			} else {
+				DebugPrintf("Item isn't an object\n");
+			}
+		} else {
+			DebugPrintf("Item out of range (1 - %d)\n", _vm->_itemArraySize - 1);
+		}
+	} else {
+		DebugPrintf("Syntax: obj <itemnum> <flag> <value>\n");
+	}
+
+	return true;
+}
+
 bool Debugger::Cmd_StartSubroutine(int argc, const char **argv) {
 	if (argc > 1) {
 		uint subroutine = atoi(argv[1]);

Modified: scummvm/trunk/engines/agos/debugger.h
===================================================================
--- scummvm/trunk/engines/agos/debugger.h	2006-11-09 05:28:36 UTC (rev 24662)
+++ scummvm/trunk/engines/agos/debugger.h	2006-11-09 10:41:29 UTC (rev 24663)
@@ -47,6 +47,7 @@
 	bool Cmd_PlayVoice(int argc, const char **argv);
 	bool Cmd_SetBit(int argc, const char **argv);
 	bool Cmd_SetVar(int argc, const char **argv);
+	bool Cmd_SetObjectFlag(int argc, const char **argv);
 	bool Cmd_StartSubroutine(int argc, const char **argv);
 };
 


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