From be9507fcb1851966ee58539abc8825dd6859b188 Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Tue, 5 Jan 2010 21:03:33 +0000 Subject: SCI: implemented new debug command "draw_cel" svn-id: r47043 --- engines/sci/console.cpp | 29 ++++++++++++++++++++--------- engines/sci/console.h | 1 + 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp index c92c72a13a..2e179a7cb9 100644 --- a/engines/sci/console.cpp +++ b/engines/sci/console.cpp @@ -109,6 +109,7 @@ Console::Console(SciEngine *vm) : GUI::Debugger() { DCmd_Register("show_map", WRAP_METHOD(Console, cmdShowMap)); // Graphics DCmd_Register("draw_pic", WRAP_METHOD(Console, cmdDrawPic)); + DCmd_Register("draw_cel", WRAP_METHOD(Console, cmdDrawCel)); DCmd_Register("undither", WRAP_METHOD(Console, cmdUndither)); DCmd_Register("play_video", WRAP_METHOD(Console, cmdPlayVideo)); // Segments @@ -307,6 +308,7 @@ bool Console::cmdHelp(int argc, const char **argv) { DebugPrintf("\n"); DebugPrintf("Graphics:\n"); DebugPrintf(" draw_pic - Draws a pic resource\n"); + DebugPrintf(" draw_cel - Draws a cel from a view resource\n"); DebugPrintf(" undither - Enable/disable undithering\n"); DebugPrintf("\n"); DebugPrintf("Segments:\n"); @@ -972,23 +974,32 @@ bool Console::cmdParserNodes(int argc, const char **argv) { bool Console::cmdDrawPic(int argc, const char **argv) { if (argc < 2) { DebugPrintf("Draws a pic resource\n"); - DebugPrintf("Usage: %s \n", argv[0]); - DebugPrintf("where is the number of the pic resource to draw\n"); + DebugPrintf("Usage: %s \n", argv[0]); + DebugPrintf("where is the number of the pic resource to draw\n"); return true; } - char *offsetStr = NULL; - uint16 resourceId = strtol(argv[1], &offsetStr, 10); + uint16 resourceId = atoi(argv[1]); + + _vm->_gamestate->_gui->drawPicture(resourceId, 100, false, false, false, 0); + _vm->_gamestate->_gui->animateShowPic(); + return true; +} - if (*offsetStr) { - DebugPrintf("Invalid resourceId\n"); +bool Console::cmdDrawCel(int argc, const char **argv) { + if (argc < 4) { + DebugPrintf("Draws a cel from a view resource\n"); + DebugPrintf("Usage: %s \n", argv[0]); + DebugPrintf("where is the number of the view resource to draw\n"); return true; } - _vm->_gamestate->_gui->drawPicture(resourceId, 100, false, false, false, 0); - _vm->_gamestate->_gui->animateShowPic(); + uint16 resourceId = atoi(argv[1]); + uint16 loopNo = atoi(argv[2]); + uint16 celNo = atoi(argv[3]); - return false; + _vm->_gamestate->_gui->drawCel(resourceId, loopNo, celNo, 50, 50, 0, 0); + return true; } bool Console::cmdUndither(int argc, const char **argv) { diff --git a/engines/sci/console.h b/engines/sci/console.h index a292e126ae..5509bb05c6 100644 --- a/engines/sci/console.h +++ b/engines/sci/console.h @@ -84,6 +84,7 @@ private: bool cmdShowMap(int argc, const char **argv); // Graphics bool cmdDrawPic(int argc, const char **argv); + bool cmdDrawCel(int argc, const char **argv); bool cmdUndither(int argc, const char **argv); bool cmdPlayVideo(int argc, const char **argv); // Segments -- cgit v1.2.3