diff options
author | segrax | 2012-01-21 17:50:55 +1100 |
---|---|---|
committer | Tobias Gunkel | 2012-02-11 08:29:02 +0100 |
commit | a999aa39ba4963b8c31b1db81f73bdc04e9b4772 (patch) | |
tree | c6efc978272b2445e0e26457caeeb411a36d2f26 /engines | |
parent | e331421eae305fe857c1b630d5764e35635eaa7e (diff) | |
download | scummvm-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')
-rw-r--r-- | engines/scumm/actor.cpp | 45 | ||||
-rw-r--r-- | engines/scumm/actor.h | 3 | ||||
-rw-r--r-- | engines/scumm/costume.cpp | 6 | ||||
-rw-r--r-- | engines/scumm/script_v0.cpp | 23 |
4 files changed, 42 insertions, 35 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 ) { diff --git a/engines/scumm/actor.h b/engines/scumm/actor.h index a2b36e51ca..0b3fcd7143 100644 --- a/engines/scumm/actor.h +++ b/engines/scumm/actor.h @@ -202,7 +202,7 @@ public: void adjustActorPos(); virtual AdjustBoxResult adjustXYToBeInBox(int dstX, int dstY); - void setDirection(int direction); + virtual void setDirection(int direction); void faceToObject(int obj); void turnToDirection(int newdir); virtual void walkActor(); @@ -379,6 +379,7 @@ public: } virtual void animateActor(int anim); + virtual void setDirection(int direction); // Used by the save/load system: virtual void saveLoadWithSerializer(Serializer *ser); diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp index 04e3f5986b..965cee79a8 100644 --- a/engines/scumm/costume.cpp +++ b/engines/scumm/costume.cpp @@ -1305,6 +1305,7 @@ void C64CostumeLoader::frameUpdate(ActorC64 *a, int cmd ) { if (limbFrames == 0xFF) continue; + // 0x2679 a->_byte_FCE2[limb] = a->_byte_FD0A; // Has limb frames ptr changed since last update? @@ -1407,13 +1408,8 @@ void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) { // Different command for stand frame if (frame == a->_standFrame) - { command = dirToDirStop(dir); - //0x2BEB - A->_byte_FDE8 = -1; - } - // Update the limb frames frameUpdate(A, command); diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp index ec3cad009d..e277480aed 100644 --- a/engines/scumm/script_v0.cpp +++ b/engines/scumm/script_v0.cpp @@ -672,19 +672,20 @@ void ScummEngine_v0::o_animateActor() { a->_byte_FDE8 = unk; switch( anim ) { - case 0xFE: - // 0x6993 - a->_speaking = 0x80; // Enabled, but not switching - return; - case 0xFD: - // 0x69A3 - a->_speaking = 0x00; - return; + case 0xFE: + // 0x6993 + a->_speaking = 0x80; // Enabled, but not switching + return; + + case 0xFD: + // 0x69A3 + a->_speaking = 0x00; + return; - case 0xFF: - a->stopActorMoving(); - return; + case 0xFF: + a->stopActorMoving(); + return; } a->animateActor(anim); |