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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Tue Feb 5 10:25:25 CET 2008


Revision: 30794
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30794&view=rev
Author:   peres001
Date:     2008-02-05 01:25:25 -0800 (Tue, 05 Feb 2008)

Log Message:
-----------
Added new debug command to show global game flags.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/debug.cpp
    scummvm/trunk/engines/parallaction/debug.h

Modified: scummvm/trunk/engines/parallaction/debug.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/debug.cpp	2008-02-05 08:16:52 UTC (rev 30793)
+++ scummvm/trunk/engines/parallaction/debug.cpp	2008-02-05 09:25:25 UTC (rev 30794)
@@ -41,6 +41,7 @@
 	DCmd_Register("give",		WRAP_METHOD(Debugger, Cmd_Give));
 	DCmd_Register("zones",		WRAP_METHOD(Debugger, Cmd_Zones));
 	DCmd_Register("animations",	WRAP_METHOD(Debugger, Cmd_Animations));
+	DCmd_Register("globalflags",WRAP_METHOD(Debugger, Cmd_GlobalFlags));
 	DCmd_Register("localflags",	WRAP_METHOD(Debugger, Cmd_LocalFlags));
 	DCmd_Register("locations",	WRAP_METHOD(Debugger, Cmd_Locations));
 	DCmd_Register("gfxobjects",	WRAP_METHOD(Debugger, Cmd_GfxObjects));
@@ -96,6 +97,22 @@
 	return true;
 }
 
+bool Debugger::Cmd_GlobalFlags(int argc, const char **argv) {
+
+	uint32 flags = _commandFlags;
+
+	DebugPrintf("+------------------------------+---------+\n"
+				"| flag name                    |  value  |\n"
+				"+------------------------------+---------+\n");
+	for (uint i = 0; i < _vm->_globalTable->count(); i++) {
+		const char *value = ((flags & (1 << i)) == 0) ? "OFF" : "ON";
+		DebugPrintf("|%-30s|   %-6s|\n", _vm->_globalTable->item(i),  value);
+	}
+	DebugPrintf("+------------------------------+---------+\n");
+
+	return true;
+}
+
 bool Debugger::Cmd_LocalFlags(int argc, const char **argv) {
 
 	uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex];

Modified: scummvm/trunk/engines/parallaction/debug.h
===================================================================
--- scummvm/trunk/engines/parallaction/debug.h	2008-02-05 08:16:52 UTC (rev 30793)
+++ scummvm/trunk/engines/parallaction/debug.h	2008-02-05 09:25:25 UTC (rev 30794)
@@ -25,6 +25,7 @@
 	bool Cmd_Zones(int argc, const char **argv);
 	bool Cmd_Animations(int argc, const char **argv);
 	bool Cmd_LocalFlags(int argc, const char **argv);
+	bool Cmd_GlobalFlags(int argc, const char **argv);
 	bool Cmd_Locations(int argc, const char **argv);
 	bool Cmd_GfxObjects(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