SCUMM: Re-arrange some things to make it closer to the original
This commit is contained in:
parent
e331421eae
commit
a999aa39ba
4 changed files with 42 additions and 35 deletions
|
@ -319,6 +319,9 @@ int Actor::actorWalkStep() {
|
||||||
int distX, distY;
|
int distX, distY;
|
||||||
int nextFacing;
|
int nextFacing;
|
||||||
|
|
||||||
|
if( _vm->_game.version == 0 )
|
||||||
|
((ActorC64*) this)->_byte_FD0A = -1;
|
||||||
|
|
||||||
_needRedraw = true;
|
_needRedraw = true;
|
||||||
|
|
||||||
nextFacing = updateActorDirection(true);
|
nextFacing = updateActorDirection(true);
|
||||||
|
@ -857,18 +860,6 @@ void Actor::setDirection(int direction) {
|
||||||
if (_costume == 0)
|
if (_costume == 0)
|
||||||
return;
|
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)
|
// Update the costume for the new direction (and mark the actor for redraw)
|
||||||
aMask = 0x8000;
|
aMask = 0x8000;
|
||||||
for (i = 0; i < 16; i++, aMask >>= 1) {
|
for (i = 0; i < 16; i++, aMask >>= 1) {
|
||||||
|
@ -881,6 +872,27 @@ void Actor::setDirection(int direction) {
|
||||||
_needRedraw = true;
|
_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) {
|
void Actor::faceToObject(int obj) {
|
||||||
int x2, y2, dir;
|
int x2, y2, dir;
|
||||||
|
|
||||||
|
@ -898,10 +910,6 @@ void Actor::turnToDirection(int newdir) {
|
||||||
if (newdir == -1 || _ignoreTurns)
|
if (newdir == -1 || _ignoreTurns)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// 0x2C17
|
|
||||||
if( _vm->_game.version == 0 )
|
|
||||||
((ActorC64*) this)->_byte_FD0A = -1;
|
|
||||||
|
|
||||||
if (_vm->_game.version <= 6) {
|
if (_vm->_game.version <= 6) {
|
||||||
_moving = MF_TURN;
|
_moving = MF_TURN;
|
||||||
_targetFacing = newdir;
|
_targetFacing = newdir;
|
||||||
|
@ -2673,10 +2681,11 @@ void ActorC64::animateActor(int anim) {
|
||||||
return;
|
return;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
this->setDirection( dir );
|
|
||||||
|
|
||||||
this->_byte_FD0A = this->_byte_FDE8;
|
this->_byte_FD0A = this->_byte_FDE8;
|
||||||
|
|
||||||
|
this->setDirection( dir );
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if( anim > 4 ) {
|
if( anim > 4 ) {
|
||||||
|
|
|
@ -202,7 +202,7 @@ public:
|
||||||
void adjustActorPos();
|
void adjustActorPos();
|
||||||
virtual AdjustBoxResult adjustXYToBeInBox(int dstX, int dstY);
|
virtual AdjustBoxResult adjustXYToBeInBox(int dstX, int dstY);
|
||||||
|
|
||||||
void setDirection(int direction);
|
virtual void setDirection(int direction);
|
||||||
void faceToObject(int obj);
|
void faceToObject(int obj);
|
||||||
void turnToDirection(int newdir);
|
void turnToDirection(int newdir);
|
||||||
virtual void walkActor();
|
virtual void walkActor();
|
||||||
|
@ -379,6 +379,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void animateActor(int anim);
|
virtual void animateActor(int anim);
|
||||||
|
virtual void setDirection(int direction);
|
||||||
|
|
||||||
// Used by the save/load system:
|
// Used by the save/load system:
|
||||||
virtual void saveLoadWithSerializer(Serializer *ser);
|
virtual void saveLoadWithSerializer(Serializer *ser);
|
||||||
|
|
|
@ -1305,6 +1305,7 @@ void C64CostumeLoader::frameUpdate(ActorC64 *a, int cmd ) {
|
||||||
if (limbFrames == 0xFF)
|
if (limbFrames == 0xFF)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// 0x2679
|
||||||
a->_byte_FCE2[limb] = a->_byte_FD0A;
|
a->_byte_FCE2[limb] = a->_byte_FD0A;
|
||||||
|
|
||||||
// Has limb frames ptr changed since last update?
|
// 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
|
// Different command for stand frame
|
||||||
if (frame == a->_standFrame)
|
if (frame == a->_standFrame)
|
||||||
{
|
|
||||||
command = dirToDirStop(dir);
|
command = dirToDirStop(dir);
|
||||||
|
|
||||||
//0x2BEB
|
|
||||||
A->_byte_FDE8 = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the limb frames
|
// Update the limb frames
|
||||||
frameUpdate(A, command);
|
frameUpdate(A, command);
|
||||||
|
|
||||||
|
|
|
@ -672,6 +672,7 @@ void ScummEngine_v0::o_animateActor() {
|
||||||
a->_byte_FDE8 = unk;
|
a->_byte_FDE8 = unk;
|
||||||
|
|
||||||
switch( anim ) {
|
switch( anim ) {
|
||||||
|
|
||||||
case 0xFE:
|
case 0xFE:
|
||||||
// 0x6993
|
// 0x6993
|
||||||
a->_speaking = 0x80; // Enabled, but not switching
|
a->_speaking = 0x80; // Enabled, but not switching
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue