aboutsummaryrefslogtreecommitdiff
path: root/engines/parallaction
diff options
context:
space:
mode:
authorNicola Mettifogo2010-05-22 15:56:27 +0000
committerNicola Mettifogo2010-05-22 15:56:27 +0000
commit45a5c29cdf01d7cade0dbfaf7ae2ee92bd75cc56 (patch)
tree4c09ccc61f0f9890776c36283ecccba53bb6df60 /engines/parallaction
parent866e15e8b2b11ae72f3fcb803b57dd770adc6b57 (diff)
downloadscummvm-rg350-45a5c29cdf01d7cade0dbfaf7ae2ee92bd75cc56.tar.gz
scummvm-rg350-45a5c29cdf01d7cade0dbfaf7ae2ee92bd75cc56.tar.bz2
scummvm-rg350-45a5c29cdf01d7cade0dbfaf7ae2ee92bd75cc56.zip
Apply patch 3005433 by fuzzie: new 'toggleglobalflags' command for the debugger.
svn-id: r49141
Diffstat (limited to 'engines/parallaction')
-rw-r--r--engines/parallaction/debug.cpp27
-rw-r--r--engines/parallaction/debug.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index 8864c84e2f..b5eb82b456 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -42,6 +42,7 @@ Debugger::Debugger(Parallaction *vm)
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("toggleglobalflag",WRAP_METHOD(Debugger, Cmd_ToggleGlobalFlag));
DCmd_Register("localflags", WRAP_METHOD(Debugger, Cmd_LocalFlags));
DCmd_Register("locations", WRAP_METHOD(Debugger, Cmd_Locations));
DCmd_Register("gfxobjects", WRAP_METHOD(Debugger, Cmd_GfxObjects));
@@ -117,6 +118,32 @@ bool Debugger::Cmd_GlobalFlags(int argc, const char **argv) {
return true;
}
+bool Debugger::Cmd_ToggleGlobalFlag(int argc, const char **argv) {
+
+ int i;
+
+ switch (argc) {
+ case 2:
+ i = _vm->_globalFlagsNames->lookup(argv[1]);
+ if (i == Table::notFound) {
+ DebugPrintf("invalid flag '%s'\n", argv[1]);
+ } else {
+ i--;
+ if ((_globalFlags & (1 << i)) == 0)
+ _globalFlags |= (1 << i);
+ else
+ _globalFlags &= ~(1 << i);
+ }
+ break;
+
+ default:
+ DebugPrintf("toggleglobalflag <flag name>\n");
+
+ }
+
+ return true;
+}
+
bool Debugger::Cmd_LocalFlags(int argc, const char **argv) {
uint32 flags = _vm->getLocationFlags();
diff --git a/engines/parallaction/debug.h b/engines/parallaction/debug.h
index 54b578e95f..5267206d04 100644
--- a/engines/parallaction/debug.h
+++ b/engines/parallaction/debug.h
@@ -28,6 +28,7 @@ protected:
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_ToggleGlobalFlag(int argc, const char **argv);
bool Cmd_Locations(int argc, const char **argv);
bool Cmd_GfxObjects(int argc, const char **argv);
bool Cmd_Programs(int argc, const char** argv);