From c3dc59229371cba8113c7ac5bdedf7bb37f6670d Mon Sep 17 00:00:00 2001 From: Alyssa Milburn Date: Fri, 21 May 2010 17:58:30 +0200 Subject: [PATCH] add toggleglobalflag to parallaction's debugger --- engines/parallaction/debug.cpp | 27 +++++++++++++++++++++++++++ engines/parallaction/debug.h | 1 + 2 files changed, 28 insertions(+), 0 deletions(-) diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp index 8864c84..b5eb82b 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 \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 54b578e..5267206 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); -- 1.6.3.3