[Scummvm-cvs-logs] scummvm master -> 801bfedfc098d6335ef3b4517dc10d3ac75a6b8a

Kirben kirben at optusnet.com.au
Mon Dec 8 09:30:22 CET 2014


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

Summary:
d92e47f4e6 SCUMM V1-V2: Fix actor walk behavior (transitions between walk boxes, and changing destination issue)
801bfedfc0 Merge pull request #542 from segrax/V1-V2_WalkAnimFix


Commit: d92e47f4e6ff7187ac0dca9ad1c54b2c96fda1b9
    https://github.com/scummvm/scummvm/commit/d92e47f4e6ff7187ac0dca9ad1c54b2c96fda1b9
Author: Robert Crossfield (robcrossfield at gmail.com)
Date: 2014-12-08T13:14:12+11:00

Commit Message:
SCUMM V1-V2: Fix actor walk behavior (transitions between walk boxes, and changing destination issue)

Changed paths:
    engines/scumm/actor.cpp



diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index 59a1009..07c8f84 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -385,13 +385,28 @@ int Actor::actorWalkStep() {
 		return 0;
 	}
 
-	tmpX = (_pos.x << 16) + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
-	_walkdata.xfrac = (uint16)tmpX;
-	_pos.x = (tmpX >> 16);
+	if (_vm->_game.version <= 2) {
+		if (_walkdata.deltaXFactor != 0) {
+			if (_walkdata.deltaXFactor > 0)
+				_pos.x += 1;
+			else
+				_pos.x -= 1;
+		}
+		if (_walkdata.deltaYFactor != 0) {
+			if (_walkdata.deltaYFactor > 0)
+				_pos.y += 1;
+			else
+				_pos.y -= 1;
+		}
+	} else {
+		tmpX = (_pos.x << 16) + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
+		_walkdata.xfrac = (uint16)tmpX;
+		_pos.x = (tmpX >> 16);
 
-	tmpY = (_pos.y << 16) + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
-	_walkdata.yfrac = (uint16)tmpY;
-	_pos.y = (tmpY >> 16);
+		tmpY = (_pos.y << 16) + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
+		_walkdata.yfrac = (uint16)tmpY;
+		_pos.y = (tmpY >> 16);
+	}
 
 	if (ABS(_pos.x - _walkdata.cur.x) > distX) {
 		_pos.x = _walkdata.next.x;
@@ -401,7 +416,7 @@ int Actor::actorWalkStep() {
 		_pos.y = _walkdata.next.y;
 	}
 
-	if (_vm->_game.version >= 4 && _vm->_game.version <= 6 && _pos == _walkdata.next) {
+	if ((_vm->_game.version <= 2 || (_vm->_game.version >= 4 && _vm->_game.version <= 6)) && _pos == _walkdata.next) {
 		_moving &= ~MF_IN_LEG;
 		return 0;
 	}
@@ -565,14 +580,17 @@ void Actor::startWalkActor(int destX, int destY, int dir) {
 	_walkdata.dest.y = abr.y;
 	_walkdata.destbox = abr.box;
 	_walkdata.destdir = dir;
-	_walkdata.point3.x = 32000;
-	_walkdata.curbox = _walkbox;
-
+	
 	if (_vm->_game.version == 0) {
 		((Actor_v0*)this)->_newWalkBoxEntered = true;
-	} else {
-		_moving = (_moving & MF_IN_LEG) | MF_NEW_LEG;
-	}
+	} else if (_vm->_game.version <= 2) {
+		_moving = (_moving & ~(MF_LAST_LEG | MF_IN_LEG)) | MF_NEW_LEG;
+ 	} else {
+ 		_moving = (_moving & MF_IN_LEG) | MF_NEW_LEG;
+ 	}
+
+	_walkdata.point3.x = 32000;
+	_walkdata.curbox = _walkbox;
 }
 
 void Actor::startWalkAnim(int cmd, int angle) {


Commit: 801bfedfc098d6335ef3b4517dc10d3ac75a6b8a
    https://github.com/scummvm/scummvm/commit/801bfedfc098d6335ef3b4517dc10d3ac75a6b8a
Author: Kirben (kirben at optusnet.com.au)
Date: 2014-12-08T19:29:29+11:00

Commit Message:
Merge pull request #542 from segrax/V1-V2_WalkAnimFix

SCUMM V1-V2: Fix actor walk behavior (transitions between walk boxes, and changing destination issue)

Changed paths:
    engines/scumm/actor.cpp









More information about the Scummvm-git-logs mailing list