Skip to content

Commit

Permalink
SCUMM: use constants for c64 actor miscflags
Browse files Browse the repository at this point in the history
  • Loading branch information
tobigun committed Feb 11, 2012
1 parent 6b5abf6 commit b01f601
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 11 deletions.
13 changes: 12 additions & 1 deletion engines/scumm/actor.h
Expand Up @@ -335,10 +335,21 @@ class Actor_v2 : public Actor_v3 {
virtual void prepareDrawActorCostume(BaseCostumeRenderer *bcr);
};

enum ActorC64MiscFlags {
kActorMiscFlagStrong = 0x01, // Kid is strong (Hunk-O-Matic used)
kActorMiscFlag_02 = 0x02, // ???
kActorMiscFlag_04 = 0x04, // ???
kActorMiscFlagEdsEnemy = 0x08, // Kid is not Weird Ed's friend
kActorMiscFlag_10 = 0x10, // ???
kActorMiscFlag_20 = 0x20, // ???
kActorMiscFlagFreeze = 0x40, // Stop moving
kActorMiscFlagHide = 0x80, // Hide actor (e.g. dead or wearing radiation suit)
};

class ActorC64 : public Actor_v2 {
public:
byte _costCommand, _costFrame;
byte _miscflags; // 0x1: strong, 0x8: Ed's enemy, 0x40: stop moving, 0x80: hide(dead/radiation suit)
byte _miscflags;
byte _speaking, _speakingPrev;

public:
Expand Down
10 changes: 5 additions & 5 deletions engines/scumm/script_v0.cpp
Expand Up @@ -542,16 +542,16 @@ void ScummEngine_v0::o_loadRoom() {
}

void ScummEngine_v0::o_loadRoomWithEgo() {
Actor *a;
ActorC64 *a;
int obj, room, x, y, dir;

obj = fetchScriptByte();
room = fetchScriptByte();

a = derefActor(VAR(VAR_EGO), "o_loadRoomWithEgo");
a = (ActorC64 *)derefActor(VAR(VAR_EGO), "o_loadRoomWithEgo");

//0x634F
if (((ActorC64 *)a)->_miscflags & 0x40) {
if (a->_miscflags & kActorMiscFlagFreeze) {
// TODO: Check if this is the correct function
// to be calling here
stopObjectCode();
Expand Down Expand Up @@ -734,9 +734,9 @@ void ScummEngine_v0::o_setActorBitVar() {
a->_miscflags &= ~mask;

// This flag causes the actor to stop moving (used by script #158, Green Tentacle 'Oomph!')
if (a->_miscflags & 0x40)
if (a->_miscflags & kActorMiscFlagFreeze)
a->stopActorMoving();
if (a->_miscflags & 0x80)
if (a->_miscflags & kActorMiscFlagHide)
a->setActorCostume(0);

debug(0, "o_setActorBitVar(%d, %d, %d)", act, mask, mod);
Expand Down
10 changes: 5 additions & 5 deletions engines/scumm/verbs.cpp
Expand Up @@ -847,8 +847,8 @@ bool ScummEngine_v0::verbObtain(int obj) {
}

// Ignore verbs?
Actor *a = derefActor(VAR(VAR_EGO), "verbObtain");
if (((ActorC64 *)a)->_miscflags & 0x40) {
ActorC64 *a = (ActorC64 *)derefActor(VAR(VAR_EGO), "verbObtain");
if (a->_miscflags & kActorMiscFlagFreeze) {
resetSentence(false);
return false;
}
Expand Down Expand Up @@ -918,7 +918,7 @@ bool ScummEngine_v0::verbExec() {
if (verbMoveToActor(_activeObject2Nr)) {
// Ignore verbs?
Actor *a = derefActor(VAR(VAR_EGO), "verbExec");
if (((ActorC64 *)a)->_miscflags & 0x40) {
if (((ActorC64 *)a)->_miscflags & kActorMiscFlagFreeze) {
resetSentence(false);
return false;
}
Expand Down Expand Up @@ -1052,7 +1052,7 @@ void ScummEngine_v0::checkExecVerbs() {
}
}

if (a->_miscflags & 0x80) {
if (a->_miscflags & kActorMiscFlagHide) {
if (_activeVerb != kVerbNewKid) {
_activeVerb = kVerbNone;
}
Expand Down Expand Up @@ -1210,7 +1210,7 @@ void ScummEngine_v0::checkExecVerbs() {

if (zone->number == kMainVirtScreen) {
// Ignore verbs?
if (a->_miscflags & 0x40) {
if (a->_miscflags & kActorMiscFlagFreeze) {
resetSentence(false);
return;
}
Expand Down

0 comments on commit b01f601

Please sign in to comment.