[Scummvm-cvs-logs] CVS: scummvm/scumm debugger.cpp,1.61,1.62 intern.h,2.97,2.98 script_v2.cpp,2.140,2.141

James Brown ender at users.sourceforge.net
Mon Jun 30 21:21:03 CEST 2003


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

Modified Files:
	debugger.cpp intern.h script_v2.cpp 
Log Message:
Add a few more actor debugger subcommands, and correct V2 coordinate translation for
o2_(get/set)ActorElevation


Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- debugger.cpp	14 Jun 2003 12:23:30 -0000	1.61
+++ debugger.cpp	1 Jul 2003 04:20:41 -0000	1.62
@@ -546,16 +546,29 @@
 	}
 
 	a = &_s->_actors[actnum];
+	value = atoi(argv[3]);
 
 	if (!strcmp(argv[2], "ignoreboxes")) {
-			a->ignoreBoxes = (atoi(argv[3]) > 0);
+			a->ignoreBoxes = (value > 0);
 			Debug_Printf("Actor[%d].ignoreBoxes = %d\n", actnum, a->ignoreBoxes);
+	} else if (!strcmp(argv[2], "x")) {
+			a->putActor(value, a->y, a->room);
+			Debug_Printf("Actor[%d].x = %d\n", actnum, a->x);
+			_s->_fullRedraw = 1;
+	} else if (!strcmp(argv[2], "y")) {
+			a->putActor(a->x, value, a->room);
+			Debug_Printf("Actor[%d].y = %d\n", actnum, a->y);
+			_s->_fullRedraw = 1;
+	} else if (!strcmp(argv[2], "elevation")) {
+			a->elevation = value;
+			Debug_Printf("Actor[%d].elevation = %d\n", actnum, a->elevation);
+			_s->_fullRedraw = 1;
 	} else if (!strcmp(argv[2], "costume")) {
-			value = atoi(argv[3]);
 			if (value >= _s->res.num[rtCostume])
 					Debug_Printf("Costume not changed as %d exceeds max of %d\n", value, _s->res.num[rtCostume]);
 			else {
 				a->setActorCostume( value );
+				_s->_fullRedraw = 1;
 				Debug_Printf("Actor[%d].costume = %d\n", actnum, a->costume);
 			}
 	} else {

Index: intern.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/intern.h,v
retrieving revision 2.97
retrieving revision 2.98
diff -u -d -r2.97 -r2.98
--- intern.h	29 May 2003 23:44:24 -0000	2.97
+++ intern.h	1 Jul 2003 04:20:41 -0000	2.98
@@ -263,6 +263,7 @@
 	void o2_restart();
 	void o2_roomOps();
 	void o2_saveLoadGame();
+	void o2_getActorElevation();
 	void o2_setActorElevation();
 	void o2_setBitVar();
 	void o2_setCameraAt();

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.140
retrieving revision 2.141
diff -u -d -r2.140 -r2.141
--- script_v2.cpp	21 Jun 2003 01:44:47 -0000	2.140
+++ script_v2.cpp	1 Jul 2003 04:20:41 -0000	2.141
@@ -40,7 +40,7 @@
 		/* 04 */
 		OPCODE(o5_isGreaterEqual),
 		OPCODE(o2_drawObject),
-		OPCODE(o5_getActorElevation),
+		OPCODE(o2_getActorElevation),
 		OPCODE(o2_setState08),
 		/* 08 */
 		OPCODE(o5_isNotEqual),
@@ -200,7 +200,7 @@
 		/* 84 */
 		OPCODE(o5_isGreaterEqual),
 		OPCODE(o2_drawObject),
-		OPCODE(o5_getActorElevation),
+		OPCODE(o2_getActorElevation),
 		OPCODE(o2_setState08),
 		/* 88 */
 		OPCODE(o5_isNotEqual),
@@ -1060,12 +1060,19 @@
 	a->putActor(x, y, a->room);
 }
 
+void Scumm_v2::o2_getActorElevation() {
+        getResultPos();
+        int act = getVarOrDirectByte(0x80);
+        Actor *a = derefActor(act, "o2_getActorElevation");
+        setResult(a->elevation / 2);
+}
+
 void Scumm_v2::o2_setActorElevation() {
 	int act = getVarOrDirectByte(0x80);
 	int elevation = getVarOrDirectByte(0x40);
 
 	Actor *a = derefActor(act, "o2_setActorElevation");
-	a->elevation = elevation;
+	a->elevation = elevation * 2;
 }
 
 void Scumm_v2::o2_animateActor() {





More information about the Scummvm-git-logs mailing list