aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
authorPaul Gilbert2010-07-15 12:37:46 +0000
committerPaul Gilbert2010-07-15 12:37:46 +0000
commit20a0ad6833fd50ed32e660a652ab962cb75d92ca (patch)
tree24dadf8b39ddb2f187242f60fa6e4819a2fc2ede /engines/m4
parent43662625111838729d776cd13708382d9ac6b270 (diff)
downloadscummvm-rg350-20a0ad6833fd50ed32e660a652ab962cb75d92ca.tar.gz
scummvm-rg350-20a0ad6833fd50ed32e660a652ab962cb75d92ca.tar.bz2
scummvm-rg350-20a0ad6833fd50ed32e660a652ab962cb75d92ca.zip
Bugfixes to walking code. Rex can now walk about on-screen
svn-id: r50914
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/mads_player.cpp14
-rw-r--r--engines/m4/mads_scene.cpp4
2 files changed, 11 insertions, 7 deletions
diff --git a/engines/m4/mads_player.cpp b/engines/m4/mads_player.cpp
index 7a16938248..ff5f3464bf 100644
--- a/engines/m4/mads_player.cpp
+++ b/engines/m4/mads_player.cpp
@@ -503,14 +503,14 @@ void MadsPlayer::move() {
if (_v8452C < _posDiff.x)
_v8452C += _posDiff.y;
if (_v8452C >= _posDiff.x) {
- if ((_posChange.y <= 0) || (_v844C0 != 0))
+ if ((_posChange.y > 0) || (_v844C0 != 0))
newPos.y += _yDirection;
--_posChange.y;
_v8452C -= _posDiff.x;
}
if (_v8452C < _posDiff.x) {
- if ((_posChange.x <= 0) || (_v844C0 != 0))
+ if ((_posChange.x > 0) || (_v844C0 != 0))
newPos.x += _xDirection;
--_posChange.x;
}
@@ -524,9 +524,11 @@ void MadsPlayer::move() {
_v8452E += _v84530;
- } while ((_v8452E < var1) && !routeFlag && ((_posChange.x > 0) || (_posChange.y > 0)));
+ } while ((_v8452E < var1) && !routeFlag && ((_posChange.x > 0) || (_posChange.y > 0) || (_v844C0 != 0)));
}
+ _v8452E -= var1;
+
if (routeFlag)
moveComplete();
else {
@@ -696,7 +698,7 @@ void MadsPlayer::startMovement() {
else if (yDiff == 0)
majorDir = 3;
else {
- if ((scaleAmount >= xDiff) && ((xAmt33 / scaleAmount) >= 141))
+ if ((scaleAmount < xDiff) && ((xAmt33 / scaleAmount) >= 141))
majorDir = 3;
else if (yDiff <= xDiff)
majorDir = 2;
@@ -727,8 +729,8 @@ void MadsPlayer::startMovement() {
_posChange.x = xDiff;
_posChange.y = yDiff;
- scaleAmount = MAX(xDiff, yDiff);
- _v84530 = (scaleAmount == 0) ? 0 : _hypotenuse / scaleAmount;
+ int majorChange = MAX(xDiff, yDiff);
+ _v84530 = (majorChange == 0) ? 0 : _hypotenuse / majorChange;
if (_playerPos.x > _destPos.x)
_v8452C = MAX(_posChange.x, _posChange.y);
diff --git a/engines/m4/mads_scene.cpp b/engines/m4/mads_scene.cpp
index 3f4b0df1ff..c30e8db5da 100644
--- a/engines/m4/mads_scene.cpp
+++ b/engines/m4/mads_scene.cpp
@@ -854,7 +854,9 @@ void MadsSceneResources::load(int sceneNumber, const char *resName, int v0, M4Su
}
void MadsSceneResources::setRouteNode(int nodeIndex, const Common::Point &pt, M4Surface *depthSurface) {
- // TODO
+ _nodes[nodeIndex].pt = pt;
+
+ // TODO: Implement the rest of the logic of this method
}
/*--------------------------------------------------------------------------*/