aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2003-09-14 18:16:45 +0000
committerMax Horn2003-09-14 18:16:45 +0000
commit6512592d0f0be9afcc0f3aa30b1b505490ebea54 (patch)
tree59eb579d38946c02e2d579de1c6d106ecacf4114 /scumm
parentfd7727e9d2a5414e021439eb88d30ca687ac691e (diff)
downloadscummvm-rg350-6512592d0f0be9afcc0f3aa30b1b505490ebea54.tar.gz
scummvm-rg350-6512592d0f0be9afcc0f3aa30b1b505490ebea54.tar.bz2
scummvm-rg350-6512592d0f0be9afcc0f3aa30b1b505490ebea54.zip
moved Actor x/y to _pos.x/_pos.y -> this makes it much easier to grep for access of the actor position
svn-id: r10253
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp135
-rw-r--r--scumm/actor.h3
-rw-r--r--scumm/boxes.cpp36
-rw-r--r--scumm/camera.cpp30
-rw-r--r--scumm/debugger.cpp10
-rw-r--r--scumm/gfx.cpp4
-rw-r--r--scumm/object.cpp4
-rw-r--r--scumm/script_v2.cpp4
-rw-r--r--scumm/script_v5.cpp14
-rw-r--r--scumm/script_v6.cpp14
-rw-r--r--scumm/script_v8.cpp4
-rw-r--r--scumm/scummvm.cpp2
-rw-r--r--scumm/string.cpp8
13 files changed, 162 insertions, 106 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index e53ac2402d..92476b8e59 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -69,8 +69,8 @@ void Actor::initActor(int mode) {
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 Scumm::getAngleFromPos(int x, int y) const {
}
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 @@ void Actor::setBox(int box) {
int Actor::actorWalkStep() {
int tmpX, tmpY;
- int actorX, actorY;
+ ScummVM::Point actorPos;
int distX, distY;
int nextFacing;
@@ -355,39 +355,37 @@ int Actor::actorWalkStep() {
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 @@ void Actor::setupActorScale() {
// 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 @@ void Actor::putActor(int dstX, int dstY, byte newRoom) {
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 @@ int Actor::getActorXYPos(int &xPos, int &yPos) const {
if (!isInCurrentRoom())
return -1;
- xPos = x;
- yPos = y;
+ xPos = _pos.x;
+ yPos = _pos.y;
return 0;
}
@@ -692,10 +690,10 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {
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 @@ void Actor::faceToObject(int obj) {
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 @@ static int compareDrawOrder(const void* a, const void* b)
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 @@ void Actor::drawActorCostume() {
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 @@ void Actor::startWalkActor(int destX, int destY, int dir) {
}
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 @@ void Actor::startWalkActor(int destX, int destY, int dir) {
return;
}
- if (x == abr.x && y == abr.y) {
+ if (_pos.x == abr.x && _pos.y == abr.y) {
turnToDirection(dir);
return;
}
@@ -1380,8 +1378,8 @@ void Actor::walkActor() {
moving &= MF_IN_LEG;
}
+ moving &= ~MF_NEW_LEG;
do {
- moving &= ~MF_NEW_LEG;
if (walkbox == kInvalidBox) {
setBox(walkdata.destbox);
@@ -1414,6 +1412,58 @@ void Actor::walkActor() {
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 @@ void Actor::walkActorOld() {
moving &= MF_IN_LEG;
}
+ moving &= ~MF_NEW_LEG;
do {
- moving &= ~MF_NEW_LEG;
if (walkbox == kInvalidBox) {
setBox(walkdata.destbox);
@@ -1469,25 +1519,30 @@ void Actor::walkActorOld() {
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 @@ bool Actor::isPlayer() {
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)),
diff --git a/scumm/actor.h b/scumm/actor.h
index 1e020af494..83a2ec2b31 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -82,7 +82,8 @@ public:
static void initActorClass(Scumm *scumm);
public:
- int x, y, top, bottom;
+ ScummVM::Point _pos;
+ int top, bottom;
int elevation;
uint width;
byte number;
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 17f79f5257..6d0222ccf4 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -802,11 +802,11 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, ScummVM::Poin
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 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, ScummVM::Poin
if (t == 0 && (diffY <= 0 || diffX <= 0)
&& (diffY >= 0 || diffX >= 0))
t = -1;
- pos = y + t;
+ pos = _pos.y + t;
}
}
@@ -859,16 +859,16 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, ScummVM::Poin
} 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 @@ void Actor::findPathTowardsOld(byte trap1, byte trap2, byte final_trap, ScummVM:
// 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;
}
diff --git a/scumm/camera.cpp b/scumm/camera.cpp
index 2af7e092b0..46633343ba 100644
--- a/scumm/camera.cpp
+++ b/scumm/camera.cpp
@@ -93,14 +93,14 @@ void Scumm::setCameraFollows(Actor *a) {
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 @@ void Scumm_v7::setCameraFollows(Actor *a) {
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 @@ void Scumm::moveCamera() {
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 @@ void Scumm::moveCamera() {
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 @@ void Scumm::moveCamera() {
}
/* 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 @@ void Scumm_v7::moveCamera() {
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 @@ void Scumm_v7::moveCamera() {
}
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));
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index d225ba13a6..700d285d04 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -620,12 +620,12 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) {
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 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) {
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));
}
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp
index 294962e5fc..f2df497714 100644
--- a/scumm/gfx.cpp
+++ b/scumm/gfx.cpp
@@ -662,8 +662,8 @@ void Scumm::drawFlashlight() {
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;
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 16b563e6ae..245b883a34 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -1221,7 +1221,7 @@ int Scumm::getObjX(int obj) {
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 @@ int Scumm::getObjY(int obj) {
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;
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index a6eb2fd26e..3034fd1d37 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -1291,8 +1291,8 @@ void Scumm_v2::o2_loadRoomWithEgo() {
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;
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index fa1075a23a..e8770fb9f8 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -512,7 +512,7 @@ void Scumm_v5::o5_actorSet() {
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 @@ void Scumm_v5::o5_isActorInBox() {
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 @@ void Scumm_v5::o5_loadRoomWithEgo() {
}
// 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 @@ void Scumm_v5::o5_walkActorToActor() {
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;
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index ebf8d7358d..7d4be06aea 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -1023,9 +1023,9 @@ void Scumm_v6::o6_walkActorToObj() {
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 @@ void Scumm_v6::o6_loadRoomWithEgo() {
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_getAnimateVariable() {
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 @@ void Scumm_v6::o6_actorOps() {
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 @@ void Scumm_v6::o6_actorOps() {
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());
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 6bfdd11a46..e502faa9df 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -1002,13 +1002,13 @@ void Scumm_v8::o8_actorOps() {
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();
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp
index a28bf4934e..fb5b6c5f1a 100644
--- a/scumm/scummvm.cpp
+++ b/scumm/scummvm.cpp
@@ -2020,7 +2020,7 @@ void Scumm::startScene(int room, Actor *a, int objectNr) {
}
if (camera._follows) {
a = derefActor(camera._follows, "startScene: follows");
- setCameraAt(a->x, a->y);
+ setCameraAt(a->_pos.x, a->_pos.y);
}
}
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 74a57f7198..903c9dd4e2 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -108,24 +108,24 @@ void Scumm::CHARSET_1() {
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)