[Scummvm-cvs-logs] CVS: scummvm/scumm debugger.h,1.7,1.8 debugger.cpp,1.7,1.8

James Brown ender at users.sourceforge.net
Tue Jan 7 01:47:02 CET 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv21754/scumm

Modified Files:
	debugger.h debugger.cpp 
Log Message:
Skeleton for actor debugger commands - current command is useful for states where actors in CMI get stuck with "I can't reach it" 
type stuff. :)


Index: debugger.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- debugger.h	30 Dec 2002 01:27:33 -0000	1.7
+++ debugger.h	7 Jan 2003 09:46:51 -0000	1.8
@@ -75,6 +75,7 @@
 
 	bool Cmd_PrintActor(int argc, const char **argv);
 	bool Cmd_PrintBox(int argc, const char **argv);
+	bool Cmd_Actor(int argc, const char **argv);
 	
 	void printBox(int box);
 	

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- debugger.cpp	30 Dec 2002 01:27:33 -0000	1.7
+++ debugger.cpp	7 Jan 2003 09:46:51 -0000	1.8
@@ -55,7 +55,8 @@
 		DCmd_Register("exit", &ScummDebugger::Cmd_Exit);
 		DCmd_Register("quit", &ScummDebugger::Cmd_Exit);
 
-		DCmd_Register("actor", &ScummDebugger::Cmd_PrintActor);
+		DCmd_Register("actor", &ScummDebugger::Cmd_Actor);
+		DCmd_Register("actors", &ScummDebugger::Cmd_PrintActor);
 		DCmd_Register("box", &ScummDebugger::Cmd_PrintBox);
 		DCmd_Register("room", &ScummDebugger::Cmd_Room);
 
@@ -264,7 +265,7 @@
 		_s->_fullRedraw = 1;
 		return false;
 	} else {
-		Debug_Printf("Current room: %d [%d]\n", _s->_currentRoom, _s->_roomResource);
+		Debug_Printf("Current room: %d [%d] - use 'room <roomnum>' to switch\n", _s->_currentRoom, _s->_roomResource);
 		return true;
 	}
 }
@@ -278,6 +279,8 @@
 		_s->_saveLoadCompatible = false;
 		
 		_detach_now = true;
+	} else {
+		Debug_Printf("Syntax: savegame <slotnum>\n");
 	}
 	return false;
 }
@@ -291,10 +294,39 @@
 		_s->_saveLoadCompatible = false;
 		
 		_detach_now = true;
+	} else {
+		Debug_Printf("Syntax: savegame <slotnum>\n");
 	}
 	return false;
 }
 
+bool ScummDebugger::Cmd_Actor(int argc, const char **argv) {
+	Actor *a;
+	int actnum;
+
+	if (argc < 3) {
+		Debug_Printf("Syntax: actor <actornum> <command> <parameter>\n");
+		return true;
+	}
+
+	actnum = atoi(argv[1]);
+	if (actnum >= _s->NUM_ACTORS) {
+		Debug_Printf("Actor %d is out of range (range: 1 - %d)\n", actnum, _s->NUM_ACTORS);
+		return true;
+	}
+
+	a = &_s->_actors[actnum];
+
+	if (!strcmp(argv[2], "ignoreboxes")) {
+			a->ignoreBoxes = atoi(argv[3]);
+			Debug_Printf("Actor[%d].ignoreBoxes = %d\n", actnum, a->ignoreBoxes);
+	} else {
+			Debug_Printf("Unknown actor command '%s'\n", argv[2]);
+	}
+
+	return true;
+	
+}
 bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) {
 	int i;
 	Actor *a;





More information about the Scummvm-git-logs mailing list