aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-05 21:03:33 +0000
committerMartin Kiewitz2010-01-05 21:03:33 +0000
commitbe9507fcb1851966ee58539abc8825dd6859b188 (patch)
tree77e1316b75a3486fe9ed3399304097255eabecb3
parent7e5a7533ca4223ea26b258e624f58766be785da6 (diff)
downloadscummvm-rg350-be9507fcb1851966ee58539abc8825dd6859b188.tar.gz
scummvm-rg350-be9507fcb1851966ee58539abc8825dd6859b188.tar.bz2
scummvm-rg350-be9507fcb1851966ee58539abc8825dd6859b188.zip
SCI: implemented new debug command "draw_cel"
svn-id: r47043
-rw-r--r--engines/sci/console.cpp29
-rw-r--r--engines/sci/console.h1
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 <nr>\n", argv[0]);
- DebugPrintf("where <nr> is the number of the pic resource to draw\n");
+ DebugPrintf("Usage: %s <resourceId>\n", argv[0]);
+ DebugPrintf("where <resourceId> 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 <resourceId> <loopNr> <celNr> \n", argv[0]);
+ DebugPrintf("where <resourceId> 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