diff options
author | Walter van Niftrik | 2016-04-01 20:27:29 +0200 |
---|---|---|
committer | Walter van Niftrik | 2016-06-06 20:35:49 +0200 |
commit | ff4b9fcd9c50204cf31703d56ec55164f5646ba4 (patch) | |
tree | 160381e4fd1ff1b62d157dac4cf3f5093ebe8c95 /engines/adl | |
parent | 1d314b20841d78ebbce2652ec874fb131cf9cf36 (diff) | |
download | scummvm-rg350-ff4b9fcd9c50204cf31703d56ec55164f5646ba4.tar.gz scummvm-rg350-ff4b9fcd9c50204cf31703d56ec55164f5646ba4.tar.bz2 scummvm-rg350-ff4b9fcd9c50204cf31703d56ec55164f5646ba4.zip |
ADL: Add 'vars' debug command
Diffstat (limited to 'engines/adl')
-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); |