[Scummvm-cvs-logs] SF.net SVN: scummvm:[47043] scummvm/trunk/engines/sci

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Tue Jan 5 22:03:33 CET 2010


Revision: 47043
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47043&view=rev
Author:   m_kiewitz
Date:     2010-01-05 21:03:33 +0000 (Tue, 05 Jan 2010)

Log Message:
-----------
SCI: implemented new debug command "draw_cel"

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/console.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-01-05 20:58:41 UTC (rev 47042)
+++ scummvm/trunk/engines/sci/console.cpp	2010-01-05 21:03:33 UTC (rev 47043)
@@ -109,6 +109,7 @@
 	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 @@
 	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::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]);
 
-	if (*offsetStr) {
-		DebugPrintf("Invalid resourceId\n");
+	_vm->_gamestate->_gui->drawPicture(resourceId, 100, false, false, false, 0);
+	_vm->_gamestate->_gui->animateShowPic();
+	return true;
+}
+
+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) {

Modified: scummvm/trunk/engines/sci/console.h
===================================================================
--- scummvm/trunk/engines/sci/console.h	2010-01-05 20:58:41 UTC (rev 47042)
+++ scummvm/trunk/engines/sci/console.h	2010-01-05 21:03:33 UTC (rev 47043)
@@ -84,6 +84,7 @@
 	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


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list