From a999aa39ba4963b8c31b1db81f73bdc04e9b4772 Mon Sep 17 00:00:00 2001 From: segrax Date: Sat, 21 Jan 2012 17:50:55 +1100 Subject: SCUMM: Re-arrange some things to make it closer to the original --- engines/scumm/actor.cpp | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) (limited to 'engines/scumm/actor.cpp') diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp index 17e1f8cd82..090ad25c9a 100644 --- a/engines/scumm/actor.cpp +++ b/engines/scumm/actor.cpp @@ -319,6 +319,9 @@ int Actor::actorWalkStep() { int distX, distY; int nextFacing; + if( _vm->_game.version == 0 ) + ((ActorC64*) this)->_byte_FD0A = -1; + _needRedraw = true; nextFacing = updateActorDirection(true); @@ -857,18 +860,6 @@ void Actor::setDirection(int direction) { if (_costume == 0) return; - // V0 MM - if (_vm->_game.version == 0) { - - if (_moving) - _vm->_costumeLoader->costumeDecodeData(this, _walkFrame, 0); - else - _vm->_costumeLoader->costumeDecodeData(this, _standFrame, 0); - - _needRedraw = true; - return; - } - // Update the costume for the new direction (and mark the actor for redraw) aMask = 0x8000; for (i = 0; i < 16; i++, aMask >>= 1) { @@ -881,6 +872,27 @@ void Actor::setDirection(int direction) { _needRedraw = true; } +void ActorC64::setDirection(int direction) { + + // Normalize the angle + _facing = normalizeAngle(direction); + + // 0x2C17 + // _byte_FDE8 = -1; + + // If there is no costume set for this actor, we are finished + if (_costume == 0) + return; + + if (_moving) + _vm->_costumeLoader->costumeDecodeData(this, _walkFrame, 0); + else { + _vm->_costumeLoader->costumeDecodeData(this, _standFrame, 0); + } + + _needRedraw = true; +} + void Actor::faceToObject(int obj) { int x2, y2, dir; @@ -898,10 +910,6 @@ void Actor::turnToDirection(int newdir) { if (newdir == -1 || _ignoreTurns) return; - // 0x2C17 - if( _vm->_game.version == 0 ) - ((ActorC64*) this)->_byte_FD0A = -1; - if (_vm->_game.version <= 6) { _moving = MF_TURN; _targetFacing = newdir; @@ -2672,11 +2680,12 @@ void ActorC64::animateActor(int anim) { default: return; }*/ - - this->setDirection( dir ); + this->_byte_FD0A = this->_byte_FDE8; + this->setDirection( dir ); + } else { if( anim > 4 ) { -- cgit v1.2.3