aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/actor.cpp
diff options
context:
space:
mode:
authorsegrax2012-01-21 17:50:55 +1100
committerTobias Gunkel2012-02-11 08:29:02 +0100
commita999aa39ba4963b8c31b1db81f73bdc04e9b4772 (patch)
treec6efc978272b2445e0e26457caeeb411a36d2f26 /engines/scumm/actor.cpp
parente331421eae305fe857c1b630d5764e35635eaa7e (diff)
downloadscummvm-rg350-a999aa39ba4963b8c31b1db81f73bdc04e9b4772.tar.gz
scummvm-rg350-a999aa39ba4963b8c31b1db81f73bdc04e9b4772.tar.bz2
scummvm-rg350-a999aa39ba4963b8c31b1db81f73bdc04e9b4772.zip
SCUMM: Re-arrange some things to make it closer to the original
Diffstat (limited to 'engines/scumm/actor.cpp')
-rw-r--r--engines/scumm/actor.cpp45
1 files changed, 27 insertions, 18 deletions
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 ) {