Mass-renamed all variables of Actor object according to our current code

formatting standards. Earlier we had half of vars named with leading
underscore and half without it.

Now code in actor.cpp is considerably more readable.

svn-id: r17068
This commit is contained in:
Eugene Sandulenko 2005-03-11 01:10:06 +00:00
parent 3cf691e9f9
commit 154c4af8dc
23 changed files with 878 additions and 878 deletions

File diff suppressed because it is too large Load diff

View file

@ -96,21 +96,21 @@ public:
Common::Rect _clipOverride;
int _offsX, _offsY;
int top, bottom;
uint width;
byte number;
uint16 costume;
byte room;
byte talkColor;
int talkFrequency;
byte talkPan;
byte talkVolume;
uint16 boxscale;
byte scalex, scaley;
byte charset;
byte moving;
bool ignoreBoxes;
byte forceClip;
int _top, _bottom;
uint _width;
byte _number;
uint16 _costume;
byte _room;
byte _talkColor;
int _talkFrequency;
byte _talkPan;
byte _talkVolume;
uint16 _boxscale;
byte _scalex, _scaley;
byte _charset;
byte _moving;
bool _ignoreBoxes;
byte _forceClip;
byte _initFrame;
byte _walkFrame;
@ -118,45 +118,45 @@ public:
byte _talkStartFrame;
byte _talkStopFrame;
bool needRedraw, needBgReset, visible;
bool _needRedraw, _needBgReset, _visible;
byte _shadowMode;
bool flip;
byte frame;
bool _flip;
byte _frame;
byte _walkbox;
int16 talkPosX, talkPosY;
uint16 talkScript, walkScript;
bool ignoreTurns;
bool drawToBackBuf;
int16 _talkPosX, _talkPosY;
uint16 _talkScript, _walkScript;
bool _ignoreTurns;
bool _drawToBackBuf;
int8 _layer;
uint16 sound[32];
CostumeData cost;
uint16 _sound[32];
CostumeData _cost;
/* HE specific */
byte hePaletteNum;
bool heNoTalkAnimation;
bool heSkipLimbs;
byte _hePaletteNum;
bool _heNoTalkAnimation;
bool _heSkipLimbs;
bool _heTalking;
uint32 heCondMask;
uint32 _heCondMask;
AuxBlock auxBlock;
AuxBlock _auxBlock;
struct {
int16 posX;
int16 posY;
int16 color;
byte sentence[128];
} heTalkQueue[16];
} _heTalkQueue[16];
protected:
byte palette[256];
byte _palette[256];
int _elevation;
uint16 facing;
uint16 targetFacing;
uint speedx, speedy;
byte animProgress, animSpeed;
bool costumeNeedsInit;
ActorWalkData walkdata;
int16 animVariable[27];
uint16 _facing;
uint16 _targetFacing;
uint _speedx, _speedy;
byte _animProgress, _animSpeed;
bool _costumeNeedsInit;
ActorWalkData _walkdata;
int16 _animVariable[27];
static ScummEngine *_vm;
@ -212,39 +212,39 @@ public:
void animateActor(int anim);
bool isInCurrentRoom() const {
return room == _vm->_currentRoom;
return _room == _vm->_currentRoom;
}
int getActorXYPos(int &x, int &y) const;
int getRoom() const {
return room;
return _room;
}
int getFacing() const {
return facing;
return _facing;
}
int getAnimVar(byte var) const {
checkRange(26, 0, var, "getAnimVar %d out of range(r)");
return animVariable[var];
return _animVariable[var];
}
void setAnimVar(byte var, int value) {
checkRange(26, 0, var, "setAnimVar %d out of range(r)");
animVariable[var] = value;
_animVariable[var] = value;
}
void setAnimSpeed(byte newAnimSpeed) {
animSpeed = newAnimSpeed;
animProgress = 0;
_animSpeed = newAnimSpeed;
_animProgress = 0;
}
int getAnimSpeed() const {
return animSpeed;
return _animSpeed;
}
int getAnimProgress() const {
return animProgress;
return _animProgress;
}
int getElevation() const {
@ -254,21 +254,21 @@ public:
void setElevation(int newElevation) {
if (_elevation != newElevation) {
_elevation = newElevation;
needRedraw = true;
_needRedraw = true;
}
}
void setPalette(int idx, int val) {
palette[idx] = val;
needRedraw = true;
_palette[idx] = val;
_needRedraw = true;
}
void setScale(int sx, int sy) {
if (sx != -1)
scalex = sx;
_scalex = sx;
if (sy != -1)
scaley = sy;
needRedraw = true;
_scaley = sy;
_needRedraw = true;
}
void classChanged(int cls, bool value);

View file

@ -149,7 +149,7 @@ bool ScummEngine::akos_hasManyDirections(int costume) {
}
int ScummEngine::akos_frameToAnim(Actor *a, int frame) {
if (_version >= 7 && akos_hasManyDirections(a->costume))
if (_version >= 7 && akos_hasManyDirections(a->_costume))
return toSimpleDir(1, a->getFacing()) + frame * 8;
else
return newDirToOldDir(a->getFacing()) + frame * 4;
@ -165,12 +165,12 @@ void ScummEngine::akos_decodeData(Actor *a, int frame, uint usemask) {
uint16 start, len;
uint16 mask;
if (a->costume == 0)
if (a->_costume == 0)
return;
anim = akos_frameToAnim(a, frame);
akos = getResourceAddress(rtCostume, a->costume);
akos = getResourceAddress(rtCostume, a->_costume);
assert(akos);
akhd = (const AkosHeader *)findResourceData(MKID('AKHD'), akos);
@ -197,12 +197,12 @@ void ScummEngine::akos_decodeData(Actor *a, int frame, uint usemask) {
if (usemask & 0x8000) {
switch (code) {
case 1:
a->cost.active[i] = 0;
a->cost.frame[i] = frame;
a->cost.end[i] = 0;
a->cost.start[i] = 0;
a->cost.curpos[i] = 0;
a->cost.seq3[i] = 0;
a->_cost.active[i] = 0;
a->_cost.frame[i] = frame;
a->_cost.end[i] = 0;
a->_cost.start[i] = 0;
a->_cost.curpos[i] = 0;
a->_cost.seq3[i] = 0;
if (akst) {
int size = getResourceDataSize(akst) / 8;
@ -210,69 +210,69 @@ void ScummEngine::akos_decodeData(Actor *a, int frame, uint usemask) {
bool found = false;
while (size--) {
if (READ_LE_UINT32(akst) == 0) {
a->cost.seq3[i] = READ_LE_UINT32(akst + 4);
a->_cost.seq3[i] = READ_LE_UINT32(akst + 4);
found = true;
break;
}
akst += 8;
}
if (!found) {
warning("Sequence not found in actor 0x%X costume %d", a, a->costume);
warning("Sequence not found in actor 0x%X costume %d", a, a->_costume);
}
}
}
break;
case 4:
a->cost.stopped |= 1 << i;
a->_cost.stopped |= 1 << i;
break;
case 5:
a->cost.stopped &= ~(1 << i);
a->_cost.stopped &= ~(1 << i);
break;
default:
start = READ_LE_UINT16(r); r += 2;
len = READ_LE_UINT16(r); r += 2;
a->cost.seq1[i] = 0;
a->cost.seq2[i] = 0;
a->_cost.seq1[i] = 0;
a->_cost.seq2[i] = 0;
if (aksf) {
int size = getResourceDataSize(aksf) / 6;
if (size > 0) {
bool found = false;
while (size--) {
if (READ_LE_UINT16(aksf) == start) {
a->cost.seq1[i] = READ_LE_UINT16(aksf + 2);
a->cost.seq2[i] = READ_LE_UINT16(aksf + 4);
a->_cost.seq1[i] = READ_LE_UINT16(aksf + 2);
a->_cost.seq2[i] = READ_LE_UINT16(aksf + 4);
found = true;
break;
}
aksf += 6;
}
if (!found) {
warning("Sequence not found in actor 0x%X costume %d", a, a->costume);
warning("Sequence not found in actor 0x%X costume %d", a, a->_costume);
}
}
}
a->cost.active[i] = code;
a->cost.frame[i] = frame;
a->cost.end[i] = start + len;
a->cost.start[i] = start;
a->cost.curpos[i] = start;
a->cost.seq3[i] = 0;
a->_cost.active[i] = code;
a->_cost.frame[i] = frame;
a->_cost.end[i] = start + len;
a->_cost.start[i] = start;
a->_cost.curpos[i] = start;
a->_cost.seq3[i] = 0;
if (akst) {
int size = getResourceDataSize(akst) / 8;
if (size > 0) {
bool found = false;
while (size--) {
if (READ_LE_UINT32(akst) == start) {
a->cost.seq3[i] = READ_LE_UINT32(akst + 4);
a->_cost.seq3[i] = READ_LE_UINT32(akst + 4);
found = true;
break;
}
akst += 8;
}
if (!found) {
warning("Sequence not found in actor 0x%X costume %d", a, a->costume);
warning("Sequence not found in actor 0x%X costume %d", a, a->_costume);
}
}
}
@ -337,7 +337,7 @@ void AkosRenderer::setCostume(int costume) {
void AkosRenderer::setFacing(const Actor *a) {
_mirror = (newDirToOldDir(a->getFacing()) != 0 || akhd->flags & 1);
if (a->flip)
if (a->_flip)
_mirror = !_mirror;
}
@ -345,7 +345,7 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
uint code;
const byte *p;
const AkosOffset *off;
const CostumeData &cost = a->cost;
const CostumeData &cost = a->_cost;
const CostumeInfo *costumeInfo;
uint i, extra;
byte result = 0;
@ -465,11 +465,11 @@ byte AkosRenderer::drawLimb(const Actor *a, int limb) {
uint32 type = cond & 0xC0000000;
cond &= 0x3FFFFFFF;
if (type == 0x40000000) {
decflag = (a->heCondMask & cond) ? 1 : 0;
decflag = (a->_heCondMask & cond) ? 1 : 0;
} else if (type == 0x80000000) {
decflag = (a->heCondMask & cond) ? 0 : 1;
decflag = (a->_heCondMask & cond) ? 0 : 1;
} else {
decflag = (a->heCondMask & cond) ? 1 : 0;
decflag = (a->_heCondMask & cond) ? 1 : 0;
}
}
}
@ -1256,7 +1256,7 @@ bool ScummEngine::akos_increaseAnims(const byte *akos, Actor *a) {
result = false;
for (i = 0; i < 16; i++) {
if (a->cost.active[i] != 0)
if (a->_cost.active[i] != 0)
result |= akos_increaseAnim(a, i, aksq, (const uint16 *)akfo, size);
}
return result;
@ -1273,9 +1273,9 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
bool flag_value, needRedraw;
int tmp, tmp2;
active = a->cost.active[chan];
end = a->cost.end[chan];
old_curpos = curpos = a->cost.curpos[chan];
active = a->_cost.active[chan];
end = a->_cost.end[chan];
old_curpos = curpos = a->_cost.curpos[chan];
flag_value = false;
needRedraw = false;
@ -1388,7 +1388,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
case 2:
curpos += (code & 0x8000) ? 2 : 1;
if (curpos > end)
curpos = a->cost.start[chan];
curpos = a->_cost.start[chan];
break;
case 3:
if (curpos != end)
@ -1432,7 +1432,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
a->setAnimVar(GB(4), a->getAnimVar(GB(4)) + GW(2));
continue;
case AKC_Flip:
a->flip = GW(2) != 0;
a->_flip = GW(2) != 0;
continue;
case AKC_CmdQue3:
case AKC_C042:
@ -1441,10 +1441,10 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
else
tmp = GB(2) - 1;
if ((uint) tmp < 24)
akos_queCommand(3, a, a->sound[tmp], 0);
akos_queCommand(3, a, a->_sound[tmp], 0);
continue;
case AKC_CmdQue3Quick:
akos_queCommand(3, a, a->sound[0], 0);
akos_queCommand(3, a, a->_sound[0], 0);
continue;
case AKC_StartAnim:
akos_queCommand(4, a, GB(2), 0);
@ -1470,7 +1470,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
tmp2 = GB(4);
if (tmp2 < 1 || tmp2 > 3)
error("akos_increaseAnim:8 invalid code %d", tmp2);
akos_queCommand(tmp2 + 6, a, a->sound[tmp], GB(6));
akos_queCommand(tmp2 + 6, a, a->_sound[tmp], GB(6));
continue;
case AKC_SetDrawOffs:
akos_queCommand(6, a, GW(2), GW(4));
@ -1480,9 +1480,9 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
error("akos_increaseAnim: no AKFO table");
tmp = a->getAnimVar(GB(2)) - 1;
if (_heversion >= 80) {
if (tmp < 0 || tmp > a->cost.seq2[chan] - 1)
if (tmp < 0 || tmp > a->_cost.seq2[chan] - 1)
error("akos_increaseAnim: invalid jump value %d", tmp);
curpos = READ_LE_UINT16(akfo + a->cost.seq1[chan] + tmp * 2);
curpos = READ_LE_UINT16(akfo + a->_cost.seq1[chan] + tmp * 2);
} else {
if (tmp < 0 || tmp > numakfo - 1)
error("akos_increaseAnim: invalid jump value %d", tmp);
@ -1523,7 +1523,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
case AKC_Ignore2:
if (_heversion >= 71)
akos_queCommand(3, a, a->sound[a->getAnimVar(GB(2))], 0);
akos_queCommand(3, a, a->_sound[a->getAnimVar(GB(2))], 0);
continue;
case AKC_SkipE:
@ -1554,31 +1554,31 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
akos_queCommand(8, a, a->getAnimVar(GB(2)), 0);
continue;
case AKC_C016:
if (_sound->isSoundRunning( a->sound[a->getAnimVar(GB(4))])) {
if (_sound->isSoundRunning( a->_sound[a->getAnimVar(GB(4))])) {
curpos = GUW(2);
break;
}
continue;
case AKC_C017:
if (!_sound->isSoundRunning(a->sound[a->getAnimVar(GB(4))])) {
if (!_sound->isSoundRunning(a->_sound[a->getAnimVar(GB(4))])) {
curpos = GUW(2);
break;
}
continue;
case AKC_C018:
if (_sound->isSoundRunning(a->sound[GB(4)])) {
if (_sound->isSoundRunning(a->_sound[GB(4)])) {
curpos = GUW(2);
break;
}
continue;
case AKC_C019:
if (!_sound->isSoundRunning(a->sound[GB(4)])) {
if (!_sound->isSoundRunning(a->_sound[GB(4)])) {
curpos = GUW(2);
break;
}
continue;
case AKC_C044:
akos_queCommand(3, a, a->sound[a->getAnimVar(GB(2))], 0);
akos_queCommand(3, a, a->_sound[a->getAnimVar(GB(2))], 0);
continue;
case AKC_C045:
@ -1610,7 +1610,7 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const
assert((code2 & 0xC000) != 0xC000 || code2 == AKC_ComplexChan || code2 == AKC_Return || code2 == AKC_EndSeq || code2 == AKC_C08E || code2 == AKC_ComplexChan2 || code2 == AKC_C021 || code2 == AKC_C022);
a->cost.curpos[chan] = curpos;
a->_cost.curpos[chan] = curpos;
if (needRedraw)
return 1;
@ -1623,7 +1623,7 @@ void ScummEngine::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2)
checkRange(31, 0, _akosQueuePos, "akos_queCommand overflow");
_akosQueue[_akosQueuePos].cmd = cmd;
_akosQueue[_akosQueuePos].actor = a->number;
_akosQueue[_akosQueuePos].actor = a->_number;
_akosQueue[_akosQueuePos].param1 = param_1;
_akosQueue[_akosQueuePos].param2 = param_2;
}
@ -1646,7 +1646,7 @@ void ScummEngine::akos_processQueue() {
a->putActor(0, 0, 0);
break;
case 2:
warning("unimplemented akos_queCommand(2,%d,%d,%d)", a->number, param_1, param_2);
warning("unimplemented akos_queCommand(2,%d,%d,%d)", a->_number, param_1, param_2);
// start script token in actor
break;
case 3:
@ -1661,7 +1661,7 @@ void ScummEngine::akos_processQueue() {
a->startAnimActor(param_1);
break;
case 5:
a->forceClip = param_1;
a->_forceClip = param_1;
break;
case 6:
a->_offsX = param_1;
@ -1669,7 +1669,7 @@ void ScummEngine::akos_processQueue() {
break;
case 7:
if (_heversion >= 71) {
queueAuxEntry(a->number, param_1);
queueAuxEntry(a->_number, param_1);
} else if (param_1 != 0) {
if (_imuseDigital) {
_imuseDigital->setVolume(param_1, param_2);
@ -1678,14 +1678,14 @@ void ScummEngine::akos_processQueue() {
break;
case 8:
if (_heversion >= 71) {
_actorToPrintStrFor = a->number;
_actorToPrintStrFor = a->_number;
a->talkPosX = a->heTalkQueue[param_1].posX;
a->talkPosY = a->heTalkQueue[param_1].posY;
a->talkColor = a->heTalkQueue[param_1].color;
a->_talkPosX = a->_heTalkQueue[param_1].posX;
a->_talkPosY = a->_heTalkQueue[param_1].posY;
a->_talkColor = a->_heTalkQueue[param_1].color;
_string[0].loadDefault();
actorTalk(a->heTalkQueue[param_1].sentence);
actorTalk(a->_heTalkQueue[param_1].sentence);
} else if (param_1 != 0) {
if (_imuseDigital) {
@ -1701,7 +1701,7 @@ void ScummEngine::akos_processQueue() {
}
break;
default:
warning("akos_queCommand(%d,%d,%d,%d)", cmd, a->number, param_1, param_2);
warning("akos_queCommand(%d,%d,%d,%d)", cmd, a->_number, param_1, param_2);
}
}
}

View file

@ -80,7 +80,7 @@ bool ScummEngine::isCostumeInUse(int cost) const {
if (_roomResource != 0)
for (i = 1; i < _numActors; i++) {
a = derefActor(i);
if (a->isInCurrentRoom() && a->costume == cost)
if (a->isInCurrentRoom() && a->_costume == cost)
return true;
}

View file

@ -804,8 +804,8 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, Common::Point
} else {
pos = _pos.y;
if (box2nr == box3nr) {
int diffX = walkdata.dest.x - _pos.x;
int diffY = walkdata.dest.y - _pos.y;
int diffX = _walkdata.dest.x - _pos.x;
int diffY = _walkdata.dest.y - _pos.y;
int boxDiffX = box1.ul.x - _pos.x;
if (diffX != 0) {
@ -859,8 +859,8 @@ bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, Common::Point
} else {
if (box2nr == box3nr) {
int diffX = walkdata.dest.x - _pos.x;
int diffY = walkdata.dest.y - _pos.y;
int diffX = _walkdata.dest.x - _pos.x;
int diffY = _walkdata.dest.y - _pos.y;
int boxDiffY = box1.ul.y - _pos.y;
pos = _pos.x;
@ -1145,10 +1145,10 @@ void Actor::findPathTowardsOld(byte box1, byte box2, byte finalBox, Common::Poin
// 'maze' in the zeppeling (see bug #1032964).
if (_vm->_gameId != GID_INDY3 || _vm->getMaskFromBox(box1) == _vm->getMaskFromBox(box2)) {
// Is the actor (x,y) between both gates?
if (compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateA[0].x, gateA[0].y) !=
compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateB[0].x, gateB[0].y) &&
compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateA[1].x, gateA[1].y) !=
compareSlope(_pos.x, _pos.y, walkdata.dest.x, walkdata.dest.y, gateB[1].x, gateB[1].y)) {
if (compareSlope(_pos.x, _pos.y, _walkdata.dest.x, _walkdata.dest.y, gateA[0].x, gateA[0].y) !=
compareSlope(_pos.x, _pos.y, _walkdata.dest.x, _walkdata.dest.y, gateB[0].x, gateB[0].y) &&
compareSlope(_pos.x, _pos.y, _walkdata.dest.x, _walkdata.dest.y, gateA[1].x, gateA[1].y) !=
compareSlope(_pos.x, _pos.y, _walkdata.dest.x, _walkdata.dest.y, gateB[1].x, gateB[1].y)) {
return;
}
}

View file

@ -94,7 +94,7 @@ void ScummEngine::setCameraFollows(Actor *a) {
int t, i;
camera._mode = kFollowActorCameraMode;
camera._follows = a->number;
camera._follows = a->_number;
if (!a->isInCurrentRoom()) {
startScene(a->getRoom(), 0, 0);
@ -110,7 +110,7 @@ void ScummEngine::setCameraFollows(Actor *a) {
for (i = 1; i < _numActors; i++) {
if (_actors[i].isInCurrentRoom())
_actors[i].needRedraw = true;
_actors[i]._needRedraw = true;
}
runInventoryScript(0);
}
@ -120,8 +120,8 @@ void ScummEngine_v7::setCameraFollows(Actor *a) {
byte oldfollow = camera._follows;
int ax, ay;
camera._follows = a->number;
VAR(VAR_CAMERA_FOLLOWED_ACTOR) = a->number;
camera._follows = a->_number;
VAR(VAR_CAMERA_FOLLOWED_ACTOR) = a->_number;
if (!a->isInCurrentRoom()) {
startScene(a->getRoom(), 0, 0);
@ -134,7 +134,7 @@ void ScummEngine_v7::setCameraFollows(Actor *a) {
setCameraAt(a->_pos.x, a->_pos.y);
}
if (a->number != oldfollow)
if (a->_number != oldfollow)
runInventoryScript(0);
}

View file

@ -628,7 +628,7 @@ byte CostumeRenderer::drawLimb(const Actor *a, int limb) {
int i;
int code;
const byte *frameptr;
const CostumeData &cost = a->cost;
const CostumeData &cost = a->_cost;
// If the specified limb is stopped or not existing, do nothing.
if (cost.curpos[limb] == 0xFFFF || cost.stopped & (1 << limb))
@ -690,7 +690,7 @@ void ScummEngine::cost_decodeData(Actor *a, int frame, uint usemask) {
int anim;
LoadedCostume lc(this);
lc.loadCostume(a->costume);
lc.loadCostume(a->_costume);
anim = cost_frameToAnim(a, frame);
@ -724,22 +724,22 @@ void ScummEngine::cost_decodeData(Actor *a, int frame, uint usemask) {
}
if (usemask & 0x8000) {
if (j == 0xFFFF) {
a->cost.curpos[i] = 0xFFFF;
a->cost.start[i] = 0;
a->cost.frame[i] = frame;
a->_cost.curpos[i] = 0xFFFF;
a->_cost.start[i] = 0;
a->_cost.frame[i] = frame;
} else {
extra = *r++;
cmd = lc._animCmds[j];
if (cmd == 0x7A) {
a->cost.stopped &= ~(1 << i);
a->_cost.stopped &= ~(1 << i);
} else if (cmd == 0x79) {
a->cost.stopped |= (1 << i);
a->_cost.stopped |= (1 << i);
} else {
a->cost.curpos[i] = a->cost.start[i] = j;
a->cost.end[i] = j + (extra & 0x7F);
a->_cost.curpos[i] = a->_cost.start[i] = j;
a->_cost.end[i] = j + (extra & 0x7F);
if (extra & 0x80)
a->cost.curpos[i] |= 0x8000;
a->cost.frame[i] = frame;
a->_cost.curpos[i] |= 0x8000;
a->_cost.frame[i] = frame;
}
}
} else {
@ -795,7 +795,7 @@ byte LoadedCostume::increaseAnims(Actor *a) {
byte r = 0;
for (i = 0; i != 16; i++) {
if (a->cost.curpos[i] != 0xFFFF)
if (a->_cost.curpos[i] != 0xFFFF)
r += increaseAnim(a, i);
}
return r;
@ -806,23 +806,23 @@ byte LoadedCostume::increaseAnim(Actor *a, int slot) {
int i, end;
byte code, nc;
if (a->cost.curpos[slot] == 0xFFFF)
if (a->_cost.curpos[slot] == 0xFFFF)
return 0;
highflag = a->cost.curpos[slot] & 0x8000;
i = a->cost.curpos[slot] & 0x7FFF;
end = a->cost.end[slot];
highflag = a->_cost.curpos[slot] & 0x8000;
i = a->_cost.curpos[slot] & 0x7FFF;
end = a->_cost.end[slot];
code = _animCmds[i] & 0x7F;
if (_vm->_version <= 3) {
if (_animCmds[i] & 0x80)
a->cost.soundCounter++;
a->_cost.soundCounter++;
}
do {
if (!highflag) {
if (i++ >= end)
i = a->cost.start[slot];
i = a->_cost.start[slot];
} else {
if (i != end)
i++;
@ -830,27 +830,27 @@ byte LoadedCostume::increaseAnim(Actor *a, int slot) {
nc = _animCmds[i];
if (nc == 0x7C) {
a->cost.animCounter++;
if (a->cost.start[slot] != end)
a->_cost.animCounter++;
if (a->_cost.start[slot] != end)
continue;
} else {
if (_vm->_version >= 6) {
if (nc >= 0x71 && nc <= 0x78) {
uint sound = (_vm->_features & GF_HUMONGOUS) ? 0x78 - nc : nc - 0x71;
_vm->_sound->addSoundToQueue2(a->sound[sound]);
if (a->cost.start[slot] != end)
_vm->_sound->addSoundToQueue2(a->_sound[sound]);
if (a->_cost.start[slot] != end)
continue;
}
} else {
if (nc == 0x78) {
a->cost.soundCounter++;
if (a->cost.start[slot] != end)
a->_cost.soundCounter++;
if (a->_cost.start[slot] != end)
continue;
}
}
}
a->cost.curpos[slot] = i | highflag;
a->_cost.curpos[slot] = i | highflag;
return (_animCmds[i] & 0x7F) != code;
} while (1);
}

View file

@ -188,7 +188,7 @@ bool ScummDebugger::Cmd_IMuse(int argc, const char **argv) {
bool ScummDebugger::Cmd_Room(int argc, const char **argv) {
if (argc > 1) {
int room = atoi(argv[1]);
_vm->_actors[_vm->VAR(_vm->VAR_EGO)].room = room;
_vm->_actors[_vm->VAR(_vm->VAR_EGO)]._room = room;
_vm->_sound->stopAllSounds();
_vm->startScene(room, 0, 0);
_vm->_fullRedraw = 1;
@ -378,14 +378,14 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) {
DebugPrintf("Actor[%d].animVar[%d] = %d\n", actnum, value, a->getAnimVar(value));
} else if (!strcmp(argv[2], "ignoreboxes")) {
a->ignoreBoxes = (value > 0);
DebugPrintf("Actor[%d].ignoreBoxes = %d\n", actnum, a->ignoreBoxes);
a->_ignoreBoxes = (value > 0);
DebugPrintf("Actor[%d].ignoreBoxes = %d\n", actnum, a->_ignoreBoxes);
} else if (!strcmp(argv[2], "x")) {
a->putActor(value, a->_pos.y, a->room);
a->putActor(value, a->_pos.y, a->_room);
DebugPrintf("Actor[%d].x = %d\n", actnum, a->_pos.x);
_vm->_fullRedraw = 1;
} else if (!strcmp(argv[2], "y")) {
a->putActor(a->_pos.x, value, a->room);
a->putActor(a->_pos.x, value, a->_room);
DebugPrintf("Actor[%d].y = %d\n", actnum, a->_pos.y);
_vm->_fullRedraw = 1;
} else if (!strcmp(argv[2], "_elevation")) {
@ -398,7 +398,7 @@ bool ScummDebugger::Cmd_Actor(int argc, const char **argv) {
else {
a->setActorCostume(value);
_vm->_fullRedraw = 1;
DebugPrintf("Actor[%d].costume = %d\n", actnum, a->costume);
DebugPrintf("Actor[%d].costume = %d\n", actnum, a->_costume);
}
} else if (!strcmp(argv[2], "name")) {
DebugPrintf("Name of actor %d: %s\n", actnum, _vm->getObjOrActorName(actnum));
@ -418,11 +418,11 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) {
DebugPrintf("+--+----+----+---+----+---+---+---+---+---+---+---+---+\n");
for (i = 1; i < _vm->_numActors; i++) {
a = &_vm->_actors[i];
if (a->visible)
if (a->_visible)
DebugPrintf("|%2d|%4d|%4d|%3d|%4d|%3d|%3d|%3d|%3d|%3d|%3d|%3d|$%02x|\n",
a->number, a->_pos.x, a->_pos.y, a->width, a->getElevation(),
a->costume, a->_walkbox, a->moving, a->forceClip, a->frame,
a->scalex, a->getFacing(), int(_vm->_classData[a->number]&0xFF));
a->_number, a->_pos.x, a->_pos.y, a->_width, a->getElevation(),
a->_costume, a->_walkbox, a->_moving, a->_forceClip, a->_frame,
a->_scalex, a->getFacing(), int(_vm->_classData[a->_number]&0xFF));
}
DebugPrintf("+-----------------------------------------------------+\n");
return true;

View file

@ -128,9 +128,9 @@ void IMuseDigital::startSound(int soundId, const char *soundName, int soundType,
if ((soundId == kTalkSoundID) && (soundType == IMUSE_BUNDLE)) {
if (_vm->_actorToPrintStrFor != 0xFF && _vm->_actorToPrintStrFor != 0) {
Actor *a = _vm->derefActor(_vm->_actorToPrintStrFor, "IMuseDigital::startSound");
freq = (freq * a->talkFrequency) / 256;
track->pan = a->talkPan;
track->vol = a->talkVolume * 1000;
freq = (freq * a->_talkFrequency) / 256;
track->pan = a->_talkPan;
track->vol = a->_talkVolume * 1000;
}
}

View file

@ -1379,7 +1379,7 @@ int32 Insane::getLastKey(bool arg_0) {
bool Insane::smlayer_actorNeedRedraw(int actornum, int actnum) {
Actor *a = _vm->derefActor(_actor[actornum].act[actnum].actor, "smlayer_actorNeedRedraw");
return a->needRedraw;
return a->_needRedraw;
}
int32 Insane::readArray (int item) {

View file

@ -1380,7 +1380,7 @@ int ScummEngine::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2,
if (getObjectOrActorXY(b, x, y) == -1)
return -1;
if (b < _numActors)
i = derefActor(b, "unkObjProc1")->scalex;
i = derefActor(b, "unkObjProc1")->_scalex;
} else {
x = b;
y = c;
@ -1390,7 +1390,7 @@ int ScummEngine::getDistanceBetween(bool is_obj_1, int b, int c, bool is_obj_2,
if (getObjectOrActorXY(e, x2, y2) == -1)
return -1;
if (e < _numActors)
j = derefActor(e, "unkObjProc1(2)")->scalex;
j = derefActor(e, "unkObjProc1(2)")->_scalex;
} else {
x2 = e;
y2 = f;

View file

@ -408,34 +408,34 @@ void ScummEngine_v100he::o100_actorOps() {
case 6:
i = pop();
j = pop();
a->putActor(i, j, a->room);
a->putActor(i, j, a->_room);
break;
case 8:
a->drawToBackBuf = false;
a->needRedraw = true;
a->needBgReset = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->_needBgReset = true;
break;
case 9:
{
int top_actor = a->top;
int bottom_actor = a->bottom;
a->drawToBackBuf = true;
a->needRedraw = true;
int top_actor = a->_top;
int bottom_actor = a->_bottom;
a->_drawToBackBuf = true;
a->_needRedraw = true;
a->drawActorCostume();
a->drawToBackBuf = false;
a->needRedraw = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->drawActorCostume();
a->needRedraw = false;
a->_needRedraw = false;
if (a->top > top_actor)
a->top = top_actor;
if (a->bottom < bottom_actor)
a->bottom = bottom_actor;
if (a->_top > top_actor)
a->_top = top_actor;
if (a->_bottom < bottom_actor)
a->_bottom = bottom_actor;
}
break;
case 14:
a->charset = pop();
a->_charset = pop();
break;
case 18:
a->_clipOverride.bottom = pop();
@ -462,7 +462,7 @@ void ScummEngine_v100he::o100_actorOps() {
break;
case 52: // SO_ACTOR_NAME
copyScriptString(string);
loadPtrToResource(rtActorName, a->number, string);
loadPtrToResource(rtActorName, a->_number, string);
break;
case 53: // SO_ACTOR_NEW
a->initActor(2);
@ -472,16 +472,16 @@ void ScummEngine_v100he::o100_actorOps() {
i = pop();
checkRange(255, 0, i, "o100_actorOps: Illegal palette slot %d");
a->remapActorPaletteColor(i, j);
a->needRedraw = true;
a->_needRedraw = true;
break;
case 59:
// Uses reverse order of layering, so we adjust
a->_layer = -pop();
a->needRedraw = true;
a->_needRedraw = true;
break;
case 63:
a->hePaletteNum = pop();
a->needRedraw = true;
a->_hePaletteNum = pop();
a->_needRedraw = true;
break;
case 65: // SO_SCALE
i = pop();
@ -489,7 +489,7 @@ void ScummEngine_v100he::o100_actorOps() {
break;
case 70: // SO_SHADOW
a->_shadowMode = pop();
a->needRedraw = true;
a->_needRedraw = true;
debug(0, "o100_actorOps: Set actor XMAP idx to %d", a->_shadowMode);
break;
case 74: // SO_STEP_DIST
@ -503,11 +503,11 @@ void ScummEngine_v100he::o100_actorOps() {
int slot = pop();
int len = resStrLen(string) + 1;
addMessageToStack(string, a->heTalkQueue[slot].sentence, len);
addMessageToStack(string, a->_heTalkQueue[slot].sentence, len);
a->heTalkQueue[slot].posX = a->talkPosX;
a->heTalkQueue[slot].posY = a->talkPosY;
a->heTalkQueue[slot].color = a->talkColor;
a->_heTalkQueue[slot].posX = a->_talkPosX;
a->_heTalkQueue[slot].posY = a->_talkPosY;
a->_heTalkQueue[slot].color = a->_talkColor;
}
break;
case 83: // SO_ACTOR_VARIABLE
@ -515,10 +515,10 @@ void ScummEngine_v100he::o100_actorOps() {
a->setAnimVar(pop(), i);
break;
case 87: // SO_ALWAYS_ZCLIP
a->forceClip = pop();
a->_forceClip = pop();
break;
case 89: // SO_NEVER_ZCLIP
a->forceClip = 0;
a->_forceClip = 0;
break;
case 128:
_actorClipOverride.bottom = pop();
@ -529,10 +529,10 @@ void ScummEngine_v100he::o100_actorOps() {
case 130: // SO_SOUND
k = getStackList(args, ARRAYSIZE(args));
for (i = 0; i < k; i++)
a->sound[i] = args[i];
a->_sound[i] = args[i];
break;
case 131: // SO_ACTOR_WIDTH
a->width = pop();
a->_width = pop();
break;
case 132: // SO_ANIMATION_DEFAULT
a->_initFrame = 1;
@ -545,22 +545,22 @@ void ScummEngine_v100he::o100_actorOps() {
a->setElevation(pop());
break;
case 134: // SO_FOLLOW_BOXES
a->ignoreBoxes = 0;
a->forceClip = 0;
a->_ignoreBoxes = 0;
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 135: // SO_IGNORE_BOXES
a->ignoreBoxes = 1;
a->forceClip = 0;
a->_ignoreBoxes = 1;
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 136: // SO_ACTOR_IGNORE_TURNS_OFF
a->ignoreTurns = false;
a->_ignoreTurns = false;
break;
case 137: // SO_ACTOR_IGNORE_TURNS_ON
a->ignoreTurns = true;
a->_ignoreTurns = true;
break;
case 138: // SO_INIT_ANIMATION
a->_initFrame = pop();
@ -573,17 +573,17 @@ void ScummEngine_v100he::o100_actorOps() {
a->_talkStartFrame = pop();
break;
case 141: // SO_TALK_COLOR
a->talkColor = pop();
a->_talkColor = pop();
break;
case 142:
k = pop();
a->heNoTalkAnimation = 1;
a->_heNoTalkAnimation = 1;
a->setTalkCondition(k);
debug(1,"o100_actorOps: case 24 (%d)", k);
break;
case 143: // SO_TEXT_OFFSET
a->talkPosY = pop();
a->talkPosX = pop();
a->_talkPosY = pop();
a->_talkPosX = pop();
break;
case 144: // SO_WALK_ANIMATION
a->_walkFrame = pop();
@ -829,20 +829,20 @@ void ScummEngine_v100he::o100_unknownE0() {
case 1:
{
Actor *a = derefActorSafe(num, "o100_unknownE0");
int top_actor = a->top;
int bottom_actor = a->bottom;
a->drawToBackBuf = true;
a->needRedraw = true;
int top_actor = a->_top;
int bottom_actor = a->_bottom;
a->_drawToBackBuf = true;
a->_needRedraw = true;
a->drawActorCostume();
a->drawToBackBuf = false;
a->needRedraw = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->drawActorCostume();
a->needRedraw = false;
a->_needRedraw = false;
if (a->top > top_actor)
a->top = top_actor;
if (a->bottom < bottom_actor)
a->bottom = bottom_actor;
if (a->_top > top_actor)
a->_top = top_actor;
if (a->_bottom < bottom_actor)
a->_bottom = bottom_actor;
type = 2;
}
@ -2148,7 +2148,7 @@ void ScummEngine_v100he::o100_wait() {
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o100_wait:168");
if (a->moving)
if (a->_moving)
break;
return;
case 129: // SO_WAIT_FOR_CAMERA Wait for camera

View file

@ -647,7 +647,7 @@ void ScummEngine_v2::o2_subtract() {
void ScummEngine_v2::o2_waitForActor() {
Actor *a = derefActor(getVarOrDirectByte(PARAM_1), "o2_waitForActor");
if (a->moving) {
if (a->_moving) {
_scriptPointer -= 2;
o5_breakHere();
}
@ -686,7 +686,7 @@ void ScummEngine_v2::o2_actorOps() {
switch (_opcode) {
case 1: // SO_SOUND
a->sound[0] = arg;
a->_sound[0] = arg;
break;
case 2: // SO_PALETTE
if (_version == 1)
@ -697,16 +697,16 @@ void ScummEngine_v2::o2_actorOps() {
a->setPalette(i, arg);
break;
case 3: // SO_ACTOR_NAME
loadPtrToResource(rtActorName, a->number, NULL);
loadPtrToResource(rtActorName, a->_number, NULL);
break;
case 4: // SO_COSTUME
a->setActorCostume(arg);
break;
case 5: // SO_TALK_COLOR
if (_gameId == GID_MANIAC && _version == 2 && _demoMode && arg == 1)
a->talkColor = 15;
a->_talkColor = 15;
else
a->talkColor = arg;
a->_talkColor = arg;
break;
default:
warning("o2_actorOps: opcode %d not yet supported", _opcode);
@ -1094,7 +1094,7 @@ void ScummEngine_v2::o2_putActor() {
x = getVarOrDirectByte(PARAM_2) * 8;
y = getVarOrDirectByte(PARAM_3) * 2;
a->putActor(x, y, a->room);
a->putActor(x, y, a->_room);
}
void ScummEngine_v2::o2_startScript() {
@ -1164,7 +1164,7 @@ void ScummEngine_v2::o2_putActorAtObject() {
y = 120;
}
a->putActor(x, y, a->room);
a->putActor(x, y, a->_room);
}
void ScummEngine_v2::o2_getActorElevation() {
@ -1302,7 +1302,7 @@ void ScummEngine_v2::o2_loadRoomWithEgo() {
x = (int8)fetchScriptByte() * 8;
y = (int8)fetchScriptByte() * 2;
startScene(a->room, a, obj);
startScene(a->_room, a, obj);
getObjectXYPos(obj, x2, y2, dir);
a->putActor(x2, y2, _currentRoom);

View file

@ -426,7 +426,7 @@ void ScummEngine_v5::o5_actorOps() {
a->setActorWalkSpeed(i, j);
break;
case 3: // SO_SOUND
a->sound[0] = getVarOrDirectByte(PARAM_1);
a->_sound[0] = getVarOrDirectByte(PARAM_1);
break;
case 4: // SO_WALK_ANIMATION
a->_walkFrame = getVarOrDirectByte(PARAM_1);
@ -471,10 +471,10 @@ void ScummEngine_v5::o5_actorOps() {
if (act == 0)
_string[0].color = getVarOrDirectByte(PARAM_1);
else
a->talkColor = getVarOrDirectByte(PARAM_1);
a->_talkColor = getVarOrDirectByte(PARAM_1);
break;
case 13: // SO_ACTOR_NAME
loadPtrToResource(rtActorName, a->number, NULL);
loadPtrToResource(rtActorName, a->_number, NULL);
break;
case 14: // SO_INIT_ANIMATION
a->_initFrame = getVarOrDirectByte(PARAM_1);
@ -490,11 +490,11 @@ void ScummEngine_v5::o5_actorOps() {
getWordVararg(args);
for (i = 0; i < 16; i++)
if (args[i] != 0xFF)
a->palette[i] = args[i];
a->_palette[i] = args[i];
#endif
break;
case 16: // SO_ACTOR_WIDTH
a->width = getVarOrDirectByte(PARAM_1);
a->_width = getVarOrDirectByte(PARAM_1);
break;
case 17: // SO_ACTOR_SCALE
if (_version == 4) {
@ -504,21 +504,21 @@ void ScummEngine_v5::o5_actorOps() {
j = getVarOrDirectByte(PARAM_2);
}
a->boxscale = i;
a->_boxscale = i;
a->setScale(i, j);
break;
case 18: // SO_NEVER_ZCLIP
a->forceClip = 0;
a->_forceClip = 0;
break;
case 19: // SO_ALWAYS_ZCLIP
a->forceClip = getVarOrDirectByte(PARAM_1);
a->_forceClip = getVarOrDirectByte(PARAM_1);
break;
case 20: // SO_IGNORE_BOXES
case 21: // SO_FOLLOW_BOXES
a->ignoreBoxes = !(_opcode & 1);
a->forceClip = 0;
a->_ignoreBoxes = !(_opcode & 1);
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 22: // SO_ANIMATION_SPEED
@ -544,8 +544,8 @@ void ScummEngine_v5::o5_setClass() {
_classData[obj] = 0;
if ((_features & GF_SMALL_HEADER) && obj <= _numActors) {
Actor *a = derefActor(obj, "o5_setClass");
a->ignoreBoxes = false;
a->forceClip = 0;
a->_ignoreBoxes = false;
a->_forceClip = 0;
}
} else
putClass(obj, newClass, (newClass & 0x80) ? true : false);
@ -1020,7 +1020,7 @@ void ScummEngine_v5::o5_getActorCostume() {
getResultPos();
int act = getVarOrDirectByte(PARAM_1);
Actor *a = derefActor(act, "o5_getActorCostume");
setResult(a->costume);
setResult(a->_costume);
}
void ScummEngine_v5::o5_getActorElevation() {
@ -1041,7 +1041,7 @@ void ScummEngine_v5::o5_getActorMoving() {
getResultPos();
int act = getVarOrDirectByte(PARAM_1);
Actor *a = derefActor(act, "o5_getActorMoving");
setResult(a->moving);
setResult(a->_moving);
}
void ScummEngine_v5::o5_getActorRoom() {
@ -1056,7 +1056,7 @@ void ScummEngine_v5::o5_getActorRoom() {
}
Actor *a = derefActor(act, "o5_getActorRoom");
setResult(a->room);
setResult(a->_room);
}
void ScummEngine_v5::o5_getActorScale() {
@ -1066,7 +1066,7 @@ void ScummEngine_v5::o5_getActorScale() {
if (_gameId == GID_INDY3) {
const byte *oldaddr = _scriptPointer - 1;
a = derefActor(getVarOrDirectByte(PARAM_1), "o5_getActorScale (wait)");
if (a->moving) {
if (a->_moving) {
_scriptPointer = oldaddr;
o5_breakHere();
}
@ -1076,7 +1076,7 @@ void ScummEngine_v5::o5_getActorScale() {
getResultPos();
int act = getVarOrDirectByte(PARAM_1);
a = derefActor(act, "o5_getActorScale");
setResult(a->scalex);
setResult(a->_scalex);
}
void ScummEngine_v5::o5_getActorWalkBox() {
@ -1090,7 +1090,7 @@ void ScummEngine_v5::o5_getActorWidth() {
getResultPos();
int act = getVarOrDirectByte(PARAM_1);
Actor *a = derefActor(act, "o5_getActorWidth");
setResult(a->width);
setResult(a->_width);
}
void ScummEngine_v5::o5_getActorX() {
@ -1187,7 +1187,7 @@ void ScummEngine_v5::o5_getAnimCounter() {
int act = getVarOrDirectByte(PARAM_1);
Actor *a = derefActor(act, "o5_getAnimCounter");
setResult(a->cost.animCounter);
setResult(a->_cost.animCounter);
}
void ScummEngine_v5::o5_getClosestObjActor() {
@ -1494,7 +1494,7 @@ void ScummEngine_v5::o5_loadRoomWithEgo() {
y = (int16)fetchScriptWord();
VAR(VAR_WALKTO_OBJ) = obj;
startScene(a->room, a, obj);
startScene(a->_room, a, obj);
VAR(VAR_WALKTO_OBJ) = 0;
if (_version <= 4) {
@ -1504,7 +1504,7 @@ void ScummEngine_v5::o5_loadRoomWithEgo() {
if (a->getFacing() == oldDir)
a->setDirection(dir + 180);
}
a->moving = 0;
a->_moving = 0;
}
// This is based on disassembly
@ -1629,7 +1629,7 @@ void ScummEngine_v5::o5_putActor() {
a = derefActor(getVarOrDirectByte(PARAM_1), "o5_putActor");
x = getVarOrDirectWord(PARAM_2);
y = getVarOrDirectWord(PARAM_3);
a->putActor(x, y, a->room);
a->putActor(x, y, a->_room);
}
void ScummEngine_v5::o5_putActorAtObject() {
@ -1644,7 +1644,7 @@ void ScummEngine_v5::o5_putActorAtObject() {
x = 240;
y = 120;
}
a->putActor(x, y, a->room);
a->putActor(x, y, a->_room);
}
void ScummEngine_v5::o5_putActorInRoom() {
@ -1654,10 +1654,10 @@ void ScummEngine_v5::o5_putActorInRoom() {
a = derefActor(act, "o5_putActorInRoom");
if (a->visible && _currentRoom != room && getTalkingActor() == a->number) {
if (a->_visible && _currentRoom != room && getTalkingActor() == a->_number) {
stopTalk();
}
a->room = room;
a->_room = room;
if (!room)
a->putActor(0, 0, 0);
}
@ -2480,7 +2480,7 @@ void ScummEngine_v5::o5_wait() {
case 1: // SO_WAIT_FOR_ACTOR
{
Actor *a = derefActorSafe(getVarOrDirectByte(PARAM_1), "o5_wait");
if (a && a->isInCurrentRoom() && a->moving)
if (a && a->isInCurrentRoom() && a->_moving)
break;
return;
}
@ -2563,8 +2563,8 @@ void ScummEngine_v5::o5_walkActorToActor() {
if (_version <= 2)
dist *= 8;
else if (dist == 0xFF) {
dist = a->scalex * a->width / 0xFF;
dist += (a2->scalex * a2->width / 0xFF) / 2;
dist = a->_scalex * a->_width / 0xFF;
dist += (a2->_scalex * a2->_width / 0xFF) / 2;
}
x = a2->_pos.x;
y = a2->_pos.y;

View file

@ -1186,7 +1186,7 @@ void ScummEngine_v6::o6_walkActorToObj() {
if (!a->isInCurrentRoom() || !a2->isInCurrentRoom())
return;
if (dist == 0) {
dist = a2->scalex * a2->width / 0xFF;
dist = a2->_scalex * a2->_width / 0xFF;
dist += dist / 2;
}
x = a2->_pos.x;
@ -1218,13 +1218,13 @@ void ScummEngine_v6::o6_putActorAtXY() {
a = derefActor(act, "o6_putActorAtXY");
if (room == 0xFF || room == 0x7FFFFFFF) {
room = a->room;
room = a->_room;
} else {
if (a->visible && _currentRoom != room && getTalkingActor() == a->number) {
if (a->_visible && _currentRoom != room && getTalkingActor() == a->_number) {
stopTalk();
}
if (room != 0)
a->room = room;
a->_room = room;
}
a->putActor(x, y, room);
}
@ -1248,7 +1248,7 @@ void ScummEngine_v6::o6_putActorAtObject() {
y = 120;
}
if (room == 0xFF)
room = a->room;
room = a->_room;
a->putActor(x, y, room);
}
@ -1330,7 +1330,7 @@ void ScummEngine_v6::o6_loadRoomWithEgo() {
if (VAR_WALKTO_OBJ != 0xFF)
VAR(VAR_WALKTO_OBJ) = obj;
startScene(a->room, a, obj);
startScene(a->_room, a, obj);
if (VAR_WALKTO_OBJ != 0xFF)
VAR(VAR_WALKTO_OBJ) = 0;
@ -1373,7 +1373,7 @@ void ScummEngine_v6::o6_isRoomScriptRunning() {
void ScummEngine_v6::o6_getActorMoving() {
Actor *a = derefActor(pop(), "o6_getActorMoving");
push(a->moving);
push(a->_moving);
}
void ScummEngine_v6::o6_getActorRoom() {
@ -1399,17 +1399,17 @@ void ScummEngine_v6::o6_getActorRoom() {
}
Actor *a = derefActor(act, "o6_getActorRoom");
push(a->room);
push(a->_room);
}
void ScummEngine_v6::o6_getActorWalkBox() {
Actor *a = derefActor(pop(), "o6_getActorWalkBox");
push(a->ignoreBoxes ? 0 : a->_walkbox);
push(a->_ignoreBoxes ? 0 : a->_walkbox);
}
void ScummEngine_v6::o6_getActorCostume() {
Actor *a = derefActor(pop(), "o6_getActorCostume");
push(a->costume);
push(a->_costume);
}
void ScummEngine_v6::o6_getActorElevation() {
@ -1419,17 +1419,17 @@ void ScummEngine_v6::o6_getActorElevation() {
void ScummEngine_v6::o6_getActorWidth() {
Actor *a = derefActor(pop(), "o6_getActorWidth");
push(a->width);
push(a->_width);
}
void ScummEngine_v6::o6_getActorScaleX() {
Actor *a = derefActor(pop(), "o6_getActorScale");
push(a->scalex);
push(a->_scalex);
}
void ScummEngine_v6::o6_getActorAnimCounter1() {
Actor *a = derefActor(pop(), "o6_getActorAnimCounter");
push(a->cost.animCounter);
push(a->_cost.animCounter);
}
void ScummEngine_v6::o6_getAnimateVariable() {
@ -1789,7 +1789,7 @@ void ScummEngine_v6::o6_actorOps() {
case 78: // SO_SOUND
k = getStackList(args, ARRAYSIZE(args));
for (i = 0; i < k; i++)
a->sound[i] = args[i];
a->_sound[i] = args[i];
break;
case 79: // SO_WALK_ANIMATION
a->_walkFrame = pop();
@ -1827,39 +1827,39 @@ void ScummEngine_v6::o6_actorOps() {
a->setPalette(i, j);
break;
case 87: // SO_TALK_COLOR
a->talkColor = pop();
a->_talkColor = pop();
break;
case 88: // SO_ACTOR_NAME
loadPtrToResource(rtActorName, a->number, NULL);
loadPtrToResource(rtActorName, a->_number, NULL);
break;
case 89: // SO_INIT_ANIMATION
a->_initFrame = pop();
break;
case 91: // SO_ACTOR_WIDTH
a->width = pop();
a->_width = pop();
break;
case 92: // SO_SCALE
i = pop();
a->setScale(i, i);
break;
case 93: // SO_NEVER_ZCLIP
a->forceClip = 0;
a->_forceClip = 0;
break;
case 225: // SO_ALWAYS_ZCLIP
case 94: // SO_ALWAYS_ZCLIP
a->forceClip = pop();
a->_forceClip = pop();
break;
case 95: // SO_IGNORE_BOXES
a->ignoreBoxes = 1;
a->forceClip = (_version >= 7) ? 100 : 0;
a->_ignoreBoxes = 1;
a->_forceClip = (_version >= 7) ? 100 : 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 96: // SO_FOLLOW_BOXES
a->ignoreBoxes = 0;
a->forceClip = (_version >= 7) ? 100 : 0;
a->_ignoreBoxes = 0;
a->_forceClip = (_version >= 7) ? 100 : 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 97: // SO_ANIMATION_SPEED
a->setAnimSpeed(pop());
@ -1868,18 +1868,18 @@ void ScummEngine_v6::o6_actorOps() {
a->_shadowMode = pop();
break;
case 99: // SO_TEXT_OFFSET
a->talkPosY = pop();
a->talkPosX = pop();
a->_talkPosY = pop();
a->_talkPosX = pop();
break;
case 198: // SO_ACTOR_VARIABLE
i = pop();
a->setAnimVar(pop(), i);
break;
case 215: // SO_ACTOR_IGNORE_TURNS_ON
a->ignoreTurns = true;
a->_ignoreTurns = true;
break;
case 216: // SO_ACTOR_IGNORE_TURNS_OFF
a->ignoreTurns = false;
a->_ignoreTurns = false;
break;
case 217: // SO_ACTOR_NEW
a->initActor(2);
@ -1888,27 +1888,27 @@ void ScummEngine_v6::o6_actorOps() {
a->_layer = pop();
break;
case 228: // SO_ACTOR_WALK_SCRIPT
a->walkScript = pop();
a->_walkScript = pop();
break;
case 229: // SO_ACTOR_STOP
a->stopActorMoving();
a->startAnimActor(a->_standFrame);
break;
case 230: /* set direction */
a->moving &= ~MF_TURN;
a->_moving &= ~MF_TURN;
a->setDirection(pop());
break;
case 231: /* turn to direction */
a->turnToDirection(pop());
break;
case 233: // SO_ACTOR_WALK_PAUSE
a->moving |= MF_FROZEN;
a->_moving |= MF_FROZEN;
break;
case 234: // SO_ACTOR_WALK_RESUME
a->moving &= ~MF_FROZEN;
a->_moving &= ~MF_FROZEN;
break;
case 235: // SO_ACTOR_TALK_SCRIPT
a->talkScript = pop();
a->_talkScript = pop();
break;
default:
error("o6_actorOps: default case %d", subOp);
@ -2181,7 +2181,7 @@ void ScummEngine_v6::o6_wait() {
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o6_wait:168");
if (a->isInCurrentRoom() && a->moving)
if (a->isInCurrentRoom() && a->_moving)
break;
return;
case 169: // SO_WAIT_FOR_MESSAGE Wait for message
@ -2211,7 +2211,7 @@ void ScummEngine_v6::o6_wait() {
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o6_wait:226");
if (a->isInCurrentRoom() && a->needRedraw)
if (a->isInCurrentRoom() && a->_needRedraw)
break;
return;
case 232: // SO_WAIT_FOR_TURN
@ -2231,7 +2231,7 @@ void ScummEngine_v6::o6_wait() {
actnum = _curActor;
}
a = derefActor(actnum, "o6_wait:232b");
if (a->isInCurrentRoom() && a->moving & MF_TURN)
if (a->isInCurrentRoom() && a->_moving & MF_TURN)
break;
return;
default:
@ -2744,7 +2744,7 @@ void ScummEngine_v6::o6_kernelGetFunctions() {
case 212:
a = derefActor(args[1], "o6_kernelGetFunctions:212");
// This is used by walk scripts
push(a->frame);
push(a->_frame);
break;
case 213:
slot = getVerbSlot(args[1], 0);
@ -2921,12 +2921,12 @@ void ScummEngine_v6::o6_stampObject() {
state = 255;
Actor *a = derefActor(object, "o6_stampObject");
a->scalex = state;
a->scaley = state;
a->_scalex = state;
a->_scaley = state;
a->putActor(x, y, _currentRoom);
a->drawToBackBuf = true;
a->_drawToBackBuf = true;
a->drawActorCostume();
a->drawToBackBuf = false;
a->_drawToBackBuf = false;
a->drawActorCostume();
return;
}

View file

@ -624,7 +624,7 @@ void ScummEngine_v60he::o60_actorOps() {
case 78: // SO_SOUND
k = getStackList(args, ARRAYSIZE(args));
for (i = 0; i < k; i++)
a->sound[i] = args[i];
a->_sound[i] = args[i];
break;
case 79: // SO_WALK_ANIMATION
a->_walkFrame = pop();
@ -660,92 +660,92 @@ void ScummEngine_v60he::o60_actorOps() {
i = pop();
checkRange(255, 0, i, "Illegal palette slot %d");
a->remapActorPaletteColor(i, j);
a->needRedraw = true;
a->_needRedraw = true;
break;
case 87: // SO_TALK_COLOR
a->talkColor = pop();
a->_talkColor = pop();
break;
case 88: // SO_ACTOR_NAME
loadPtrToResource(rtActorName, a->number, NULL);
loadPtrToResource(rtActorName, a->_number, NULL);
break;
case 89: // SO_INIT_ANIMATION
a->_initFrame = pop();
break;
case 91: // SO_ACTOR_WIDTH
a->width = pop();
a->_width = pop();
break;
case 92: // SO_SCALE
i = pop();
a->setScale(i, i);
break;
case 93: // SO_NEVER_ZCLIP
a->forceClip = 0;
a->_forceClip = 0;
break;
case 94: // SO_ALWAYS_ZCLIP
a->forceClip = pop();
a->_forceClip = pop();
break;
case 95: // SO_IGNORE_BOXES
a->ignoreBoxes = 1;
a->forceClip = 0;
a->_ignoreBoxes = 1;
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 96: // SO_FOLLOW_BOXES
a->ignoreBoxes = 0;
a->forceClip = 0;
a->_ignoreBoxes = 0;
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 97: // SO_ANIMATION_SPEED
a->setAnimSpeed(pop());
break;
case 98: // SO_SHADOW
a->_shadowMode = pop();
a->needRedraw = true;
a->_needRedraw = true;
break;
case 99: // SO_TEXT_OFFSET
a->talkPosY = pop();
a->talkPosX = pop();
a->_talkPosY = pop();
a->_talkPosX = pop();
break;
case 156: // HE 7.2
a->charset = pop();
a->_charset = pop();
break;
case 198: // SO_ACTOR_VARIABLE
i = pop();
a->setAnimVar(pop(), i);
break;
case 215: // SO_ACTOR_IGNORE_TURNS_ON
a->ignoreTurns = true;
a->_ignoreTurns = true;
break;
case 216: // SO_ACTOR_IGNORE_TURNS_OFF
a->ignoreTurns = false;
a->_ignoreTurns = false;
break;
case 217: // SO_ACTOR_NEW
a->initActor(2);
break;
case 218:
{
int top_actor = a->top;
int bottom_actor = a->bottom;
a->drawToBackBuf = true;
a->needRedraw = true;
int top_actor = a->_top;
int bottom_actor = a->_bottom;
a->_drawToBackBuf = true;
a->_needRedraw = true;
a->drawActorCostume();
a->drawToBackBuf = false;
a->needRedraw = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->drawActorCostume();
a->needRedraw = false;
a->_needRedraw = false;
if (a->top > top_actor)
a->top = top_actor;
if (a->bottom < bottom_actor)
a->bottom = bottom_actor;
if (a->_top > top_actor)
a->_top = top_actor;
if (a->_bottom < bottom_actor)
a->_bottom = bottom_actor;
}
break;
case 219:
a->drawToBackBuf = false;
a->needRedraw = true;
a->needBgReset = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->_needBgReset = true;
break;
case 225:
{
@ -754,11 +754,11 @@ void ScummEngine_v60he::o60_actorOps() {
int slot = pop();
int len = resStrLen(string) + 1;
addMessageToStack(string, a->heTalkQueue[slot].sentence, len);
addMessageToStack(string, a->_heTalkQueue[slot].sentence, len);
a->heTalkQueue[slot].posX = a->talkPosX;
a->heTalkQueue[slot].posY = a->talkPosY;
a->heTalkQueue[slot].color = a->talkColor;
a->_heTalkQueue[slot].posX = a->_talkPosX;
a->_heTalkQueue[slot].posY = a->_talkPosY;
a->_heTalkQueue[slot].color = a->_talkColor;
break;
}
default:
@ -777,7 +777,7 @@ void ScummEngine_v60he::o60_wait() {
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o60_wait:168");
if (a->moving)
if (a->_moving)
break;
return;
case 169: // SO_WAIT_FOR_MESSAGE Wait for message

View file

@ -1028,14 +1028,14 @@ void ScummEngine_v72he::o72_actorOps() {
break;
case 24: // HE 80+
k = pop();
a->heNoTalkAnimation = 1;
a->_heNoTalkAnimation = 1;
a->setTalkCondition(k);
debug(1,"o72_actorOps: case 24 (%d)", k);
break;
case 43: // HE 90+
// Uses reverse order of layering, so we adjust
a->_layer = -pop();
a->needRedraw = true;
a->_needRedraw = true;
break;
case 64:
_actorClipOverride.bottom = pop();
@ -1052,7 +1052,7 @@ void ScummEngine_v72he::o72_actorOps() {
case 65: // HE 98+
i = pop();
j = pop();
a->putActor(i, j, a->room);
a->putActor(i, j, a->_room);
break;
case 68: // HE 90+
k = pop();
@ -1069,7 +1069,7 @@ void ScummEngine_v72he::o72_actorOps() {
case 78: // SO_SOUND
k = getStackList(args, ARRAYSIZE(args));
for (i = 0; i < k; i++)
a->sound[i] = args[i];
a->_sound[i] = args[i];
break;
case 79: // SO_WALK_ANIMATION
a->_walkFrame = pop();
@ -1105,98 +1105,98 @@ void ScummEngine_v72he::o72_actorOps() {
i = pop();
checkRange(255, 0, i, "Illegal palette slot %d");
a->remapActorPaletteColor(i, j);
a->needRedraw = true;
a->_needRedraw = true;
break;
case 87: // SO_TALK_COLOR
a->talkColor = pop();
a->_talkColor = pop();
break;
case 88: // SO_ACTOR_NAME
copyScriptString(string);
loadPtrToResource(rtActorName, a->number, string);
loadPtrToResource(rtActorName, a->_number, string);
break;
case 89: // SO_INIT_ANIMATION
a->_initFrame = pop();
break;
case 91: // SO_ACTOR_WIDTH
a->width = pop();
a->_width = pop();
break;
case 92: // SO_SCALE
i = pop();
a->setScale(i, i);
break;
case 93: // SO_NEVER_ZCLIP
a->forceClip = 0;
a->_forceClip = 0;
break;
case 94: // SO_ALWAYS_ZCLIP
a->forceClip = pop();
a->_forceClip = pop();
break;
case 95: // SO_IGNORE_BOXES
a->ignoreBoxes = 1;
a->forceClip = 0;
a->_ignoreBoxes = 1;
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 96: // SO_FOLLOW_BOXES
a->ignoreBoxes = 0;
a->forceClip = 0;
a->_ignoreBoxes = 0;
a->_forceClip = 0;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 97: // SO_ANIMATION_SPEED
a->setAnimSpeed(pop());
break;
case 98: // SO_SHADOW
a->_shadowMode = pop();
a->needRedraw = true;
a->_needRedraw = true;
debug(0, "Set actor XMAP idx to %d", a->_shadowMode);
break;
case 99: // SO_TEXT_OFFSET
a->talkPosY = pop();
a->talkPosX = pop();
a->_talkPosY = pop();
a->_talkPosX = pop();
break;
case 156: // HE 72+
a->charset = pop();
a->_charset = pop();
break;
case 175: // HE 99+
a->hePaletteNum = pop();
a->needRedraw = true;
a->_hePaletteNum = pop();
a->_needRedraw = true;
break;
case 198: // SO_ACTOR_VARIABLE
i = pop();
a->setAnimVar(pop(), i);
break;
case 215: // SO_ACTOR_IGNORE_TURNS_ON
a->ignoreTurns = true;
a->_ignoreTurns = true;
break;
case 216: // SO_ACTOR_IGNORE_TURNS_OFF
a->ignoreTurns = false;
a->_ignoreTurns = false;
break;
case 217: // SO_ACTOR_NEW
a->initActor(2);
break;
case 218:
{
int top_actor = a->top;
int bottom_actor = a->bottom;
a->drawToBackBuf = true;
a->needRedraw = true;
int top_actor = a->_top;
int bottom_actor = a->_bottom;
a->_drawToBackBuf = true;
a->_needRedraw = true;
a->drawActorCostume();
a->drawToBackBuf = false;
a->needRedraw = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->drawActorCostume();
a->needRedraw = false;
a->_needRedraw = false;
if (a->top > top_actor)
a->top = top_actor;
if (a->bottom < bottom_actor)
a->bottom = bottom_actor;
if (a->_top > top_actor)
a->_top = top_actor;
if (a->_bottom < bottom_actor)
a->_bottom = bottom_actor;
}
break;
case 219:
a->drawToBackBuf = false;
a->needRedraw = true;
a->needBgReset = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->_needBgReset = true;
break;
case 225:
{
@ -1204,11 +1204,11 @@ void ScummEngine_v72he::o72_actorOps() {
int slot = pop();
int len = resStrLen(string) + 1;
addMessageToStack(string, a->heTalkQueue[slot].sentence, len);
addMessageToStack(string, a->_heTalkQueue[slot].sentence, len);
a->heTalkQueue[slot].posX = a->talkPosX;
a->heTalkQueue[slot].posY = a->talkPosY;
a->heTalkQueue[slot].color = a->talkColor;
a->_heTalkQueue[slot].posX = a->_talkPosX;
a->_heTalkQueue[slot].posY = a->_talkPosY;
a->_heTalkQueue[slot].color = a->_talkColor;
break;
}
default:

View file

@ -560,7 +560,7 @@ void ScummEngine_v70he::o70_getActorRoom() {
if (act < _numActors) {
Actor *a = derefActor(act, "o70_getActorRoom");
push(a->room);
push(a->_room);
} else
push(getObjectRoom(act));
}

View file

@ -546,7 +546,7 @@ void ScummEngine_v8::o8_wait() {
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o8_wait:SO_WAIT_FOR_ACTOR");
if (a->isInCurrentRoom() && a->moving)
if (a->isInCurrentRoom() && a->_moving)
break;
return;
case 0x1F: // SO_WAIT_FOR_MESSAGE Wait for message
@ -570,14 +570,14 @@ void ScummEngine_v8::o8_wait() {
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o8_wait:SO_WAIT_FOR_ANIMATION");
if (a->isInCurrentRoom() && a->needRedraw)
if (a->isInCurrentRoom() && a->_needRedraw)
break;
return;
case 0x23: // SO_WAIT_FOR_TURN
offs = fetchScriptWordSigned();
actnum = pop();
a = derefActor(actnum, "o8_wait:SO_WAIT_FOR_TURN");
if (a->isInCurrentRoom() && a->moving & MF_TURN)
if (a->isInCurrentRoom() && a->_moving & MF_TURN)
break;
return;
default:
@ -953,45 +953,45 @@ void ScummEngine_v8::o8_actorOps() {
a->setPalette(i, j);
break;
case 0x70: // SO_ACTOR_TALK_COLOR Set actor talk color
a->talkColor = pop();
a->_talkColor = pop();
break;
case 0x71: // SO_ACTOR_NAME Set name of actor
loadPtrToResource(rtActorName, a->number, NULL);
loadPtrToResource(rtActorName, a->_number, NULL);
break;
case 0x72: // SO_ACTOR_WIDTH Set width of actor
a->width = pop();
a->_width = pop();
break;
case 0x73: // SO_ACTOR_SCALE Set scaling of actor
i = pop();
a->setScale(i, i);
break;
case 0x74: // SO_ACTOR_NEVER_ZCLIP
a->forceClip = 0;
a->_forceClip = 0;
break;
case 0x75: // SO_ACTOR_ALWAYS_ZCLIP
a->forceClip = pop();
a->_forceClip = pop();
// V8 uses 255 where we used to use 100
if (a->forceClip == 255)
a->forceClip = 100;
if (a->_forceClip == 255)
a->_forceClip = 100;
break;
case 0x76: // SO_ACTOR_IGNORE_BOXES Make actor ignore boxes
a->ignoreBoxes = true;
a->forceClip = 100;
a->_ignoreBoxes = true;
a->_forceClip = 100;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 0x77: // SO_ACTOR_FOLLOW_BOXES Make actor follow boxes
a->ignoreBoxes = false;
a->forceClip = 100;
a->_ignoreBoxes = false;
a->_forceClip = 100;
if (a->isInCurrentRoom())
a->putActor(a->_pos.x, a->_pos.y, a->room);
a->putActor(a->_pos.x, a->_pos.y, a->_room);
break;
case 0x78: // SO_ACTOR_SPECIAL_DRAW
a->_shadowMode = pop();
break;
case 0x79: // SO_ACTOR_TEXT_OFFSET Set text offset relative to actor
a->talkPosY = pop();
a->talkPosX = pop();
a->_talkPosY = pop();
a->_talkPosX = pop();
break;
// case 0x7A: // SO_ACTOR_INIT Set current actor (handled above)
case 0x7B: // SO_ACTOR_VARIABLE Set actor variable
@ -999,10 +999,10 @@ void ScummEngine_v8::o8_actorOps() {
a->setAnimVar(pop(), i);
break;
case 0x7C: // SO_ACTOR_IGNORE_TURNS_ON Make actor ignore turns
a->ignoreTurns = true;
a->_ignoreTurns = true;
break;
case 0x7D: // SO_ACTOR_IGNORE_TURNS_OFF Make actor follow turns
a->ignoreTurns = false;
a->_ignoreTurns = false;
break;
case 0x7E: // SO_ACTOR_NEW New actor
a->initActor(2);
@ -1015,32 +1015,32 @@ void ScummEngine_v8::o8_actorOps() {
a->startAnimActor(a->_standFrame);
break;
case 0x81: // SO_ACTOR_FACE Make actor face angle
a->moving &= ~MF_TURN;
a->_moving &= ~MF_TURN;
a->setDirection(pop());
break;
case 0x82: // SO_ACTOR_TURN Turn actor
a->turnToDirection(pop());
break;
case 0x83: // SO_ACTOR_WALK_SCRIPT Set walk script for actor?
a->walkScript = pop();
a->_walkScript = pop();
break;
case 0x84: // SO_ACTOR_TALK_SCRIPT Set talk script for actor?
a->talkScript = pop();
a->_talkScript = pop();
break;
case 0x85: // SO_ACTOR_WALK_PAUSE
a->moving |= MF_FROZEN;
a->_moving |= MF_FROZEN;
break;
case 0x86: // SO_ACTOR_WALK_RESUME
a->moving &= ~MF_FROZEN;
a->_moving &= ~MF_FROZEN;
break;
case 0x87: // SO_ACTOR_VOLUME Set volume of actor speech
a->talkVolume = pop();
a->_talkVolume = pop();
break;
case 0x88: // SO_ACTOR_FREQUENCY Set frequency of actor speech
a->talkFrequency = pop();
a->_talkFrequency = pop();
break;
case 0x89: // SO_ACTOR_PAN
a->talkPan = pop();
a->_talkPan = pop();
break;
default:
error("o8_actorOps: default case 0x%x", subOp);
@ -1431,14 +1431,14 @@ void ScummEngine_v8::o8_kernelGetFunctions() {
void ScummEngine_v8::o8_getActorChore() {
int actnum = pop();
Actor *a = derefActor(actnum, "o8_getActorChore");
push(a->frame);
push(a->_frame);
}
void ScummEngine_v8::o8_getActorZPlane() {
int actnum = pop();
Actor *a = derefActor(actnum, "o8_getActorZPlane");
int z = a->forceClip;
int z = a->_forceClip;
if (z == 100) {
z = getMaskFromBox(a->_walkbox);
if (z > gdi._numZBuffer - 1)

View file

@ -609,20 +609,20 @@ void ScummEngine_v80he::o80_unknownE0() {
case 55:
{
Actor *a = derefActorSafe(num, "o80_unknownE0");
int top_actor = a->top;
int bottom_actor = a->bottom;
a->drawToBackBuf = true;
a->needRedraw = true;
int top_actor = a->_top;
int bottom_actor = a->_bottom;
a->_drawToBackBuf = true;
a->_needRedraw = true;
a->drawActorCostume();
a->drawToBackBuf = false;
a->needRedraw = true;
a->_drawToBackBuf = false;
a->_needRedraw = true;
a->drawActorCostume();
a->needRedraw = false;
a->_needRedraw = false;
if (a->top > top_actor)
a->top = top_actor;
if (a->bottom < bottom_actor)
a->bottom = bottom_actor;
if (a->_top > top_actor)
a->_top = top_actor;
if (a->_bottom < bottom_actor)
a->_bottom = bottom_actor;
type = 2;
}

View file

@ -478,7 +478,7 @@ void ScummEngine_v90he::o90_getActorData() {
push(a->_layer);
break;
case 6:
push(a->hePaletteNum);
push(a->_hePaletteNum);
break;
default:
error("o90_getActorData: Unknown actor property %d", subOp);

View file

@ -1366,7 +1366,7 @@ void ScummEngine::scummInit() {
Actor::initActorClass(this);
_actors = new Actor[_numActors];
for (i = 0; i < _numActors; i++) {
_actors[i].number = i;
_actors[i]._number = i;
_actors[i].initActor(1);
// this is from IDB
@ -1380,11 +1380,11 @@ void ScummEngine::scummInit() {
// HACK Some palette changes needed for demo script
// in Maniac Mansion (Enhanced)
_actors[3].setPalette(3, 1);
_actors[9].talkColor = 15;
_actors[10].talkColor = 7;
_actors[11].talkColor = 2;
_actors[13].talkColor = 5;
_actors[23].talkColor = 14;
_actors[9]._talkColor = 15;
_actors[10]._talkColor = 7;
_actors[11]._talkColor = 2;
_actors[13]._talkColor = 5;
_actors[23]._talkColor = 14;
}
vm.numNestedScripts = 0;
@ -2155,7 +2155,7 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
int x, y;
getObjectXYPos(objectNr, x, y);
a->putActor(x, y, _currentRoom);
a->moving = 0;
a->_moving = 0;
}
} else if (_version >= 7) {
if (camera._follows) {

View file

@ -126,18 +126,18 @@ void ScummEngine::CHARSET_1() {
if (_version <= 5) {
if (VAR(VAR_V5_TALK_STRING_Y) < 0) {
s = (a->scaley * (int)VAR(VAR_V5_TALK_STRING_Y)) / 0xFF;
s = (a->_scaley * (int)VAR(VAR_V5_TALK_STRING_Y)) / 0xFF;
_string[0].ypos += (int)(((VAR(VAR_V5_TALK_STRING_Y) - s) / 2) + s);
} else {
_string[0].ypos = (int)VAR(VAR_V5_TALK_STRING_Y);
}
} else {
s = a->scalex * a->talkPosX / 0xFF;
_string[0].xpos += ((a->talkPosX - s) / 2) + s;
s = a->_scalex * a->_talkPosX / 0xFF;
_string[0].xpos += ((a->_talkPosX - s) / 2) + s;
s = a->scaley * a->talkPosY / 0xFF;
_string[0].ypos += ((a->talkPosY - s) / 2) + s;
s = a->_scaley * a->_talkPosY / 0xFF;
_string[0].ypos += ((a->_talkPosY - s) / 2) + s;
if (_string[0].ypos > _screenHeight - 40)
_string[0].ypos = _screenHeight - 40;
@ -158,8 +158,8 @@ void ScummEngine::CHARSET_1() {
_charset->_center = _string[0].center;
_charset->setColor(_charsetColor);
if (a && a->charset)
_charset->setCurID(a->charset);
if (a && a->_charset)
_charset->setCurID(a->_charset);
else
_charset->setCurID(_string[0].charset);