diff options
author | strangerke | 2011-04-17 09:33:53 +0200 |
---|---|---|
committer | strangerke | 2011-04-17 09:33:53 +0200 |
commit | e2f34d19c88a9a0b37c57afbaa07d44c85f1f205 (patch) | |
tree | c108d287a20e046018c97e867407b65bdc7f5429 /engines | |
parent | e9a1035f521a8a0acb024706306d748cbc7a0f04 (diff) | |
download | scummvm-rg350-e2f34d19c88a9a0b37c57afbaa07d44c85f1f205.tar.gz scummvm-rg350-e2f34d19c88a9a0b37c57afbaa07d44c85f1f205.tar.bz2 scummvm-rg350-e2f34d19c88a9a0b37c57afbaa07d44c85f1f205.zip |
TSAGE: Add flag commands to the debugger
Diffstat (limited to 'engines')
-rw-r--r-- | engines/tsage/debugger.cpp | 50 | ||||
-rw-r--r-- | engines/tsage/debugger.h | 4 |
2 files changed, 54 insertions, 0 deletions
diff --git a/engines/tsage/debugger.cpp b/engines/tsage/debugger.cpp index 9f4d197377..730a8f2db1 100644 --- a/engines/tsage/debugger.cpp +++ b/engines/tsage/debugger.cpp @@ -37,6 +37,10 @@ Debugger::Debugger() : GUI::Debugger() { DCmd_Register("scene", WRAP_METHOD(Debugger, Cmd_Scene)); DCmd_Register("walk_regions", WRAP_METHOD(Debugger, Cmd_WalkRegions)); DCmd_Register("priority_regions", WRAP_METHOD(Debugger, Cmd_PriorityRegions)); + DCmd_Register("setflag", WRAP_METHOD(Debugger, Cmd_SetFlag)); + DCmd_Register("getflag", WRAP_METHOD(Debugger, Cmd_GetFlag)); + DCmd_Register("clearflag", WRAP_METHOD(Debugger, Cmd_ClearFlag)); + DCmd_Register("item", WRAP_METHOD(Debugger, Cmd_Item)); } @@ -161,6 +165,51 @@ bool Debugger::Cmd_PriorityRegions(int argc, const char **argv) { return true; } +/* + * This command sets a flag + */ +bool Debugger::Cmd_SetFlag(int argc, const char **argv) { + // Check for a flag to set + if (argc != 2) { + DebugPrintf("Usage: %s <flag number>\n", argv[0]); + return true; + } + + int flagNum = strToInt(argv[1]); + _globals->setFlag(flagNum); + return true; +} + +/* + * This command gets the value of a flag + */ +bool Debugger::Cmd_GetFlag(int argc, const char **argv) { + // Check for an flag to display + if (argc != 2) { + DebugPrintf("Usage: %s <flag number>\n", argv[0]); + return true; + } + + int flagNum = strToInt(argv[1]); + DebugPrintf("Value: %d\n", _globals->getFlag(flagNum)); + return true; +} + +/* + * This command clears a flag + */ +bool Debugger::Cmd_ClearFlag(int argc, const char **argv) { + // Check for a flag to clear + if (argc != 2) { + DebugPrintf("Usage: %s <flag number>\n", argv[0]); + return true; + } + + int flagNum = strToInt(argv[1]); + _globals->clearFlag(flagNum); + return true; +} + /** * Give a specified item to the player */ @@ -169,4 +218,5 @@ bool Debugger::Cmd_Item(int argc, const char **argv) { return true; } + } // End of namespace tSage diff --git a/engines/tsage/debugger.h b/engines/tsage/debugger.h index c94d77b2ab..ee097e17bf 100644 --- a/engines/tsage/debugger.h +++ b/engines/tsage/debugger.h @@ -41,6 +41,10 @@ protected: bool Cmd_WalkRegions(int argc, const char **argv); bool Cmd_PriorityRegions(int argc, const char **argv); bool Cmd_Item(int argc, const char **argv); + bool Cmd_SetFlag(int argc, const char **argv); + bool Cmd_GetFlag(int argc, const char **argv); + bool Cmd_ClearFlag(int argc, const char **argv); + }; } // End of namespace tSage |