diff options
author | Max Horn | 2002-10-23 00:22:55 +0000 |
---|---|---|
committer | Max Horn | 2002-10-23 00:22:55 +0000 |
commit | df2bf812c3a40ce104f7ccd3a240e6f8d3303aa8 (patch) | |
tree | f7f33739217cf0a041b7e4757fe990b762e0c0cf | |
parent | dc65a40a73b8424f2ca9fa0790a5608e2571f7f4 (diff) | |
download | scummvm-rg350-df2bf812c3a40ce104f7ccd3a240e6f8d3303aa8.tar.gz scummvm-rg350-df2bf812c3a40ce104f7ccd3a240e6f8d3303aa8.tar.bz2 scummvm-rg350-df2bf812c3a40ce104f7ccd3a240e6f8d3303aa8.zip |
Actor::frame is never set, this should be researched
svn-id: r5269
-rw-r--r-- | scumm/actor.cpp | 38 | ||||
-rw-r--r-- | scumm/actor.h | 12 | ||||
-rw-r--r-- | scumm/saveload.cpp | 3 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 1 |
4 files changed, 33 insertions, 21 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 852749e34d..80b6667341 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -301,7 +301,7 @@ int Actor::actorWalkStep() direction = updateActorDirection(true); if (!(moving & MF_IN_LEG) || facing != direction) { - printf("walkFrame = %d, frame = %d\n", walkFrame, frame); + // FIXME - frame is never set and thus always 0! See actor.h comment if (walkFrame != frame || facing != direction) { startWalkAnim(walkFrame == frame ? 2 : 1, direction); } @@ -407,24 +407,24 @@ void Actor::setupActorScale() scaley = (byte)scale; } -void Actor::startAnimActor(int frame) +void Actor::startAnimActor(int f) { if (_vm->_features & GF_NEW_COSTUMES) { - switch (frame) { + switch (f) { case 1001: - frame = initFrame; + f = initFrame; break; case 1002: - frame = walkFrame; + f = walkFrame; break; case 1003: - frame = standFrame; + f = standFrame; break; case 1004: - frame = talkFrame1; + f = talkFrame1; break; case 1005: - frame = talkFrame2; + f = talkFrame2; break; } @@ -432,27 +432,27 @@ void Actor::startAnimActor(int frame) animProgress = 0; needRedraw = true; needBgReset = true; - if (frame == initFrame) + if (f == initFrame) cost.reset(); - _vm->akos_decodeData(this, frame, (uint) - 1); + _vm->akos_decodeData(this, f, (uint) - 1); } } else { - switch (frame) { + switch (f) { case 0x38: - frame = initFrame; + f = initFrame; break; case 0x39: - frame = walkFrame; + f = walkFrame; break; case 0x3A: - frame = standFrame; + f = standFrame; break; case 0x3B: - frame = talkFrame1; + f = talkFrame1; break; case 0x3C: - frame = talkFrame2; + f = talkFrame2; break; } @@ -461,11 +461,11 @@ void Actor::startAnimActor(int frame) cost.animCounter1 = 0; needRedraw = true; - if (initFrame == frame) + if (initFrame == f) cost.reset(); - if (frame != 0x3E) { - _vm->cost_decodeData(this, frame, (uint) - 1); + if (f != 0x3E) { + _vm->cost_decodeData(this, f, (uint) - 1); } } diff --git a/scumm/actor.h b/scumm/actor.h index e8fac7e559..ab6a1e4739 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -89,7 +89,17 @@ public: byte shadow_mode; bool flip; uint speedx, speedy; - byte frame; // FIXME - it seems this is never set? + + // FIXME: the "frame" field is never set, so it is always stays at 0. I am not sure + // if at some point in the past it was actually set (somebody wanna check?). There are + // two possibilities: either we just scratch this and hope all works fine, or we come + // up with a "correct" implementation. + // The actor.cpp code uses this to determine if the actor shows a walk animation. + // The script_v2.cpp code uses it for o6_kernelFunction:212. + // The save/load code (re)stores it. + // And debug.cpp prints it for debugging purposes. + byte frame; + byte walkbox; byte mask; // FIXME: This field is *NOT* used - remove next time save game format changes byte animProgress, animSpeed; diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index f1d07c1383..f11189b929 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -266,9 +266,10 @@ void Scumm::saveOrLoad(Serializer *s) MKLINE(Actor, cost.animCounter1, sleUint16), MKLINE(Actor, cost.animCounter2, sleByte), MKARRAY(Actor, palette[0], sleByte, 64), - MKLINE(Actor, mask, sleByte), + MKLINE(Actor, mask, sleByte), // FIXME: see actor.h comment MKLINE(Actor, shadow_mode, sleByte), MKLINE(Actor, visible, sleByte), + // FIXME - frame is never set and thus always 0! See actor.h comment MKLINE(Actor, frame, sleByte), MKLINE(Actor, animSpeed, sleByte), MKLINE(Actor, animProgress, sleByte), diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 191cd81d3a..03f257f66b 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -3071,6 +3071,7 @@ void Scumm::o6_kernelFunction() break; case 212: a = derefActorSafe(args[1], "o6_kernelFunction:212"); + // FIXME - frame is never set and thus always 0! See actor.h comment push(a->frame); break; case 215: |