aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2003-07-12 17:53:22 +0000
committerMax Horn2003-07-12 17:53:22 +0000
commitfd82895ff5e6ec3f43907c63b36b0ceeded4f478 (patch)
treef1f92af09325c5914d2e92f4547a90a8fd0549db
parent8b27f60434cbf47a0362d6560d3cda745e076a6d (diff)
downloadscummvm-rg350-fd82895ff5e6ec3f43907c63b36b0ceeded4f478.tar.gz
scummvm-rg350-fd82895ff5e6ec3f43907c63b36b0ceeded4f478.tar.bz2
scummvm-rg350-fd82895ff5e6ec3f43907c63b36b0ceeded4f478.zip
adjusted V2 actor position to match original (MM) interpreter; tweaked adjustXYToBeInBox mod for V2 (so it's clear why it is needed)
svn-id: r8952
-rw-r--r--scumm/actor.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 6dad929747..a8c56b6dfd 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -627,7 +627,9 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {
if (numBoxes < firstValidBox)
return abr;
- bestDist = (_vm->_version <= 2) ? 0xFFFFFF : 0xFFFF;
+ bestDist = 0xFFFF;
+ if (_vm->_version <= 2)
+ bestDist *= 8*2; // Adjust for the fact that we multiply x by 8 and y by 2
bestBox = kInvalidBox;
// We iterate (backwards) over all boxes, searching the one closest
@@ -902,14 +904,21 @@ void Actor::drawActorCostume() {
BaseCostumeRenderer* bcr = _vm->_costumeRenderer;
- bcr->updateNbStrips ();
+ bcr->updateNbStrips();
bcr->_actorX = x - _vm->virtscr[0].xstart;
bcr->_actorY = y - elevation;
+
if (_vm->_version <= 2) {
- // We have to adjust the x position by one strip (8 pixels) in V2 games
- bcr->_actorX += 8;
+ // FIXME: We have to adjust the x position by one strip (8 pixels) in V2 games
+ // However, it is not quite clear to me why. And to fully match the original,
+ // it seems we have to offset by 2 strips when facing left (270 degree).
+ if (facing == 270)
+ bcr->_actorX += 16;
+ else
+ bcr->_actorX += 8;
}
+
bcr->_scaleX = scalex;
bcr->_scaleY = scaley;