SCUMM: improve unknown variable support, add case 0xff to the animateactor opcode

This commit is contained in:
segrax 2012-01-19 17:59:56 +11:00 committed by Tobias Gunkel
parent f2c3675ed1
commit e2d45467bb
3 changed files with 23 additions and 13 deletions

View File

@ -847,7 +847,7 @@ void Actor::setDirection(int direction) {
direction = 90;
// Do nothing if actor is already facing in the given direction
if (_facing == direction)
if (_vm->_game.version != 0 && _facing == direction)
return;
// Normalize the angle
@ -1294,6 +1294,10 @@ void Actor::showActor() {
_vm->ensureResourceLoaded(rtCostume, _costume);
if (_vm->_game.version == 0) {
// 0x39DF
((ActorC64*) this)->_byte_FDE8 = 1;
_cost.reset();
startAnimActor(_standFrame);
} else if (_vm->_game.version <= 2) {
@ -2646,8 +2650,6 @@ void ScummEngine_v71he::queueAuxEntry(int actorNum, int subIndex) {
#endif
void ActorC64::animateActor(int anim) {
Actor::animateActor(anim);
return;
int dir = oldDirToNewDir(anim % 4);
if( this->isInCurrentRoom() ) {

View File

@ -1378,6 +1378,8 @@ void C64CostumeLoader::actorSpeak(ActorC64 *a, int &cmd) {
cmd += 0x0C;
else
cmd += 0x10;
a->_byte_FDE8 = -1;
}
void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
@ -1408,7 +1410,8 @@ void C64CostumeLoader::costumeDecodeData(Actor *a, int frame, uint usemask) {
{
command = dirToDirStop(dir);
A->_byte_FDE8 = 0xFF;
//0x2BEB
A->_byte_FDE8 = -1;
}
// Update the limb frames
@ -1472,7 +1475,7 @@ byte C64CostumeLoader::increaseAnims(Actor *a) {
//A->_limbCommand[limb] = 0xFF;
} else {
if( A->_byte_FCE2[limb] != 0xFF )
if( A->_byte_FCE2[limb] != -1 )
--A->_byte_FCE2[limb];
a->_cost.curpos[limb] = 0;

View File

@ -663,24 +663,29 @@ void ScummEngine_v0::o_lights() {
void ScummEngine_v0::o_animateActor() {
int act = getVarOrDirectByte(PARAM_1);
int anim = getVarOrDirectByte(PARAM_2);
int unk = fetchScriptByte();
int8 unk = (int8) fetchScriptByte();
debug(0,"o_animateActor: unk %d", unk);
ActorC64 *a = (ActorC64*) derefActor(act, "o_animateActor");
a->_byte_FDE8 = unk;
// 0x6993
if (anim == 0xFE) {
switch( anim ) {
case 0xFE:
// 0x6993
a->_speaking = 0x80; // Enabled, but not switching
return;
}
// 0x69A3
if (anim == 0xFD) {
case 0xFD:
// 0x69A3
a->_speaking = 0x00;
return;
}
case 0xFF:
a->stopActorMoving();
return;
}
a->animateActor(anim);
}