[Scummvm-cvs-logs] SF.net SVN: scummvm: [29230] scummvm/trunk/engines/parallaction
peres001 at users.sourceforge.net
peres001 at users.sourceforge.net
Fri Oct 19 22:27:10 CEST 2007
Revision: 29230
http://scummvm.svn.sourceforge.net/scummvm/?rev=29230&view=rev
Author: peres001
Date: 2007-10-19 13:27:10 -0700 (Fri, 19 Oct 2007)
Log Message:
-----------
Added new debugger command 'localflags' and changed Table object to provide debug info for it.
Modified Paths:
--------------
scummvm/trunk/engines/parallaction/debug.cpp
scummvm/trunk/engines/parallaction/debug.h
scummvm/trunk/engines/parallaction/objects.cpp
scummvm/trunk/engines/parallaction/objects.h
Modified: scummvm/trunk/engines/parallaction/debug.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/debug.cpp 2007-10-17 19:45:23 UTC (rev 29229)
+++ scummvm/trunk/engines/parallaction/debug.cpp 2007-10-19 20:27:10 UTC (rev 29230)
@@ -67,8 +67,8 @@
DCmd_Register("jobs", WRAP_METHOD(Debugger, Cmd_Jobs));
DCmd_Register("zones", WRAP_METHOD(Debugger, Cmd_Zones));
DCmd_Register("animations", WRAP_METHOD(Debugger, Cmd_Animations));
+ DCmd_Register("localflags", WRAP_METHOD(Debugger, Cmd_LocalFlags));
-
}
@@ -109,6 +109,25 @@
}
+bool Debugger::Cmd_LocalFlags(int argc, const char **argv) {
+
+ JobList::iterator b = _vm->_jobs.begin();
+ JobList::iterator e = _vm->_jobs.end();
+
+ uint32 flags = _vm->_localFlags[_vm->_currentLocationIndex];
+
+ DebugPrintf("+------------------------------+---------+\n"
+ "| flag name | value |\n"
+ "+------------------------------+---------+\n");
+ for (uint i = 0; i < _vm->_localFlagNames->count(); i++) {
+ const char *value = ((flags & (1 << i)) == 0) ? "OFF" : "ON";
+ DebugPrintf("|%-30s|% -6s|\n", _vm->_localFlagNames->item(i), value);
+ }
+ DebugPrintf("+------------------------------+---------+\n");
+
+ return true;
+}
+
bool Debugger::Cmd_Give(int argc, const char **argv) {
if (argc == 1) {
Modified: scummvm/trunk/engines/parallaction/debug.h
===================================================================
--- scummvm/trunk/engines/parallaction/debug.h 2007-10-17 19:45:23 UTC (rev 29229)
+++ scummvm/trunk/engines/parallaction/debug.h 2007-10-19 20:27:10 UTC (rev 29230)
@@ -25,7 +25,7 @@
bool Cmd_Jobs(int argc, const char **argv);
bool Cmd_Zones(int argc, const char **argv);
bool Cmd_Animations(int argc, const char **argv);
-
+ bool Cmd_LocalFlags(int argc, const char **argv);
};
} // End of namespace Parallaction
Modified: scummvm/trunk/engines/parallaction/objects.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/objects.cpp 2007-10-17 19:45:23 UTC (rev 29229)
+++ scummvm/trunk/engines/parallaction/objects.cpp 2007-10-19 20:27:10 UTC (rev 29230)
@@ -381,6 +381,12 @@
_used = 0;
}
+const char *Table::item(uint index) const {
+ assert(index < _used);
+ return _data[index];
+}
+
+
FixedTable::FixedTable(uint32 size, uint32 fixed) : Table(size), _numFixed(fixed) {
}
Modified: scummvm/trunk/engines/parallaction/objects.h
===================================================================
--- scummvm/trunk/engines/parallaction/objects.h 2007-10-17 19:45:23 UTC (rev 29229)
+++ scummvm/trunk/engines/parallaction/objects.h 2007-10-19 20:27:10 UTC (rev 29230)
@@ -442,6 +442,9 @@
notFound = 0
};
+ uint count() const { return _used; }
+ const char *item(uint index) const;
+
virtual void addData(const char* s);
virtual void clear();
virtual uint16 lookup(const char* s);
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