diff options
Diffstat (limited to 'engines/chewy/console.cpp')
-rw-r--r-- | engines/chewy/console.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp index 3e9c46f038..dab5d5a113 100644 --- a/engines/chewy/console.cpp +++ b/engines/chewy/console.cpp @@ -20,15 +20,18 @@ * */ -#include "chewy/console.h" #include "gui/debugger.h" + #include "chewy/chewy.h" +#include "chewy/console.h" +#include "chewy/graphics.h" #include "chewy/resource.h" namespace Chewy { - Console::Console(ChewyEngine *vm) : GUI::Debugger(), _vm(vm) { +Console::Console(ChewyEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("dump", WRAP_METHOD(Console, Cmd_Dump)); + registerCmd("draw", WRAP_METHOD(Console, Cmd_Draw)); } Console::~Console() { @@ -60,4 +63,20 @@ bool Console::Cmd_Dump(int argc, const char **argv) { return true; } +bool Console::Cmd_Draw(int argc, const char **argv) { + if (argc < 3) { + debugPrintf("Usage: draw <file> <resource number>\n"); + return true; + } + + Common::String filename = argv[1]; + int resNum = atoi(argv[2]); + + Graphics *g = new Graphics(); + g->drawImage(filename, resNum); + delete g; + + return false; +} + } // End of namespace Chewy |