[Scummvm-cvs-logs] SF.net SVN: scummvm: [31267] scummvm/trunk/engines/kyra

lordhoto at users.sourceforge.net lordhoto at users.sourceforge.net
Thu Mar 27 17:12:48 CET 2008


Revision: 31267
          http://scummvm.svn.sourceforge.net/scummvm/?rev=31267&view=rev
Author:   lordhoto
Date:     2008-03-27 09:12:48 -0700 (Thu, 27 Mar 2008)

Log Message:
-----------
Enabled gamespeed debug command also for Kyra1.

Modified Paths:
--------------
    scummvm/trunk/engines/kyra/debugger.cpp
    scummvm/trunk/engines/kyra/debugger.h
    scummvm/trunk/engines/kyra/kyra.h

Modified: scummvm/trunk/engines/kyra/debugger.cpp
===================================================================
--- scummvm/trunk/engines/kyra/debugger.cpp	2008-03-27 15:32:20 UTC (rev 31266)
+++ scummvm/trunk/engines/kyra/debugger.cpp	2008-03-27 16:12:48 UTC (rev 31267)
@@ -42,6 +42,7 @@
 	DCmd_Register("screen_debug_mode",	WRAP_METHOD(Debugger, cmd_setScreenDebug));
 	DCmd_Register("load_palette",		WRAP_METHOD(Debugger, cmd_loadPalette));
 	DCmd_Register("facings",			WRAP_METHOD(Debugger, cmd_showFacings));
+	DCmd_Register("gamespeed",			WRAP_METHOD(Debugger, cmd_gameSpeed));
 }
 
 bool Debugger::cmd_setScreenDebug(int argc, const char **argv) {
@@ -63,7 +64,7 @@
 	uint8 palette[768];
 
 	if (argc <= 1) {
-		DebugPrintf("Use load_palette <file> [start_col] [end_col]");
+		DebugPrintf("Use load_palette <file> [start_col] [end_col]\n");
 		return true;
 	}
 
@@ -73,7 +74,7 @@
 		memcpy(palette, _vm->screen()->getCPagePtr(5), 768);
 		_vm->screen()->loadPageFromDisk("TEMP", 5);
 	} else if (!_vm->screen()->loadPalette(argv[1], palette)) {
-		DebugPrintf("Palette '%s' not found!", argv[1]);
+		DebugPrintf("ERROR: Palette '%s' not found!\n", argv[1]);
 		return true;
 	}
 
@@ -105,6 +106,23 @@
 	return true;
 }
 
+bool Debugger::cmd_gameSpeed(int argc, const char **argv) {
+	if (argc == 2) {
+		int val = atoi(argv[1]);
+
+		if (val < 1 || val > 1000) {
+			DebugPrintf("speed must lie between 1 and 1000 (default: 60)\n");
+			return true;
+		}
+
+		_vm->_tickLength = (uint8)(1000.0 / val);
+	} else {
+		DebugPrintf("Syntax: gamespeed <value>\n");
+	}
+
+	return true;
+}
+
 #pragma mark -
 
 Debugger_v1::Debugger_v1(KyraEngine_v1 *vm)
@@ -275,7 +293,6 @@
 	DCmd_Register("scene_to_facing",	WRAP_METHOD(Debugger_v2, cmd_sceneToFacing));
 	DCmd_Register("give",				WRAP_METHOD(Debugger_v2, cmd_giveItem));
 	DCmd_Register("pass_codes",			WRAP_METHOD(Debugger_v2, cmd_passcodes));
-	DCmd_Register("gamespeed",			WRAP_METHOD(Debugger_v2, cmd_gamespeed));
 }
 
 bool Debugger_v2::cmd_enterScene(int argc, const char **argv) {
@@ -436,22 +453,5 @@
 	return true;
 }
 
-bool Debugger_v2::cmd_gamespeed(int argc, const char **argv) {
-	if (argc == 2) {
-		int val = atoi(argv[1]);
-
-		if (val < 1 || val > 1000) {
-			DebugPrintf("speed must lie between 1 and 1000 (default: 60)\n");
-			return true;
-		}
-
-		_vm->_tickLength = (uint8)(1000.0 / val);
-	} else {
-		DebugPrintf("Syntax: gamespeed <value>\n");
-	}
-
-	return true;
-}
-
 } // End of namespace Kyra
 

Modified: scummvm/trunk/engines/kyra/debugger.h
===================================================================
--- scummvm/trunk/engines/kyra/debugger.h	2008-03-27 15:32:20 UTC (rev 31266)
+++ scummvm/trunk/engines/kyra/debugger.h	2008-03-27 16:12:48 UTC (rev 31267)
@@ -45,6 +45,7 @@
 	bool cmd_setScreenDebug(int argc, const char **argv);
 	bool cmd_loadPalette(int argc, const char **argv);
 	bool cmd_showFacings(int argc, const char **argv);
+	bool cmd_gameSpeed(int argc, const char **argv);
 };
 
 class Debugger_v1 : public Debugger {
@@ -84,7 +85,6 @@
 	bool cmd_sceneToFacing(int argc, const char **argv);
 	bool cmd_giveItem(int argc, const char **argv);
 	bool cmd_passcodes(int argc, const char **argv);
-	bool cmd_gamespeed(int argc, const char **argv);
 };
 
 } // End of namespace Kyra

Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h	2008-03-27 15:32:20 UTC (rev 31266)
+++ scummvm/trunk/engines/kyra/kyra.h	2008-03-27 16:12:48 UTC (rev 31267)
@@ -100,6 +100,7 @@
 class ScriptHelper;
 
 class KyraEngine : public Engine {
+friend class Debugger;
 public:
 	KyraEngine(OSystem *system, const GameFlags &flags);
 	virtual ~KyraEngine();


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