aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/chewy/console.cpp23
-rw-r--r--engines/chewy/console.h1
2 files changed, 22 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
diff --git a/engines/chewy/console.h b/engines/chewy/console.h
index cce736bed2..352847455d 100644
--- a/engines/chewy/console.h
+++ b/engines/chewy/console.h
@@ -38,6 +38,7 @@ private:
ChewyEngine *_vm;
bool Cmd_Dump(int argc, const char **argv);
+ bool Cmd_Draw(int argc, const char **argv);
};
} // End of namespace Chewy