diff options
author | Filippos Karapetis | 2017-03-15 10:20:07 +0200 |
---|---|---|
committer | Filippos Karapetis | 2017-03-15 10:28:58 +0200 |
commit | 6c17fc85ad3de5689b055e193d89c60dd56c9095 (patch) | |
tree | b12e837a928fe2427fd3b3359ee90aed99394686 /engines | |
parent | ef992f26bb431d184b8bfc29d3c7a554433521c6 (diff) | |
download | scummvm-rg350-6c17fc85ad3de5689b055e193d89c60dd56c9095.tar.gz scummvm-rg350-6c17fc85ad3de5689b055e193d89c60dd56c9095.tar.bz2 scummvm-rg350-6c17fc85ad3de5689b055e193d89c60dd56c9095.zip |
CHEWY: Add a command to draw sprites on screen to the debugger
Diffstat (limited to 'engines')
-rw-r--r-- | engines/chewy/console.cpp | 23 | ||||
-rw-r--r-- | engines/chewy/console.h | 3 |
2 files changed, 22 insertions, 4 deletions
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp index 6fbd99278f..65c4a681d6 100644 --- a/engines/chewy/console.cpp +++ b/engines/chewy/console.cpp @@ -35,7 +35,8 @@ namespace Chewy { Console::Console(ChewyEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("dump", WRAP_METHOD(Console, Cmd_Dump)); registerCmd("dump_bg", WRAP_METHOD(Console, Cmd_DumpBg)); - registerCmd("draw", WRAP_METHOD(Console, Cmd_Draw)); + registerCmd("draw_image", WRAP_METHOD(Console, Cmd_DrawImage)); + registerCmd("draw_sprite", WRAP_METHOD(Console, Cmd_DrawSprite)); registerCmd("play_sound", WRAP_METHOD(Console, Cmd_PlaySound)); registerCmd("play_speech", WRAP_METHOD(Console, Cmd_PlaySpeech)); registerCmd("play_music", WRAP_METHOD(Console, Cmd_PlayMusic)); @@ -104,9 +105,9 @@ bool Console::Cmd_DumpBg(int argc, const char **argv) { } -bool Console::Cmd_Draw(int argc, const char **argv) { +bool Console::Cmd_DrawImage(int argc, const char **argv) { if (argc < 3) { - debugPrintf("Usage: draw <file> <resource number>\n"); + debugPrintf("Usage: draw_image <file> <resource number>\n"); return true; } @@ -118,6 +119,22 @@ bool Console::Cmd_Draw(int argc, const char **argv) { return false; } +bool Console::Cmd_DrawSprite(int argc, const char **argv) { + if (argc < 3) { + debugPrintf("Usage: draw_sprite <file> <resource number> [x] [y]\n"); + return true; + } + + Common::String filename = argv[1]; + int spriteNum = atoi(argv[2]); + int x = (argc < 4) ? 0 : atoi(argv[3]); + int y = (argc < 5) ? 0 : atoi(argv[4]); + + _vm->_graphics->drawSprite(filename, spriteNum, x, y); + + return false; +} + bool Console::Cmd_PlaySound(int argc, const char **argv) { if (argc < 2) { debugPrintf("Usage: play_sound <number>\n"); diff --git a/engines/chewy/console.h b/engines/chewy/console.h index ae2be15f30..2ceb1df4e6 100644 --- a/engines/chewy/console.h +++ b/engines/chewy/console.h @@ -39,7 +39,8 @@ private: bool Cmd_Dump(int argc, const char **argv); bool Cmd_DumpBg(int argc, const char **argv); - bool Cmd_Draw(int argc, const char **argv); + bool Cmd_DrawImage(int argc, const char **argv); + bool Cmd_DrawSprite(int argc, const char **argv); bool Cmd_PlaySound(int argc, const char **argv); bool Cmd_PlaySpeech(int argc, const char **argv); bool Cmd_PlayMusic(int argc, const char **argv); |