diff options
author | Alyssa Milburn | 2011-01-22 11:37:37 +0000 |
---|---|---|
committer | Alyssa Milburn | 2011-01-22 11:37:37 +0000 |
commit | 86b90fe8a69868d1b28009e36730523652a69d17 (patch) | |
tree | b1b1de423619feb3ca74471417bf0546dc971307 | |
parent | e23fef92ddecb5a2b7748ab6d64989fd7c28fe38 (diff) | |
download | scummvm-rg350-86b90fe8a69868d1b28009e36730523652a69d17.tar.gz scummvm-rg350-86b90fe8a69868d1b28009e36730523652a69d17.tar.bz2 scummvm-rg350-86b90fe8a69868d1b28009e36730523652a69d17.zip |
MOHAWK: Add some debug commands for CSTime.
svn-id: r55417
-rw-r--r-- | engines/mohawk/console.cpp | 52 | ||||
-rw-r--r-- | engines/mohawk/console.h | 4 |
2 files changed, 56 insertions, 0 deletions
diff --git a/engines/mohawk/console.cpp b/engines/mohawk/console.cpp index 146fc5e77b..a59e9dfb55 100644 --- a/engines/mohawk/console.cpp +++ b/engines/mohawk/console.cpp @@ -709,6 +709,10 @@ CSTimeConsole::CSTimeConsole(MohawkEngine_CSTime *vm) : GUI::Debugger(), _vm(vm) DCmd_Register("stopSound", WRAP_METHOD(CSTimeConsole, Cmd_StopSound)); DCmd_Register("drawImage", WRAP_METHOD(CSTimeConsole, Cmd_DrawImage)); DCmd_Register("drawSubimage", WRAP_METHOD(CSTimeConsole, Cmd_DrawSubimage)); + DCmd_Register("changeCase", WRAP_METHOD(CSTimeConsole, Cmd_ChangeCase)); + DCmd_Register("changeScene", WRAP_METHOD(CSTimeConsole, Cmd_ChangeScene)); + DCmd_Register("caseVariable", WRAP_METHOD(CSTimeConsole, Cmd_CaseVariable)); + DCmd_Register("invItem", WRAP_METHOD(CSTimeConsole, Cmd_InvItem)); } CSTimeConsole::~CSTimeConsole() { @@ -754,4 +758,52 @@ bool CSTimeConsole::Cmd_DrawSubimage(int argc, const char **argv) { return false; } +bool CSTimeConsole::Cmd_ChangeCase(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Usage: changeCase <value>\n"); + return true; + } + + error("Can't change case yet"); // FIXME + return false; +} + +bool CSTimeConsole::Cmd_ChangeScene(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Usage: changeScene <value>\n"); + return true; + } + + _vm->addEvent(CSTimeEvent(kCSTimeEventNewScene, 0xffff, atoi(argv[1]))); + return false; +} + +bool CSTimeConsole::Cmd_CaseVariable(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Usage: caseVariable <id> [<value>]\n"); + return true; + } + + if (argc == 2) { + DebugPrintf("case variable %d has value %d\n", atoi(argv[1]), _vm->_caseVariable[atoi(argv[1])]); + } else { + _vm->_caseVariable[atoi(argv[1])] = atoi(argv[2]); + } + return true; +} + +bool CSTimeConsole::Cmd_InvItem(int argc, const char **argv) { + if (argc < 3) { + DebugPrintf("Usage: invItem <id> <0 or 1>\n"); + return true; + } + + if (atoi(argv[2])) { + _vm->addEvent(CSTimeEvent(kCSTimeEventDropItemInInventory, 0xffff, atoi(argv[1]))); + } else { + _vm->addEvent(CSTimeEvent(kCSTimeEventRemoveItemFromInventory, 0xffff, atoi(argv[1]))); + } + return false; +} + } // End of namespace Mohawk diff --git a/engines/mohawk/console.h b/engines/mohawk/console.h index f199856cab..1dfd0bd318 100644 --- a/engines/mohawk/console.h +++ b/engines/mohawk/console.h @@ -112,6 +112,10 @@ private: bool Cmd_StopSound(int argc, const char **argv); bool Cmd_DrawImage(int argc, const char **argv); bool Cmd_DrawSubimage(int argc, const char **argv); + bool Cmd_ChangeCase(int argc, const char **argv); + bool Cmd_ChangeScene(int argc, const char **argv); + bool Cmd_CaseVariable(int argc, const char **argv); + bool Cmd_InvItem(int argc, const char **argv); }; } // End of namespace Mohawk |