diff options
-rw-r--r-- | engines/adl/console.cpp | 17 | ||||
-rw-r--r-- | engines/adl/console.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/engines/adl/console.cpp b/engines/adl/console.cpp index af16330ed0..94d0a73e84 100644 --- a/engines/adl/console.cpp +++ b/engines/adl/console.cpp @@ -38,6 +38,7 @@ Console::Console(AdlEngine *engine) : GUI::Debugger() { registerCmd("room", WRAP_METHOD(Console, Cmd_Room)); registerCmd("items", WRAP_METHOD(Console, Cmd_Items)); registerCmd("give_item", WRAP_METHOD(Console, Cmd_GiveItem)); + registerCmd("vars", WRAP_METHOD(Console, Cmd_Vars)); } Common::String Console::toAscii(const Common::String &str) { @@ -251,6 +252,22 @@ bool Console::Cmd_GiveItem(int argc, const char **argv) { return true; } +bool Console::Cmd_Vars(int argc, const char **argv) { + if (argc != 1) { + debugPrintf("Usage: %s\n", argv[0]); + return true; + } + + Common::StringArray vars; + for (uint i = 0; i < _engine->_state.vars.size(); ++i) + vars.push_back(Common::String::format("%3d: %3d", i, _engine->_state.vars[i])); + + debugPrintf("Variables:\n"); + debugPrintColumns(vars); + + return true; +} + void Console::printItem(const Item &item) { Common::String name, desc, state; diff --git a/engines/adl/console.h b/engines/adl/console.h index ece9cd0822..13f55fc036 100644 --- a/engines/adl/console.h +++ b/engines/adl/console.h @@ -51,6 +51,7 @@ private: bool Cmd_Room(int argc, const char **argv); bool Cmd_Items(int argc, const char **argv); bool Cmd_GiveItem(int argc, const char **argv); + bool Cmd_Vars(int argc, const char **argv); void printItem(const Item &item); void printWordMap(const Common::HashMap<Common::String, uint> &wordMap); |