aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2016-09-19 09:49:50 +0300
committerFilippos Karapetis2016-10-03 00:33:08 +0300
commit8970473f6c439496cc3c5d65539df680e1795916 (patch)
tree2ab5aaae55a8ac3ba18fe73f9f0f443d908e5dcd /engines
parent3a5cd65d6d03c2e2f17656571f8528ef6ea8f039 (diff)
downloadscummvm-rg350-8970473f6c439496cc3c5d65539df680e1795916.tar.gz
scummvm-rg350-8970473f6c439496cc3c5d65539df680e1795916.tar.bz2
scummvm-rg350-8970473f6c439496cc3c5d65539df680e1795916.zip
CHEWY: Add a "draw" console command to draw game images
Diffstat (limited to 'engines')
-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