[Scummvm-git-logs] scummvm master -> ecd02afeda52bc60b3e8dec83dcc15c18f1544cc

athrxx athrxx at scummvm.org
Fri Aug 6 14:14:00 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ecd02afeda SCUMM: minor v1-3 walk code cleanup


Commit: ecd02afeda52bc60b3e8dec83dcc15c18f1544cc
    https://github.com/scummvm/scummvm/commit/ecd02afeda52bc60b3e8dec83dcc15c18f1544cc
Author: athrxx (athrxx at scummvm.org)
Date: 2021-08-06T16:13:07+02:00

Commit Message:
SCUMM: minor v1-3 walk code cleanup

Changed paths:
    engines/scumm/actor.cpp
    engines/scumm/actor.h


diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index da68c635e6..9ee1393dd7 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -231,7 +231,7 @@ void Actor_v2::initActor(int mode) {
 
 void Actor_v3::initActor(int mode) {
 	if (mode == -1) {
-		_stepX = 0;
+		_stepX = 1;
 		_stepThreshold = 0;
 	}
 	Actor::initActor(mode);
@@ -537,21 +537,19 @@ int Actor_v3::calcMovementFactor(const Common::Point& next) {
 	int diffX = next.x - _pos.x;
 	int diffY = next.y - _pos.y;
 
-	if (_vm->_game.version <= 2) {
-		_stepThreshold = MAX(ABS(diffX), ABS(diffY));
-		deltaXFactor = deltaYFactor = 1;
-	} else {
+	if (_vm->_game.version == 3) {
 		// These two lines fix bug #1052 (INDY3: Hitler facing wrong directions in the Berlin scene).
 		// I can't see anything like this in the original SCUMM1/2 code, so I limit this to SCUMM3.
 		if (!(_moving & MF_LAST_LEG) && (int)_speedx > ABS(diffX) && (int)_speedy > ABS(diffY))
 			return 0;
 
 		_stepX = ((ABS(diffY) / (int)_speedy) >> 1) > (ABS(diffX) / (int)_speedx) ? _speedy + 1 : _speedx;
-		_stepThreshold = MAX(ABS(diffY) / _speedy, ABS(diffX) / _stepX);
-		deltaXFactor = (int32)_stepX;
-		deltaYFactor = (int32)_speedy;
 	}
 
+	_stepThreshold = MAX(ABS(diffY) / _speedy, ABS(diffX) / _stepX);
+	deltaXFactor = (int32)_stepX;
+	deltaYFactor = (int32)_speedy;
+
 	if (diffX < 0)
 		deltaXFactor = -deltaXFactor;
 	if (diffY < 0)
diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h
index 2b4d7e458a..540cc5df92 100644
--- a/engines/scumm/actor.h
+++ b/engines/scumm/actor.h
@@ -329,7 +329,7 @@ protected:
 
 class Actor_v3 : public Actor {
 public:
-	Actor_v3(ScummEngine *scumm, int id) : Actor(scumm, id), _stepX(0), _stepThreshold(0), _facingXYratio(scumm->_game.version == 3 ? 3 : 1) {}
+	Actor_v3(ScummEngine *scumm, int id) : Actor(scumm, id), _stepX(1), _stepThreshold(0), _facingXYratio(scumm->_game.version == 3 ? 3 : 1) {}
 
 	void initActor(int mode) override;
 	void walkActor() override;




More information about the Scummvm-git-logs mailing list