aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsegrax2012-01-19 17:59:56 +1100
committerTobias Gunkel2012-02-11 08:28:59 +0100
commite2d45467bb6f0dc6d35fa33697bb97ae470f05f1 (patch)
treed26c3e3e231e2ed4379c6c56de8af08c87f23a15
parentf2c3675ed1306f82b5cb5d44d541739ff727dfde (diff)
downloadscummvm-rg350-e2d45467bb6f0dc6d35fa33697bb97ae470f05f1.tar.gz
scummvm-rg350-e2d45467bb6f0dc6d35fa33697bb97ae470f05f1.tar.bz2
scummvm-rg350-e2d45467bb6f0dc6d35fa33697bb97ae470f05f1.zip
SCUMM: improve unknown variable support, add case 0xff to the animateactor opcode
-rw-r--r--engines/scumm/actor.cpp8
-rw-r--r--engines/scumm/costume.cpp7
-rw-r--r--engines/scumm/script_v0.cpp21
3 files changed, 23 insertions, 13 deletions
diff --git a/engines/scumm/actor.cpp b/engines/scumm/actor.cpp
index e703c55192..c4b7c82a57 100644
--- a/engines/scumm/actor.cpp
+++ b/engines/scumm/actor.cpp
@@ -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() ) {
diff --git a/engines/scumm/costume.cpp b/engines/scumm/costume.cpp
index 68eeeea674..04e3f5986b 100644
--- a/engines/scumm/costume.cpp
+++ b/engines/scumm/costume.cpp
@@ -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;
diff --git a/engines/scumm/script_v0.cpp b/engines/scumm/script_v0.cpp
index caaf56878f..ec3cad009d 100644
--- a/engines/scumm/script_v0.cpp
+++ b/engines/scumm/script_v0.cpp
@@ -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);
}