[Scummvm-cvs-logs] CVS: scummvm/scumm actor.cpp,1.177,1.178 actor.h,1.41,1.42 boxes.cpp,1.63,1.64 camera.cpp,2.9,2.10 debugger.cpp,1.85,1.86 gfx.cpp,2.212,2.213 object.cpp,1.139,1.140 script_v2.cpp,2.199,2.200 script_v5.cpp,1.189,1.190 script_v6.cpp,1.195,1.196 script_v8.cpp,2.195,2.196 scummvm.cpp,2.390,2.391 string.cpp,1.159,1.160

Max Horn fingolfin at users.sourceforge.net
Sun Sep 14 11:18:01 CEST 2003


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

Modified Files:
	actor.cpp actor.h boxes.cpp camera.cpp debugger.cpp gfx.cpp 
	object.cpp script_v2.cpp script_v5.cpp script_v6.cpp 
	script_v8.cpp scummvm.cpp string.cpp 
Log Message:
moved Actor x/y to _pos.x/_pos.y -> this makes it much easier to grep for access of the actor position

Index: actor.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.cpp,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- actor.cpp	14 Sep 2003 13:36:49 -0000	1.177
+++ actor.cpp	14 Sep 2003 18:16:44 -0000	1.178
@@ -69,8 +69,8 @@
 	if (mode == 1) {
 		costume = 0;
 		room = 0;
-		x = 0;
-		y = 0;
+		_pos.x = 0;
+		_pos.y = 0;
 		facing = 180;
 	} else if (mode == 2) {
 		facing = 180;
@@ -159,7 +159,7 @@
 }
 
 int Actor::calcMovementFactor(ScummVM::Point next) {
-	ScummVM::Point actorPos(x, y);
+	ScummVM::Point actorPos(_pos);
 	int diffX, diffY;
 	int32 deltaXFactor, deltaYFactor;
 
@@ -341,7 +341,7 @@
 
 int Actor::actorWalkStep() {
 	int tmpX, tmpY;
-	int actorX, actorY;
+	ScummVM::Point actorPos;
 	int distX, distY;
 	int nextFacing;
 
@@ -355,39 +355,37 @@
 		moving |= MF_IN_LEG;
 	}
 
-	actorX = x;
-	actorY = y;
+	actorPos = _pos;
 
-	if (walkbox != walkdata.curbox && _vm->checkXYInBoxBounds(walkdata.curbox, actorX, actorY)) {
+	if (walkbox != walkdata.curbox && _vm->checkXYInBoxBounds(walkdata.curbox, actorPos.x, actorPos.y)) {
 		setBox(walkdata.curbox);
 	}
 
 	distX = abs(walkdata.next.x - walkdata.cur.x);
 	distY = abs(walkdata.next.y - walkdata.cur.y);
 
-	if (abs(actorX - walkdata.cur.x) >= distX && abs(actorY - walkdata.cur.y) >= distY) {
+	if (abs(actorPos.x - walkdata.cur.x) >= distX && abs(actorPos.y - walkdata.cur.y) >= distY) {
 		moving &= ~MF_IN_LEG;
 		return 0;
 	}
 
-	tmpX = (actorX << 16) + walkdata.xfrac + (walkdata.deltaXFactor >> 8) * scalex;
+	tmpX = (actorPos.x << 16) + walkdata.xfrac + (walkdata.deltaXFactor >> 8) * scalex;
 	walkdata.xfrac = (uint16)tmpX;
-	actorX = (tmpX >> 16);
+	actorPos.x = (tmpX >> 16);
 
-	tmpY = (actorY << 16) + walkdata.yfrac + (walkdata.deltaYFactor >> 8) * scaley;
+	tmpY = (actorPos.y << 16) + walkdata.yfrac + (walkdata.deltaYFactor >> 8) * scaley;
 	walkdata.yfrac = (uint16)tmpY;
-	actorY = (tmpY >> 16);
+	actorPos.y = (tmpY >> 16);
 
-	if (abs(actorX - walkdata.cur.x) > distX) {
-		actorX = walkdata.next.x;
+	if (abs(actorPos.x - walkdata.cur.x) > distX) {
+		actorPos.x = walkdata.next.x;
 	}
 
-	if (abs(actorY - walkdata.cur.y) > distY) {
-		actorY = walkdata.next.y;
+	if (abs(actorPos.y - walkdata.cur.y) > distY) {
+		actorPos.y = walkdata.next.y;
 	}
 
-	x = actorX;
-	y = actorY;
+	_pos = actorPos;
 	return 1;
 }
 
@@ -423,7 +421,7 @@
 //	if (_vm->getBoxFlags(walkbox) & kBoxPlayerOnly)
 //		return;
 
-	scale = _vm->getScale(walkbox, x, y);
+	scale = _vm->getScale(walkbox, _pos.x, _pos.y);
 	assert(scale <= 0xFF);
 
 	scalex = scaley = (byte)scale;
@@ -575,8 +573,8 @@
 	if (_vm->_gameId == GID_SAMNMAX && newRoom == 16 && number == 5 && dstX == 235 && dstY == 236)
 		dstX++;
 
-	x = dstX;
-	y = dstY;
+	_pos.x = dstX;
+	_pos.y = dstY;
 	room = newRoom;
 	needRedraw = true;
 
@@ -604,8 +602,8 @@
 	if (!isInCurrentRoom())
 		return -1;
 
-	xPos = x;
-	yPos = y;
+	xPos = _pos.x;
+	yPos = _pos.y;
 	return 0;
 }
 
@@ -692,10 +690,10 @@
 void Actor::adjustActorPos() {
 	AdjustBoxResult abr;
 
-	abr = adjustXYToBeInBox(x, y);
+	abr = adjustXYToBeInBox(_pos.x, _pos.y);
 
-	x = abr.x;
-	y = abr.y;
+	_pos.x = abr.x;
+	_pos.y = abr.y;
 	walkdata.destbox = abr.box;
 
 	setBox(abr.box);
@@ -726,7 +724,7 @@
 	if (_vm->getObjectOrActorXY(obj, x2, y2) == -1)
 		return;
 
-	dir = (x2 > x) ? 90 : 270;
+	dir = (x2 > _pos.x) ? 90 : 270;
 	turnToDirection(dir);
 }
 
@@ -859,7 +857,7 @@
 		return -1;
 
 	// The actor with higher y value is ordered higher
-	diff = actor1->y - actor2->y;
+	diff = actor1->_pos.y - actor2->_pos.y;
 	if (diff < 0)
 		return -1;
 	if (diff > 0)
@@ -939,8 +937,8 @@
 
 	bcr->updateNbStrips();
 
-	bcr->_actorX = x - _vm->virtscr[0].xstart;
-	bcr->_actorY = y - elevation;
+	bcr->_actorX = _pos.x - _vm->virtscr[0].xstart;
+	bcr->_actorY = _pos.y - elevation;
 
 	if (_vm->_version <= 2) {
 		// HACK: We have to adjust the x position by one strip (8 pixels) in
@@ -1263,8 +1261,8 @@
 	}
 
 	if (!isInCurrentRoom()) {
-		x = abr.x;
-		y = abr.y;
+		_pos.x = abr.x;
+		_pos.y = abr.y;
 		if (dir != -1)
 			setDirection(dir);
 		return;
@@ -1283,7 +1281,7 @@
 			return;
 	}
 
-	if (x == abr.x && y == abr.y) {
+	if (_pos.x == abr.x && _pos.y == abr.y) {
 		turnToDirection(dir);
 		return;
 	}
@@ -1380,8 +1378,8 @@
 		moving &= MF_IN_LEG;
 	}
 
+	moving &= ~MF_NEW_LEG;
 	do {
-		moving &= ~MF_NEW_LEG;
 
 		if (walkbox == kInvalidBox) {
 			setBox(walkdata.destbox);
@@ -1414,6 +1412,58 @@
 	calcMovementFactor(walkdata.dest);
 }
 
+/*
+void Actor::walkActorV12() {
+	ScummVM::Point foundPath, tmp;
+	int new_dir, next_box;
+
+	if (moving & MF_TURN) {
+		new_dir = updateActorDirection(false);
+		if (facing != new_dir)
+			setDirection(new_dir);
+		else
+			moving = 0;
+		return;
+	}
+	
+	if (!moving)
+		return;
+	
+	if (moving & MF_IN_LEG) {
+		actorWalkStep();
+	} else {
+		if (moving & MF_LAST_LEG) {
+			moving = 0;
+			startWalkAnim(3, walkdata.destdir);
+		} else {
+			setBox(walkdata.curbox);
+			if (walkbox == walkdata.destbox) {
+				foundPath = walkdata.dest;
+				moving |= MF_LAST_LEG;
+			} else {
+				next_box = _vm->getPathToDestBox(walkbox, walkdata.destbox);
+				if (next_box < 0) {
+					moving |= MF_LAST_LEG;
+					return;
+				}
+		
+				// Can't walk through locked boxes
+				int flags = _vm->getBoxFlags(next_box);
+				if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
+					moving |= MF_LAST_LEG;
+				}
+
+				walkdata.curbox = next_box;
+
+				_vm->getClosestPtOnBox(walkdata.curbox, x, y, tmp.x, tmp.y);
+				_vm->getClosestPtOnBox(walkbox, tmp.x, tmp.y, foundPath.x, foundPath.y);
+			}
+			calcMovementFactor(foundPath);
+		}
+	}
+}
+*/
+
 void Actor::walkActorOld() {
 	ScummVM::Point p2, p3;	// Gate locations
 	int new_dir, next_box;
@@ -1452,8 +1502,8 @@
 		moving &= MF_IN_LEG;
 	}
 
+	moving &= ~MF_NEW_LEG;
 	do {
-		moving &= ~MF_NEW_LEG;
 
 		if (walkbox == kInvalidBox) {
 			setBox(walkdata.destbox);
@@ -1469,25 +1519,30 @@
 			moving |= MF_LAST_LEG;
 			return;
 		}
-
+		
 		// Can't walk through locked boxes
 		int flags = _vm->getBoxFlags(next_box);
 		if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
 			moving |= MF_LAST_LEG;
+// FIXME: Work in progress
+//			walkdata.destdir = facing;
 			return;
 		}
 
 		walkdata.curbox = next_box;
 
 		if (_vm->_version <= 2) {
-			_vm->getClosestPtOnBox(walkdata.curbox, x, y, p2.x, p2.y);
+			_vm->getClosestPtOnBox(walkdata.curbox, _pos.x, _pos.y, p2.x, p2.y);
 			_vm->getClosestPtOnBox(walkbox, p2.x, p2.y, p3.x, p3.y);
+// FIXME: Work in progress
+//			calcMovementFactor(p3);
+//			return;
 		} else {
 			findPathTowardsOld(walkbox, next_box, walkdata.destbox, p2, p3);
 			if (p2.x == 32000 && p3.x == 32000) {
 				break;
 			}
-
+	
 			if (p2.x != 32000) {
 				if (calcMovementFactor(p2)) {
 					walkdata.point3 = p3;
@@ -1597,8 +1652,8 @@
 
 const SaveLoadEntry *Actor::getSaveLoadEntries() {
 	static const SaveLoadEntry actorEntries[] = {
-		MKLINE(Actor, x, sleInt16, VER(8)),
-		MKLINE(Actor, y, sleInt16, VER(8)),
+		MKLINE(Actor, _pos.x, sleInt16, VER(8)),
+		MKLINE(Actor, _pos.y, sleInt16, VER(8)),
 		MKLINE(Actor, top, sleInt16, VER(8)),
 		MKLINE(Actor, bottom, sleInt16, VER(8)),
 		MKLINE(Actor, elevation, sleInt16, VER(8)),

Index: actor.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/actor.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- actor.h	13 Sep 2003 23:50:29 -0000	1.41
+++ actor.h	14 Sep 2003 18:16:44 -0000	1.42
@@ -82,7 +82,8 @@
 	static void initActorClass(Scumm *scumm);
 
 public:
-	int x, y, top, bottom;
+	ScummVM::Point _pos;
+	int top, bottom;
 	int elevation;
 	uint width;
 	byte number;

Index: boxes.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/boxes.cpp,v
retrieving revision 1.63
retrieving revision 1.64
diff -u -d -r1.63 -r1.64
--- boxes.cpp	11 Sep 2003 22:36:21 -0000	1.63
+++ boxes.cpp	14 Sep 2003 18:16:44 -0000	1.64
@@ -802,11 +802,11 @@
 					if (flag & 2)
 						SWAP(box2.ul.y, box2.ur.y);
 				} else {
-					pos = y;
+					pos = _pos.y;
 					if (box2nr == box3nr) {
-						int diffX = walkdata.dest.x - x;
-						int diffY = walkdata.dest.y - y;
-						int boxDiffX = box1.ul.x - x;
+						int diffX = walkdata.dest.x - _pos.x;
+						int diffY = walkdata.dest.y - _pos.y;
+						int boxDiffX = box1.ul.x - _pos.x;
 
 						if (diffX != 0) {
 							int t;
@@ -816,7 +816,7 @@
 							if (t == 0 && (diffY <= 0 || diffX <= 0)
 									&& (diffY >= 0 || diffX >= 0))
 								t = -1;
-							pos = y + t;
+							pos = _pos.y + t;
 						}
 					}
 
@@ -859,16 +859,16 @@
 				} else {
 
 					if (box2nr == box3nr) {
-						int diffX = walkdata.dest.x - x;
-						int diffY = walkdata.dest.y - y;
-						int boxDiffY = box1.ul.y - y;
+						int diffX = walkdata.dest.x - _pos.x;
+						int diffY = walkdata.dest.y - _pos.y;
+						int boxDiffY = box1.ul.y - _pos.y;
 
-						pos = x;
+						pos = _pos.x;
 						if (diffY != 0) {
 							pos += diffX * boxDiffY / diffY;
 						}
 					} else {
-						pos = x;
+						pos = _pos.x;
 					}
 
 					q = pos;
@@ -1155,21 +1155,21 @@
 	// next box (trap2) = final box?
 	if (trap2 == final_trap) {
 		// Is the actor (x,y) between both gates?
-		if (compareSlope(x, y, walkdata.dest.x, walkdata.dest.y, gateA[0].x, gateA[0].y) !=
-				compareSlope(x, y, walkdata.dest.x, walkdata.dest.y, gateB[0].x, gateB[0].y) &&
-				compareSlope(x, y, walkdata.dest.x, walkdata.dest.y, gateA[1].x, gateA[1].y) !=
-				compareSlope(x, y, walkdata.dest.x, walkdata.dest.y, gateB[1].x, gateB[1].y)) {
+		if (compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateA[0].x, gateA[0].y) !=
+				compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateB[0].x, gateB[0].y) &&
+				compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateA[1].x, gateA[1].y) !=
+				compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateB[1].x, gateB[1].y)) {
 			return;
 		}
 	}
 
-	pt = closestPtOnLine(gateA[1].x, gateA[1].y, gateB[1].x, gateB[1].y, x, y);
+	pt = closestPtOnLine(gateA[1].x, gateA[1].y, gateB[1].x, gateB[1].y, _pos.x, _pos.y);
 	p3.x = pt.x;
 	p3.y = pt.y;
 
-	if (compareSlope(x, y, p3.x, p3.y, gateA[0].x, gateA[0].y) ==
-			compareSlope(x, y, p3.x, p3.y, gateB[0].x, gateB[0].y)) {
-		closestPtOnLine(gateA[0].x, gateA[0].y, gateB[0].x, gateB[0].y, x, y);
+	if (compareSlope(_pos.x, _pos.y, p3.x, p3.y, gateA[0].x, gateA[0].y) ==
+			compareSlope(_pos.x, _pos.y, p3.x, p3.y, gateB[0].x, gateB[0].y)) {
+		closestPtOnLine(gateA[0].x, gateA[0].y, gateB[0].x, gateB[0].y, _pos.x, _pos.y);
 		p2.x = pt.x;				/* if point 2 between gates, ignore! */
 		p2.y = pt.y;
 	}

Index: camera.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/camera.cpp,v
retrieving revision 2.9
retrieving revision 2.10
diff -u -d -r2.9 -r2.10
--- camera.cpp	7 Jul 2003 22:17:20 -0000	2.9
+++ camera.cpp	14 Sep 2003 18:16:44 -0000	2.10
@@ -93,14 +93,14 @@
 	if (!a->isInCurrentRoom()) {
 		startScene(a->getRoom(), 0, 0);
 		camera._mode = CM_FOLLOW_ACTOR;
-		camera._cur.x = a->x;
+		camera._cur.x = a->_pos.x;
 		setCameraAt(camera._cur.x, 0);
 	}
 
-	t = (a->x >> 3);
+	t = (a->_pos.x >> 3);
 
 	if (t - _screenStartStrip < camera._leftTrigger || t - _screenStartStrip > camera._rightTrigger)
-		setCameraAt(a->x, 0);
+		setCameraAt(a->_pos.x, 0);
 
 	for (i = 1; i < _numActors; i++) {
 		if (_actors[i].isInCurrentRoom())
@@ -121,11 +121,11 @@
 		startScene(a->getRoom(), 0, 0);
 	}
 
-	ax = abs(a->x - camera._cur.x);
-	ay = abs(a->y - camera._cur.y);
+	ax = abs(a->_pos.x - camera._cur.x);
+	ay = abs(a->_pos.y - camera._cur.y);
 
 	if (ax > VAR(VAR_CAMERA_THRESHOLD_X) || ay > VAR(VAR_CAMERA_THRESHOLD_Y) || ax > (_screenWidth / 2) || ay > (_screenHeight / 2)) {
-		setCameraAt(a->x, a->y);
+		setCameraAt(a->_pos.x, a->_pos.y);
 	}
 
 	if (a->number != oldfollow)
@@ -175,7 +175,7 @@
 	if (camera._mode == CM_FOLLOW_ACTOR) {
 		a = derefActor(camera._follows, "moveCamera");
 
-		actorx = a->x;
+		actorx = a->_pos.x;
 		t = (actorx >> 3) - _screenStartStrip;
 
 		if (t < camera._leftTrigger || t > camera._rightTrigger) {
@@ -191,7 +191,7 @@
 
 	if (camera._movingToActor) {
 		a = derefActor(camera._follows, "moveCamera(2)");
-		camera._dest.x = a->x;
+		camera._dest.x = a->_pos.x;
 	}
 
 	if (camera._dest.x < VAR(VAR_CAMERA_MIN_X))
@@ -210,7 +210,7 @@
 	}
 
 	/* a is set a bit above */
-	if (camera._movingToActor && (camera._cur.x >> 3) == (a->x >> 3)) {
+	if (camera._movingToActor && (camera._cur.x >> 3) == (a->_pos.x >> 3)) {
 		camera._movingToActor = false;
 	}
 
@@ -231,13 +231,13 @@
 
 	if (camera._follows) {
 		a = derefActor(camera._follows, "moveCamera");
-		if (abs(camera._cur.x - a->x) > VAR(VAR_CAMERA_THRESHOLD_X) ||
-				abs(camera._cur.y - a->y) > VAR(VAR_CAMERA_THRESHOLD_Y)) {
+		if (abs(camera._cur.x - a->_pos.x) > VAR(VAR_CAMERA_THRESHOLD_X) ||
+				abs(camera._cur.y - a->_pos.y) > VAR(VAR_CAMERA_THRESHOLD_Y)) {
 			camera._movingToActor = true;
 			if (VAR(VAR_CAMERA_THRESHOLD_X) == 0)
-				camera._cur.x = a->x;
+				camera._cur.x = a->_pos.x;
 			if (VAR(VAR_CAMERA_THRESHOLD_Y) == 0)
-				camera._cur.y = a->y;
+				camera._cur.y = a->_pos.y;
 			clampCameraPos(&camera._cur);
 		}
 	} else {
@@ -245,8 +245,8 @@
 	}
 
 	if (camera._movingToActor) {
-		VAR(VAR_CAMERA_DEST_X) = camera._dest.x = a->x;
-		VAR(VAR_CAMERA_DEST_Y) = camera._dest.y = a->y;
+		VAR(VAR_CAMERA_DEST_X) = camera._dest.x = a->_pos.x;
+		VAR(VAR_CAMERA_DEST_Y) = camera._dest.y = a->_pos.y;
 	}
 
 	assert(camera._cur.x >= (_screenWidth / 2) && camera._cur.y >= (_screenHeight / 2));

Index: debugger.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/debugger.cpp,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -d -r1.85 -r1.86
--- debugger.cpp	11 Sep 2003 20:49:10 -0000	1.85
+++ debugger.cpp	14 Sep 2003 18:16:44 -0000	1.86
@@ -620,12 +620,12 @@
 			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);
+			a->putActor(value, a->_pos.y, a->room);
+			Debug_Printf("Actor[%d].x = %d\n", actnum, a->_pos.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);
+			a->putActor(a->_pos.x, value, a->room);
+			Debug_Printf("Actor[%d].y = %d\n", actnum, a->_pos.y);
 			_s->_fullRedraw = 1;
 	} else if (!strcmp(argv[2], "elevation")) {
 			a->elevation = value;
@@ -659,7 +659,7 @@
 		a = &_s->_actors[i];
 		if (a->visible)
 			Debug_Printf("|%2d|%4d|%4d|%4d|%4d|%3d|%5d|%3d|%3d|%3d|%5d|%5d|%3d|$%02x|\n",
-						 a->number, a->room, a->x, a->y, a->elevation, a->costume,
+						 a->number, a->room, a->_pos.x, a->_pos.y, a->elevation, a->costume,
 						 a->width, a->walkbox, a->moving, a->forceClip, a->frame,
 						 a->scalex, a->getFacing(), int(_s->_classData[a->number]&0xFF));
 	}

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.212
retrieving revision 2.213
diff -u -d -r2.212 -r2.213
--- gfx.cpp	6 Sep 2003 15:15:29 -0000	2.212
+++ gfx.cpp	14 Sep 2003 18:16:44 -0000	2.213
@@ -662,8 +662,8 @@
 		y = _mouse.y - virtscr[0].topline;
 	} else {
 		Actor *a = derefActor(VAR(VAR_EGO), "drawFlashlight");
-		x = a->x;
-		y = a->y;
+		x = a->_pos.x;
+		y = a->_pos.y;
 	}
 	_flashlight.w = _flashlight.xStrips * 8;
 	_flashlight.h = _flashlight.yStrips * 8;

Index: object.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/object.cpp,v
retrieving revision 1.139
retrieving revision 1.140
diff -u -d -r1.139 -r1.140
--- object.cpp	11 Sep 2003 23:23:40 -0000	1.139
+++ object.cpp	14 Sep 2003 18:16:44 -0000	1.140
@@ -1221,7 +1221,7 @@
 	if (obj < _numActors) {
 		if (obj < 1)
 			return 0;									/* fix for indy4's map */
-		return derefActor(obj, "getObjX")->x;
+		return derefActor(obj, "getObjX")->_pos.x;
 	} else {
 		if (whereIsObject(obj) == WIO_NOT_FOUND)
 			return -1;
@@ -1235,7 +1235,7 @@
 	if (obj < _numActors) {
 		if (obj < 1)
 			return 0;									/* fix for indy4's map */
-		return derefActor(obj, "getObjY")->y;
+		return derefActor(obj, "getObjY")->_pos.y;
 	} else {
 		if (whereIsObject(obj) == WIO_NOT_FOUND)
 			return -1;

Index: script_v2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v2.cpp,v
retrieving revision 2.199
retrieving revision 2.200
diff -u -d -r2.199 -r2.200
--- script_v2.cpp	12 Sep 2003 00:07:42 -0000	2.199
+++ script_v2.cpp	14 Sep 2003 18:16:45 -0000	2.200
@@ -1291,8 +1291,8 @@
 	a->putActor(x2, y2, _currentRoom);
 	a->setDirection(dir + 180);
 
-	camera._dest.x = camera._cur.x = a->x;
-	setCameraAt(a->x, a->y);
+	camera._dest.x = camera._cur.x = a->_pos.x;
+	setCameraAt(a->_pos.x, a->_pos.y);
 	setCameraFollows(a);
 
 	_fullRedraw = 1;

Index: script_v5.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v5.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -u -d -r1.189 -r1.190
--- script_v5.cpp	14 Sep 2003 13:42:28 -0000	1.189
+++ script_v5.cpp	14 Sep 2003 18:16:45 -0000	1.190
@@ -512,7 +512,7 @@
 			a->ignoreBoxes = !(_opcode & 1);
 			a->forceClip = 0;
 			if (a->isInCurrentRoom())
-				a->putActor(a->x, a->y, a->room);
+				a->putActor(a->_pos.x, a->_pos.y, a->room);
 			break;
 
 		case 22:										/* animspeed */
@@ -1327,7 +1327,7 @@
 	int box = getVarOrDirectByte(0x40);
 	Actor *a = derefActor(act, "o5_isActorInBox");
 
-	if (!checkXYInBoxBounds(box, a->x, a->y))
+	if (!checkXYInBoxBounds(box, a->_pos.x, a->_pos.y))
 		o5_jumpRelative();
 	else
 		ignoreScriptWord();
@@ -1489,9 +1489,9 @@
 	}
 
 	// FIXME: Can this be removed?
-	camera._cur.x = a->x;
+	camera._cur.x = a->_pos.x;
 
-	setCameraAt(a->x, a->y);
+	setCameraAt(a->_pos.x, a->_pos.y);
 	setCameraFollows(a);
 
 	_fullRedraw = 1;
@@ -2662,9 +2662,9 @@
 		dist = a->scalex * a->width / 0xFF;
 		dist += (a2->scalex * a2->width / 0xFF) / 2;
 	}
-	x = a2->x;
-	y = a2->y;
-	if (x < a->x)
+	x = a2->_pos.x;
+	y = a2->_pos.y;
+	if (x < a->_pos.x)
 		x += dist;
 	else
 		x -= dist;

Index: script_v6.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v6.cpp,v
retrieving revision 1.195
retrieving revision 1.196
diff -u -d -r1.195 -r1.196
--- script_v6.cpp	13 Sep 2003 21:04:47 -0000	1.195
+++ script_v6.cpp	14 Sep 2003 18:16:45 -0000	1.196
@@ -1023,9 +1023,9 @@
 			dist = a2->scalex * a2->width / 0xFF;
 			dist += dist / 2;
 		}
-		x = a2->x;
-		y = a2->y;
-		if (x < a->x)
+		x = a2->_pos.x;
+		y = a2->_pos.y;
+		if (x < a->_pos.x)
 			x += dist;
 		else
 			x -= dist;
@@ -1161,7 +1161,7 @@
 		VAR(VAR_WALKTO_OBJ) = 0;
 
 	if (_version == 6) {
-		setCameraAt(a->x, a->y);
+		setCameraAt(a->_pos.x, a->_pos.y);
 		setCameraFollows(a);
 	}
 
@@ -1267,7 +1267,7 @@
 void Scumm_v6::o6_isActorInBox() {
 	int box = pop();
 	Actor *a = derefActor(pop(), "o6_isActorInBox");
-	push(checkXYInBoxBounds(box, a->x, a->y));
+	push(checkXYInBoxBounds(box, a->_pos.x, a->_pos.y));
 }
 
 void Scumm_v6::o6_getActorLayer() {
@@ -1715,7 +1715,7 @@
 		else
 			a->forceClip = 0;
 		if (a->isInCurrentRoom())
-			a->putActor(a->x, a->y, a->room);
+			a->putActor(a->_pos.x, a->_pos.y, a->room);
 		break;
 	case 96:
 		a->ignoreBoxes = 0;
@@ -1724,7 +1724,7 @@
 		else
 			a->forceClip = 0;
 		if (a->isInCurrentRoom())
-			a->putActor(a->x, a->y, a->room);
+			a->putActor(a->_pos.x, a->_pos.y, a->room);
 		break;
 	case 97:
 		a->setAnimSpeed(pop());

Index: script_v8.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v8.cpp,v
retrieving revision 2.195
retrieving revision 2.196
diff -u -d -r2.195 -r2.196
--- script_v8.cpp	11 Sep 2003 23:44:03 -0000	2.195
+++ script_v8.cpp	14 Sep 2003 18:16:45 -0000	2.196
@@ -1002,13 +1002,13 @@
 		a->ignoreBoxes = true;
 		a->forceClip = 100;
 		if (a->isInCurrentRoom())
-			a->putActor(a->x, a->y, a->room);
+			a->putActor(a->_pos.x, a->_pos.y, a->room);
 		break;
 	case 0x77:		// SO_ACTOR_FOLLOW_BOXES Make actor follow boxes
 		a->ignoreBoxes = false;
 		a->forceClip = 100;
 		if (a->isInCurrentRoom())
-			a->putActor(a->x, a->y, a->room);
+			a->putActor(a->_pos.x, a->_pos.y, a->room);
 		break;
 	case 0x78:		// SO_ACTOR_SPECIAL_DRAW
 		a->shadow_mode = pop();

Index: scummvm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scummvm.cpp,v
retrieving revision 2.390
retrieving revision 2.391
diff -u -d -r2.390 -r2.391
--- scummvm.cpp	12 Sep 2003 09:50:33 -0000	2.390
+++ scummvm.cpp	14 Sep 2003 18:16:45 -0000	2.391
@@ -2020,7 +2020,7 @@
 		}
 		if (camera._follows) {
 			a = derefActor(camera._follows, "startScene: follows");
-			setCameraAt(a->x, a->y);
+			setCameraAt(a->_pos.x, a->_pos.y);
 		}
 	}
 

Index: string.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/string.cpp,v
retrieving revision 1.159
retrieving revision 1.160
diff -u -d -r1.159 -r1.160
--- string.cpp	11 Sep 2003 10:32:15 -0000	1.159
+++ string.cpp	14 Sep 2003 18:16:45 -0000	1.160
@@ -108,24 +108,24 @@
 
 	if (a && _string[0].overhead != 0) {
 		if (_version <= 5) {
-			_string[0].xpos = a->x - camera._cur.x + (_screenWidth / 2);
+			_string[0].xpos = a->_pos.x - camera._cur.x + (_screenWidth / 2);
 
 			if (VAR(VAR_V5_TALK_STRING_Y) < 0) {
 				s = (a->scaley * (int)VAR(VAR_V5_TALK_STRING_Y)) / 0xFF;
-				_string[0].ypos = (int)(((VAR(VAR_V5_TALK_STRING_Y) - s) >> 1) + s - a->elevation + a->y);
+				_string[0].ypos = (int)(((VAR(VAR_V5_TALK_STRING_Y) - s) >> 1) + s - a->elevation + a->_pos.y);
 			} else {
 				_string[0].ypos = (int)VAR(VAR_V5_TALK_STRING_Y);
 			}
 
 		} else {
 			s = a->scaley * a->talkPosY / 0xFF;
-			_string[0].ypos = ((a->talkPosY - s) >> 1) + s - a->elevation + a->y;
+			_string[0].ypos = ((a->talkPosY - s) >> 1) + s - a->elevation + a->_pos.y;
 
 			if (_string[0].ypos < _screenTop)
 				_string[0].ypos = _screenTop;
 
 			s = a->scalex * a->talkPosX / 0xFF;
-			_string[0].xpos = ((a->talkPosX - s) >> 1) + s + a->x - camera._cur.x + (_screenWidth / 2);
+			_string[0].xpos = ((a->talkPosX - s) >> 1) + s + a->_pos.x - camera._cur.x + (_screenWidth / 2);
 		}
 
 		if (_string[0].ypos < 1)





More information about the Scummvm-git-logs mailing list