aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorEugene Sandulenko2005-03-11 01:10:06 +0000
committerEugene Sandulenko2005-03-11 01:10:06 +0000
commit154c4af8dc2d561050a5a963e2b45403cda618dc (patch)
tree0c4b41ed77afeb42036fdba990805b180edc7c24 /scumm
parent3cf691e9f9d0aafad14b76272201a0cfac2e8a76 (diff)
downloadscummvm-rg350-154c4af8dc2d561050a5a963e2b45403cda618dc.tar.gz
scummvm-rg350-154c4af8dc2d561050a5a963e2b45403cda618dc.tar.bz2
scummvm-rg350-154c4af8dc2d561050a5a963e2b45403cda618dc.zip
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
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp888
-rw-r--r--scumm/actor.h106
-rw-r--r--scumm/akos.cpp118
-rw-r--r--scumm/base-costume.cpp2
-rw-r--r--scumm/boxes.cpp16
-rw-r--r--scumm/camera.cpp10
-rw-r--r--scumm/costume.cpp50
-rw-r--r--scumm/debugger.cpp20
-rw-r--r--scumm/imuse_digi/dimuse_track.cpp6
-rw-r--r--scumm/insane/insane.cpp2
-rw-r--r--scumm/object.cpp4
-rw-r--r--scumm/script_v100he.cpp108
-rw-r--r--scumm/script_v2.cpp16
-rw-r--r--scumm/script_v5.cpp58
-rw-r--r--scumm/script_v6.cpp84
-rw-r--r--scumm/script_v6he.cpp76
-rw-r--r--scumm/script_v72he.cpp84
-rw-r--r--scumm/script_v7he.cpp2
-rw-r--r--scumm/script_v8.cpp60
-rw-r--r--scumm/script_v80he.cpp22
-rw-r--r--scumm/script_v90he.cpp2
-rw-r--r--scumm/scumm.cpp14
-rw-r--r--scumm/string.cpp14
23 files changed, 881 insertions, 881 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 987cf752e5..c6d1497efc 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -47,7 +47,7 @@ void Actor::initActorClass(ScummEngine *scumm) {
Actor::Actor() {
assert(_vm != 0);
- number = 0;
+ _number = 0;
initActor(-1);
}
@@ -55,53 +55,53 @@ Actor::Actor() {
void Actor::initActor(int mode) {
if (mode == -1) {
_offsX = _offsY = 0;
- top = bottom = 0;
- needRedraw = needBgReset = costumeNeedsInit = visible = false;
- flip = false;
- speedx = 8;
- speedy = 2;
- frame = 0;
+ _top = _bottom = 0;
+ _needRedraw = _needBgReset = _costumeNeedsInit = _visible = false;
+ _flip = false;
+ _speedx = 8;
+ _speedy = 2;
+ _frame = 0;
_walkbox = 0;
- animProgress = 0;
- heSkipLimbs = false;
- drawToBackBuf = false;
- memset(animVariable, 0, sizeof(animVariable));
- memset(palette, 0, sizeof(palette));
- memset(sound, 0, sizeof(sound));
- memset(&cost, 0, sizeof(CostumeData));
- memset(&walkdata, 0, sizeof(ActorWalkData));
- walkdata.point3.x = 32000;
- walkScript = 0;
- memset(heTalkQueue, 0, sizeof(heTalkQueue));
+ _animProgress = 0;
+ _heSkipLimbs = false;
+ _drawToBackBuf = false;
+ memset(_animVariable, 0, sizeof(_animVariable));
+ memset(_palette, 0, sizeof(_palette));
+ memset(_sound, 0, sizeof(_sound));
+ memset(&_cost, 0, sizeof(CostumeData));
+ memset(&_walkdata, 0, sizeof(ActorWalkData));
+ _walkdata.point3.x = 32000;
+ _walkScript = 0;
+ memset(_heTalkQueue, 0, sizeof(_heTalkQueue));
mode = 1;
}
if (mode == 1) {
- costume = 0;
- room = 0;
+ _costume = 0;
+ _room = 0;
_pos.x = 0;
_pos.y = 0;
- facing = 180;
- heCondMask = 1;
- heNoTalkAnimation = 0;
+ _facing = 180;
+ _heCondMask = 1;
+ _heNoTalkAnimation = 0;
if (_vm->_version >= 7)
- visible = false;
- heSkipLimbs = false;
+ _visible = false;
+ _heSkipLimbs = false;
} else if (mode == 2) {
- facing = 180;
- heCondMask = 1;
- heSkipLimbs = false;
+ _facing = 180;
+ _heCondMask = 1;
+ _heSkipLimbs = false;
}
_elevation = 0;
- width = 24;
- talkColor = 15;
- talkPosX = 0;
- talkPosY = -80;
- boxscale = scaley = scalex = 0xFF;
- charset = 0;
- memset(sound, 0, sizeof(sound));
- targetFacing = facing;
+ _width = 24;
+ _talkColor = 15;
+ _talkPosX = 0;
+ _talkPosY = -80;
+ _boxscale = _scaley = _scalex = 0xFF;
+ _charset = 0;
+ memset(_sound, 0, sizeof(_sound));
+ _targetFacing = _facing;
stopActorMoving();
@@ -109,20 +109,20 @@ void Actor::initActor(int mode) {
_layer = 0;
setActorWalkSpeed(8, 2);
- animSpeed = 0;
+ _animSpeed = 0;
if (_vm->_version >= 6)
- animProgress = 0;
+ _animProgress = 0;
- ignoreBoxes = false;
- forceClip = (_vm->_version >= 7) ? 100 : 0;
- ignoreTurns = false;
+ _ignoreBoxes = false;
+ _forceClip = (_vm->_version >= 7) ? 100 : 0;
+ _ignoreTurns = false;
if (_vm->_features & GF_HUMONGOUS)
- flip = 0;
+ _flip = 0;
- talkFrequency = 256;
- talkPan = 64;
- talkVolume = 127;
+ _talkFrequency = 256;
+ _talkPan = 64;
+ _talkVolume = 127;
if (_vm->_version <= 2) {
_initFrame = 2;
@@ -139,32 +139,32 @@ void Actor::initActor(int mode) {
}
_heTalking = false;
- walkScript = 0;
- talkScript = 0;
+ _walkScript = 0;
+ _talkScript = 0;
_clipOverride = _vm->_actorClipOverride;
- auxBlock.visible = false;
- hePaletteNum = 0;
+ _auxBlock.visible = false;
+ _hePaletteNum = 0;
- _vm->_classData[number] = (_vm->_version >= 7) ? _vm->_classData[0] : 0;
+ _vm->_classData[_number] = (_vm->_version >= 7) ? _vm->_classData[0] : 0;
}
void Actor::stopActorMoving() {
- if (walkScript)
- _vm->stopScript(walkScript);
- moving = 0;
+ if (_walkScript)
+ _vm->stopScript(_walkScript);
+ _moving = 0;
}
void Actor::setActorWalkSpeed(uint newSpeedX, uint newSpeedY) {
- if (newSpeedX == speedx && newSpeedY == speedy)
+ if (newSpeedX == _speedx && newSpeedY == _speedy)
return;
- speedx = newSpeedX;
- speedy = newSpeedY;
+ _speedx = newSpeedX;
+ _speedy = newSpeedY;
- if (moving) {
- calcMovementFactor(walkdata.next);
+ if (_moving) {
+ calcMovementFactor(_walkdata.next);
}
}
@@ -186,16 +186,16 @@ int ScummEngine::getAngleFromPos(int x, int y) const {
}
int Actor::calcMovementFactor(const Common::Point& next) {
- Common::Point actorPos(_pos);
+ Common::Point _actorPos(_pos);
int diffX, diffY;
int32 deltaXFactor, deltaYFactor;
- if (actorPos == next)
+ if (_actorPos == next)
return 0;
- diffX = next.x - actorPos.x;
- diffY = next.y - actorPos.y;
- deltaYFactor = speedy << 16;
+ diffX = next.x - _actorPos.x;
+ diffY = next.y - _actorPos.y;
+ deltaYFactor = _speedy << 16;
if (diffY < 0)
deltaYFactor = -deltaYFactor;
@@ -207,8 +207,8 @@ int Actor::calcMovementFactor(const Common::Point& next) {
deltaYFactor = 0;
}
- if ((uint) abs((int)(deltaXFactor >> 16)) > speedx) {
- deltaXFactor = speedx << 16;
+ if ((uint) abs((int)(deltaXFactor >> 16)) > _speedx) {
+ deltaXFactor = _speedx << 16;
if (diffX < 0)
deltaXFactor = -deltaXFactor;
@@ -220,14 +220,14 @@ int Actor::calcMovementFactor(const Common::Point& next) {
}
}
- walkdata.cur = actorPos;
- walkdata.next = next;
- walkdata.deltaXFactor = deltaXFactor;
- walkdata.deltaYFactor = deltaYFactor;
- walkdata.xfrac = 0;
- walkdata.yfrac = 0;
+ _walkdata.cur = _actorPos;
+ _walkdata.next = next;
+ _walkdata.deltaXFactor = deltaXFactor;
+ _walkdata.deltaYFactor = deltaYFactor;
+ _walkdata.xfrac = 0;
+ _walkdata.yfrac = 0;
- targetFacing = _vm->getAngleFromPos(deltaXFactor, deltaYFactor);
+ _targetFacing = _vm->getAngleFromPos(deltaXFactor, deltaYFactor);
return actorWalkStep();
}
@@ -239,7 +239,7 @@ int Actor::remapDirection(int dir, bool is_walking) {
bool flipY;
// FIXME - It seems that at least in The Dig the original code does
- // check ignoreBoxes here. However, it breaks some animations in Loom,
+ // check _ignoreBoxes here. However, it breaks some animations in Loom,
// causing Bobbin to face towards the camera instead of away from it
// in some places: After the tree has been destroyed by lightning, and
// when entering the dark tunnels beyond the dragon's lair at the very
@@ -249,7 +249,7 @@ int Actor::remapDirection(int dir, bool is_walking) {
// not necessary here because we never call the function unless the
// actor is in the current room anyway.
- if (!ignoreBoxes || (_vm->_gameId == GID_LOOM || _vm->_gameId == GID_LOOM256)) {
+ if (!_ignoreBoxes || (_vm->_gameId == GID_LOOM || _vm->_gameId == GID_LOOM256)) {
specdir = _vm->_extraBoxFlags[_walkbox];
if (specdir) {
if (specdir & 0x8000) {
@@ -265,8 +265,8 @@ int Actor::remapDirection(int dir, bool is_walking) {
flags = _vm->getBoxFlags(_walkbox);
- flipX = (walkdata.deltaXFactor > 0);
- flipY = (walkdata.deltaYFactor > 0);
+ flipX = (_walkdata.deltaXFactor > 0);
+ flipY = (_walkdata.deltaYFactor > 0);
// Check for X-Flip
if ((flags & kBoxXFlip) || isInClass(kObjectClassXFlip)) {
@@ -324,13 +324,13 @@ int Actor::updateActorDirection(bool is_walking) {
int dir;
bool shouldInterpolate;
- if ((_vm->_version == 6) && ignoreTurns)
- return facing;
+ if ((_vm->_version == 6) && _ignoreTurns)
+ return _facing;
- dirType = (_vm->_version >= 7) ? _vm->akos_hasManyDirections(costume) : false;
+ dirType = (_vm->_version >= 7) ? _vm->akos_hasManyDirections(_costume) : false;
- from = toSimpleDir(dirType, facing);
- dir = remapDirection(targetFacing, is_walking);
+ from = toSimpleDir(dirType, _facing);
+ dir = remapDirection(_targetFacing, is_walking);
if (_vm->_version >= 7)
// Direction interpolation interfers with walk scripts in Dig; they perform
@@ -368,51 +368,51 @@ void Actor::setBox(int box) {
int Actor::actorWalkStep() {
int tmpX, tmpY;
- Common::Point actorPos;
+ Common::Point _actorPos;
int distX, distY;
int nextFacing;
- needRedraw = true;
+ _needRedraw = true;
nextFacing = updateActorDirection(true);
- if (!(moving & MF_IN_LEG) || facing != nextFacing) {
- if (_walkFrame != frame || facing != nextFacing) {
+ if (!(_moving & MF_IN_LEG) || _facing != nextFacing) {
+ if (_walkFrame != _frame || _facing != nextFacing) {
startWalkAnim(1, nextFacing);
}
- moving |= MF_IN_LEG;
+ _moving |= MF_IN_LEG;
}
- actorPos = _pos;
+ _actorPos = _pos;
- if (_walkbox != walkdata.curbox && _vm->checkXYInBoxBounds(walkdata.curbox, actorPos.x, actorPos.y)) {
- setBox(walkdata.curbox);
+ if (_walkbox != _walkdata.curbox && _vm->checkXYInBoxBounds(_walkdata.curbox, _actorPos.x, _actorPos.y)) {
+ setBox(_walkdata.curbox);
}
- distX = abs(walkdata.next.x - walkdata.cur.x);
- distY = abs(walkdata.next.y - walkdata.cur.y);
+ distX = abs(_walkdata.next.x - _walkdata.cur.x);
+ distY = abs(_walkdata.next.y - _walkdata.cur.y);
- if (abs(actorPos.x - walkdata.cur.x) >= distX && abs(actorPos.y - walkdata.cur.y) >= distY) {
- moving &= ~MF_IN_LEG;
+ if (abs(_actorPos.x - _walkdata.cur.x) >= distX && abs(_actorPos.y - _walkdata.cur.y) >= distY) {
+ _moving &= ~MF_IN_LEG;
return 0;
}
- tmpX = (actorPos.x << 16) + walkdata.xfrac + (walkdata.deltaXFactor >> 8) * scalex;
- walkdata.xfrac = (uint16)tmpX;
- actorPos.x = (tmpX >> 16);
+ tmpX = (_actorPos.x << 16) + _walkdata.xfrac + (_walkdata.deltaXFactor >> 8) * _scalex;
+ _walkdata.xfrac = (uint16)tmpX;
+ _actorPos.x = (tmpX >> 16);
- tmpY = (actorPos.y << 16) + walkdata.yfrac + (walkdata.deltaYFactor >> 8) * scaley;
- walkdata.yfrac = (uint16)tmpY;
- actorPos.y = (tmpY >> 16);
+ tmpY = (_actorPos.y << 16) + _walkdata.yfrac + (_walkdata.deltaYFactor >> 8) * _scaley;
+ _walkdata.yfrac = (uint16)tmpY;
+ _actorPos.y = (tmpY >> 16);
- if (abs(actorPos.x - walkdata.cur.x) > distX) {
- actorPos.x = walkdata.next.x;
+ if (abs(_actorPos.x - _walkdata.cur.x) > distX) {
+ _actorPos.x = _walkdata.next.x;
}
- if (abs(actorPos.y - walkdata.cur.y) > distY) {
- actorPos.y = walkdata.next.y;
+ if (abs(_actorPos.y - _walkdata.cur.y) > distY) {
+ _actorPos.y = _walkdata.next.y;
}
- _pos = actorPos;
+ _pos = _actorPos;
return 1;
}
@@ -420,12 +420,12 @@ int Actor::actorWalkStep() {
void Actor::setupActorScale() {
if (_vm->_features & GF_NO_SCALING) {
- scalex = 0xFF;
- scaley = 0xFF;
+ _scalex = 0xFF;
+ _scaley = 0xFF;
return;
}
- if (ignoreBoxes)
+ if (_ignoreBoxes)
return;
// For some boxes, we ignore the scaling and use whatever values the
@@ -434,12 +434,12 @@ void Actor::setupActorScale() {
if (_vm->_gameId == GID_SAMNMAX && (_vm->getBoxFlags(_walkbox) & kBoxIgnoreScale))
return;
- boxscale = _vm->getBoxScale(_walkbox);
+ _boxscale = _vm->getBoxScale(_walkbox);
uint16 scale = _vm->getScale(_walkbox, _pos.x, _pos.y);
assert(scale <= 0xFF);
- scalex = scaley = (byte)scale;
+ _scalex = _scaley = (byte)scale;
}
void Actor::startAnimActor(int f) {
@@ -462,13 +462,13 @@ void Actor::startAnimActor(int f) {
break;
}
- if (costume != 0) {
- animProgress = 0;
- needRedraw = true;
+ if (_costume != 0) {
+ _animProgress = 0;
+ _needRedraw = true;
if (f == _initFrame)
- cost.reset();
+ _cost.reset();
_vm->akos_decodeData(this, f, (uint) - 1);
- frame = f;
+ _frame = f;
}
} else {
switch (f) {
@@ -491,21 +491,21 @@ void Actor::startAnimActor(int f) {
assert(f != 0x3E);
- if (isInCurrentRoom() && costume != 0) {
- animProgress = 0;
- cost.animCounter = 0;
- needRedraw = true;
- // V1 - V2 games don't seem to need a cost.reset() at this point.
+ if (isInCurrentRoom() && _costume != 0) {
+ _animProgress = 0;
+ _cost.animCounter = 0;
+ _needRedraw = true;
+ // V1 - V2 games don't seem to need a _cost.reset() at this point.
// Causes Zak to lose his body in several scenes, see bug #771508
if (_vm->_version >= 3 && f == _initFrame) {
- cost.reset();
- auxBlock.visible = false;
+ _cost.reset();
+ _auxBlock.visible = false;
}
if (_vm->_features & GF_NEW_COSTUMES)
_vm->akos_decodeData(this, f, (uint) - 1);
else
_vm->cost_decodeData(this, f, (uint) - 1);
- frame = f;
+ _frame = f;
}
}
}
@@ -537,7 +537,7 @@ void Actor::animateActor(int anim) {
stopActorMoving();
break;
case 3: // change direction immediatly
- moving &= ~MF_TURN;
+ _moving &= ~MF_TURN;
setDirection(dir);
break;
case 4: // turn to new direction
@@ -557,20 +557,20 @@ void Actor::setDirection(int direction) {
uint16 vald;
// Do nothing if actor is already facing in the given direction
- if (facing == direction)
+ if (_facing == direction)
return;
// Normalize the angle
- facing = normalizeAngle(direction);
+ _facing = normalizeAngle(direction);
// If there is no costume set for this actor, we are finished
- if (costume == 0)
+ if (_costume == 0)
return;
// Update the costume for the new direction (and mark the actor for redraw)
aMask = 0x8000;
for (i = 0; i < 16; i++, aMask >>= 1) {
- vald = cost.frame[i];
+ vald = _cost.frame[i];
if (vald == 0xFFFF)
continue;
if (_vm->_features & GF_NEW_COSTUMES)
@@ -579,32 +579,32 @@ void Actor::setDirection(int direction) {
_vm->cost_decodeData(this, vald, (_vm->_version <= 2) ? 0xFFFF : aMask);
}
- needRedraw = true;
+ _needRedraw = true;
}
void Actor::putActor(int dstX, int dstY, byte newRoom) {
- if (visible && _vm->_currentRoom != newRoom && _vm->getTalkingActor() == number) {
+ if (_visible && _vm->_currentRoom != newRoom && _vm->getTalkingActor() == _number) {
_vm->stopTalk();
}
// WORKAROUND: The green transparency of the tank in the Hall of Oddities is
// is positioned one pixel too far to the left. This appears to be a
// bug in the original game as well.
- if (_vm->_gameId == GID_SAMNMAX && newRoom == 16 && number == 5 && dstX == 235 && dstY == 236)
+ if (_vm->_gameId == GID_SAMNMAX && newRoom == 16 && _number == 5 && dstX == 235 && dstY == 236)
dstX++;
_pos.x = dstX;
_pos.y = dstY;
- room = newRoom;
- needRedraw = true;
+ _room = newRoom;
+ _needRedraw = true;
- if (_vm->VAR(_vm->VAR_EGO) == number) {
+ if (_vm->VAR(_vm->VAR_EGO) == _number) {
_vm->_egoPositioned = true;
}
- if (visible) {
+ if (_visible) {
if (isInCurrentRoom()) {
- if (moving) {
+ if (_moving) {
stopActorMoving();
startAnimActor(_standFrame);
}
@@ -642,7 +642,7 @@ AdjustBoxResult Actor::adjustXYToBeInBox(int dstX, int dstY) {
abr.y = dstY;
abr.box = kInvalidBox;
- if (ignoreBoxes)
+ if (_ignoreBoxes)
return abr;
for (int tIdx = 0; tIdx < ARRAYSIZE(thresholdTable); tIdx++) {
@@ -716,19 +716,19 @@ void Actor::adjustActorPos() {
_pos.x = abr.x;
_pos.y = abr.y;
- walkdata.destbox = abr.box;
+ _walkdata.destbox = abr.box;
setBox(abr.box);
- walkdata.dest.x = -1;
+ _walkdata.dest.x = -1;
stopActorMoving();
- cost.soundCounter = 0;
+ _cost.soundCounter = 0;
if (_walkbox != kInvalidBox) {
byte flags = _vm->getBoxFlags(_walkbox);
if (flags & 7) {
- turnToDirection(facing);
+ turnToDirection(_facing);
}
}
}
@@ -747,59 +747,59 @@ void Actor::faceToObject(int obj) {
}
void Actor::turnToDirection(int newdir) {
- if (newdir == -1 || ignoreTurns)
+ if (newdir == -1 || _ignoreTurns)
return;
- moving &= ~MF_TURN;
+ _moving &= ~MF_TURN;
- if (newdir != facing) {
+ if (newdir != _facing) {
if (_vm->_version <= 3)
- moving = MF_TURN;
+ _moving = MF_TURN;
else
- moving |= MF_TURN;
- targetFacing = newdir;
+ _moving |= MF_TURN;
+ _targetFacing = newdir;
}
}
void Actor::hideActor() {
- if (!visible)
+ if (!_visible)
return;
- if (moving) {
+ if (_moving) {
stopActorMoving();
startAnimActor(_standFrame);
}
- visible = false;
- cost.soundCounter = 0;
- needRedraw = false;
- needBgReset = true;
- auxBlock.visible = false;
+ _visible = false;
+ _cost.soundCounter = 0;
+ _needRedraw = false;
+ _needBgReset = true;
+ _auxBlock.visible = false;
}
void Actor::showActor() {
- if (_vm->_currentRoom == 0 || visible)
+ if (_vm->_currentRoom == 0 || _visible)
return;
adjustActorPos();
- _vm->ensureResourceLoaded(rtCostume, costume);
+ _vm->ensureResourceLoaded(rtCostume, _costume);
- if (costumeNeedsInit) {
+ if (_costumeNeedsInit) {
startAnimActor(_initFrame);
if (_vm->_version <= 2) {
startAnimActor(_standFrame);
startAnimActor(_talkStopFrame);
}
- costumeNeedsInit = false;
+ _costumeNeedsInit = false;
}
// FIXME: Evil hack to work around bug #770717
- if (!moving && _vm->_version <= 2)
+ if (!_moving && _vm->_version <= 2)
startAnimActor(_standFrame);
stopActorMoving();
- visible = true;
- needRedraw = true;
+ _visible = true;
+ _needRedraw = true;
}
// V1 Maniac doesn't have a ScummVar for VAR_TALK_ACTOR, and just uses
@@ -825,7 +825,7 @@ void ScummEngine::putActors() {
for (i = 1; i < _numActors; i++) {
a = &_actors[i];
if (a && a->isInCurrentRoom())
- a->putActor(a->_pos.x, a->_pos.y, a->room);
+ a->putActor(a->_pos.x, a->_pos.y, a->_room);
}
}
@@ -837,7 +837,7 @@ void ScummEngine::setupV1ActorTalkColor() {
int i;
for (i = 1; i < _numActors; i++)
- _actors[i].talkColor = v1MMActorTalkColor[i];
+ _actors[i]._talkColor = v1MMActorTalkColor[i];
}
void ScummEngine::showActors() {
@@ -866,11 +866,11 @@ void ScummEngine::playActorSounds() {
int i;
for (i = 1; i < _numActors; i++) {
- if (_actors[i].cost.soundCounter && _actors[i].isInCurrentRoom() && _actors[i].sound) {
+ if (_actors[i]._cost.soundCounter && _actors[i].isInCurrentRoom() && _actors[i]._sound) {
_currentScript = 0xFF;
- _sound->addSoundToQueue(_actors[i].sound[0]);
+ _sound->addSoundToQueue(_actors[i]._sound[0]);
for (i = 1; i < _numActors; i++) {
- _actors[i].cost.soundCounter = 0;
+ _actors[i]._cost.soundCounter = 0;
}
return;
}
@@ -882,7 +882,7 @@ Actor *ScummEngine::derefActor(int id, const char *errmsg) const {
debugC(DEBUG_ACTORS, "derefActor(0, \"%s\") in script %d, opcode 0x%x",
errmsg, vm.slot[_curExecScript].number, _opcode);
- if (id < 0 || id >= _numActors || _actors[id].number != id) {
+ if (id < 0 || id >= _numActors || _actors[id]._number != id) {
if (errmsg)
error("Invalid actor %d in %s", id, errmsg);
else
@@ -896,7 +896,7 @@ Actor *ScummEngine::derefActorSafe(int id, const char *errmsg) const {
debugC(DEBUG_ACTORS, "derefActorSafe(0, \"%s\") in script %d, opcode 0x%x",
errmsg, vm.slot[_curExecScript].number, _opcode);
- if (id < 0 || id >= _numActors || _actors[id].number != id) {
+ if (id < 0 || id >= _numActors || _actors[id]._number != id) {
debugC(DEBUG_ACTORS, "Invalid actor %d in %s (script %d, opcode 0x%x)",
id, errmsg, vm.slot[_curExecScript].number, _opcode);
return NULL;
@@ -928,7 +928,7 @@ static int compareDrawOrder(const void* a, const void* b)
// Would be interesting if somebody could check the disassembly (see also the
// comment on the above mentioned tracker item).
if (g_scumm->_gameId == GID_TENTACLE) {
- diff = actor1->forceClip - actor2->forceClip;
+ diff = actor1->_forceClip - actor2->_forceClip;
if (diff < 0)
return -1;
if (diff > 0)
@@ -940,7 +940,7 @@ static int compareDrawOrder(const void* a, const void* b)
// actor number as tie-breaker. This is needed for the Sam & Max intro,
// and possibly other cases as well. See bug #758167.
- return actor1->number - actor2->number;
+ return actor1->_number - actor2->_number;
}
void ScummEngine::processActors() {
@@ -957,7 +957,7 @@ void ScummEngine::processActors() {
for (int i = 1; i < _numActors; i++) {
if (_version == 8 && _actors[i]._layer < 0)
continue;
- if (_actors[i].isInCurrentRoom() && _actors[i].costume)
+ if (_actors[i].isInCurrentRoom() && _actors[i]._costume)
actors[numactors++] = &_actors[i];
}
if (!numactors) {
@@ -992,7 +992,7 @@ void ScummEngine::processUpperActors() {
int i;
for (i = 1; i < _numActors; i++) {
- if (_actors[i].isInCurrentRoom() && _actors[i].costume && _actors[i]._layer < 0) {
+ if (_actors[i].isInCurrentRoom() && _actors[i]._costume && _actors[i]._layer < 0) {
CHECK_HEAP
_actors[i].drawActorCostume();
CHECK_HEAP
@@ -1003,17 +1003,17 @@ void ScummEngine::processUpperActors() {
void Actor::drawActorCostume(bool hitTestMode) {
if (!hitTestMode) {
- if (!needRedraw)
+ if (!_needRedraw)
return;
- needRedraw = false;
+ _needRedraw = false;
}
setupActorScale();
BaseCostumeRenderer* bcr = _vm->_costumeRenderer;
- bcr->_actorID = number;
+ bcr->_actorID = _number;
bcr->_actorX = _pos.x + _offsX - _vm->virtscr[0].xstart;
bcr->_actorY = _pos.y + _offsY - _elevation;
@@ -1025,7 +1025,7 @@ void Actor::drawActorCostume(bool hitTestMode) {
// actor is facing left (270 degree).
// V1 games are once again slightly different, here we only have
// to adjust the 270 degree case...
- if (facing == 270)
+ if (_facing == 270)
bcr->_actorX += 16;
else if (_vm->_version == 2)
bcr->_actorX += 8;
@@ -1033,11 +1033,11 @@ void Actor::drawActorCostume(bool hitTestMode) {
bcr->_clipOverride = _clipOverride;
- if (_vm->_version == 4 && boxscale & 0x8000) {
- bcr->_scaleX = bcr->_scaleY = _vm->getScaleFromSlot((boxscale & 0x7fff) + 1, _pos.x, _pos.y);
+ if (_vm->_version == 4 && _boxscale & 0x8000) {
+ bcr->_scaleX = bcr->_scaleY = _vm->getScaleFromSlot((_boxscale & 0x7fff) + 1, _pos.x, _pos.y);
} else {
- bcr->_scaleX = scalex;
- bcr->_scaleY = scaley;
+ bcr->_scaleX = _scalex;
+ bcr->_scaleY = _scaley;
}
bcr->_shadow_mode = _shadowMode;
@@ -1048,13 +1048,13 @@ void Actor::drawActorCostume(bool hitTestMode) {
else
bcr->_shadow_table = _vm->_shadowPalette;
- bcr->setCostume(costume);
- bcr->setPalette(palette);
+ bcr->setCostume(_costume);
+ bcr->setPalette(_palette);
bcr->setFacing(this);
if (_vm->_version >= 7) {
- bcr->_zbuf = forceClip;
+ bcr->_zbuf = _forceClip;
if (bcr->_zbuf == 100) {
bcr->_zbuf = _vm->getMaskFromBox(_walkbox);
if (bcr->_zbuf > _vm->gdi._numZBuffer-1)
@@ -1062,8 +1062,8 @@ void Actor::drawActorCostume(bool hitTestMode) {
}
} else {
- if (forceClip)
- bcr->_zbuf = forceClip;
+ if (_forceClip)
+ bcr->_zbuf = _forceClip;
else if (isInClass(kObjectClassNeverClip))
bcr->_zbuf = 0;
else {
@@ -1077,31 +1077,31 @@ void Actor::drawActorCostume(bool hitTestMode) {
bcr->_draw_top = 0x7fffffff;
bcr->_draw_bottom = 0;
- bcr->_skipLimbs = (heSkipLimbs != 0);
- bcr->_paletteNum = hePaletteNum;
+ bcr->_skipLimbs = (_heSkipLimbs != 0);
+ bcr->_paletteNum = _hePaletteNum;
- if (_vm->_heversion >= 80 && heNoTalkAnimation == 0) {
- heCondMask &= 0xFFFFFC00;
- heCondMask |= 1;
- if (_vm->getTalkingActor() == number) {
+ if (_vm->_heversion >= 80 && _heNoTalkAnimation == 0) {
+ _heCondMask &= 0xFFFFFC00;
+ _heCondMask |= 1;
+ if (_vm->getTalkingActor() == _number) {
// Checks if talk sound is active?
// Otherwise just do rand animation
int rnd = _vm->_rnd.getRandomNumberRng(1, 10);
setTalkCondition(rnd);
}
}
- heNoTalkAnimation = 0;
+ _heNoTalkAnimation = 0;
// If the actor is partially hidden, redraw it next frame.
// Only done for pre-AKOS, though.
- if (bcr->drawCostume(_vm->virtscr[0], _vm->gdi._numStrips, this, drawToBackBuf) & 1) {
- needRedraw = (_vm->_version <= 6);
+ if (bcr->drawCostume(_vm->virtscr[0], _vm->gdi._numStrips, this, _drawToBackBuf) & 1) {
+ _needRedraw = (_vm->_version <= 6);
}
if (!hitTestMode) {
// Record the vertical extent of the drawn actor
- top = bcr->_draw_top;
- bottom = bcr->_draw_bottom;
+ _top = bcr->_draw_top;
+ _bottom = bcr->_draw_bottom;
}
}
@@ -1121,24 +1121,24 @@ bool Actor::actorHitTest(int x, int y) {
}
void Actor::animateCostume() {
- if (costume == 0)
+ if (_costume == 0)
return;
- animProgress++;
- if (animProgress >= animSpeed) {
- animProgress = 0;
+ _animProgress++;
+ if (_animProgress >= _animSpeed) {
+ _animProgress = 0;
if (_vm->_features & GF_NEW_COSTUMES) {
- byte *akos = _vm->getResourceAddress(rtCostume, costume);
+ byte *akos = _vm->getResourceAddress(rtCostume, _costume);
assert(akos);
if (_vm->akos_increaseAnims(akos, this)) {
- needRedraw = true;
+ _needRedraw = true;
}
} else {
LoadedCostume lc(_vm);
- lc.loadCostume(costume);
+ lc.loadCostume(_costume);
if (lc.increaseAnims(this)) {
- needRedraw = true;
+ _needRedraw = true;
}
}
}
@@ -1152,16 +1152,16 @@ void Actor::animateLimb(int limb, int f) {
if (!f)
return;
- animProgress++;
- if (animProgress >= animSpeed) {
- animProgress = 0;
+ _animProgress++;
+ if (_animProgress >= _animSpeed) {
+ _animProgress = 0;
- if (costume == 0)
+ if (_costume == 0)
return;
const byte *aksq, *akfo;
uint size;
- byte *akos = _vm->getResourceAddress(rtCostume, costume);
+ byte *akos = _vm->getResourceAddress(rtCostume, _costume);
assert(akos);
aksq = _vm->findResourceData(MKID('AKSQ'), akos);
@@ -1170,12 +1170,12 @@ void Actor::animateLimb(int limb, int f) {
size = _vm->getResourceDataSize(akfo) / 2;
while (f--) {
- if (cost.active[limb] != 0)
+ if (_cost.active[limb] != 0)
_vm->akos_increaseAnim(this, limb, aksq, (const uint16 *)akfo, size);
}
-// needRedraw = true;
-// needBgReset = true;
+// _needRedraw = true;
+// _needBgReset = true;
}
}
@@ -1184,7 +1184,7 @@ void ScummEngine::setActorRedrawFlags() {
if (_fullRedraw) {
for (j = 1; j < _numActors; j++) {
- _actors[j].needRedraw = true;
+ _actors[j]._needRedraw = true;
}
} else {
for (i = 0; i < gdi._numStrips; i++) {
@@ -1192,7 +1192,7 @@ void ScummEngine::setActorRedrawFlags() {
if (testGfxAnyUsageBits(strip)) {
for (j = 1; j < _numActors; j++) {
if (testGfxUsageBit(strip, j) && testGfxOtherUsageBits(strip, j)) {
- _actors[j].needRedraw = true;
+ _actors[j]._needRedraw = true;
}
}
}
@@ -1209,16 +1209,16 @@ void ScummEngine::resetActorBgs() {
clearGfxUsageBit(strip, USAGE_BIT_RESTORED);
for (j = 1; j < _numActors; j++) {
if (testGfxUsageBit(strip, j) &&
- ((_actors[j].top != 0x7fffffff && _actors[j].needRedraw) || _actors[j].needBgReset)) {
+ ((_actors[j]._top != 0x7fffffff && _actors[j]._needRedraw) || _actors[j]._needBgReset)) {
clearGfxUsageBit(strip, j);
- if ((_actors[j].bottom - _actors[j].top) >= 0)
- gdi.resetBackground(_actors[j].top, _actors[j].bottom, i);
+ if ((_actors[j]._bottom - _actors[j]._top) >= 0)
+ gdi.resetBackground(_actors[j]._top, _actors[j]._bottom, i);
}
}
}
for (i = 1; i < _numActors; i++) {
- _actors[i].needBgReset = false;
+ _actors[i]._needBgReset = false;
}
}
@@ -1229,7 +1229,7 @@ int ScummEngine::getActorFromPos(int x, int y) {
return 0;
for (i = 1; i < _numActors; i++) {
if (testGfxUsageBit(x / 8, i) && !getClass(i, kObjectClassUntouchable)
- && y >= _actors[i].top && y <= _actors[i].bottom) {
+ && y >= _actors[i]._top && y <= _actors[i]._bottom) {
if (_version > 2 || i != VAR(VAR_EGO))
return i;
}
@@ -1272,7 +1272,7 @@ void ScummEngine::actorTalk(const byte *msg) {
} else {
if ((_version <= 7 && !_keepText) || (_version == 8 && VAR(VAR_HAVE_MSG)))
stopTalk();
- setTalkingActor(a->number);
+ setTalkingActor(a->_number);
a->_heTalking = true;
if (!_string[0].no_talk_anim) {
a->runActorTalkScript(a->_talkStartFrame);
@@ -1288,7 +1288,7 @@ void ScummEngine::actorTalk(const byte *msg) {
_charsetColor = (byte)_string[0].color;
} else {
a = derefActor(getTalkingActor(), "actorTalk(2)");
- _charsetColor = a->talkColor;
+ _charsetColor = a->_talkColor;
}
_charsetBufPos = 0;
_talkDelay = 0;
@@ -1304,16 +1304,16 @@ void Actor::runActorTalkScript(int f) {
if (_vm->_version == 8 && _vm->VAR(_vm->VAR_HAVE_MSG) == 2)
return;
- if (talkScript) {
- int script = talkScript;
+ if (_talkScript) {
+ int script = _talkScript;
int args[16];
memset(args, 0, sizeof(args));
args[1] = f;
- args[0] = number;
+ args[0] = _number;
_vm->runScript(script, 1, 0, args);
} else {
- if (frame != f)
+ if (_frame != f)
startAnimActor(f);
}
}
@@ -1350,8 +1350,8 @@ void Actor::setActorCostume(int c) {
int i;
if ((_vm->_features & GF_HUMONGOUS) && (c == -1 || c == -2)) {
- heSkipLimbs = (c == -1);
- needRedraw = true;
+ _heSkipLimbs = (c == -1);
+ _needRedraw = true;
return;
}
@@ -1360,32 +1360,32 @@ void Actor::setActorCostume(int c) {
if (_vm->_heversion == 60)
c &= 0xff;
- costumeNeedsInit = true;
+ _costumeNeedsInit = true;
if (_vm->_features & GF_NEW_COSTUMES) {
- cost.reset();
- auxBlock.visible = false;
- memset(animVariable, 0, sizeof(animVariable));
- costume = c;
+ _cost.reset();
+ _auxBlock.visible = false;
+ memset(_animVariable, 0, sizeof(_animVariable));
+ _costume = c;
if (_vm->_heversion >= 71)
_vm->queueAuxBlock(this);
- if (visible) {
- if (costume) {
- _vm->ensureResourceLoaded(rtCostume, costume);
+ if (_visible) {
+ if (_costume) {
+ _vm->ensureResourceLoaded(rtCostume, _costume);
}
startAnimActor(_initFrame);
}
} else {
- if (visible) {
+ if (_visible) {
hideActor();
- cost.reset();
- costume = c;
+ _cost.reset();
+ _costume = c;
showActor();
} else {
- costume = c;
- cost.reset();
+ _costume = c;
+ _cost.reset();
}
}
@@ -1396,19 +1396,19 @@ void Actor::setActorCostume(int c) {
if (_vm->_features & GF_NEW_COSTUMES) {
for (i = 0; i < 256; i++)
- palette[i] = 0xFF;
+ _palette[i] = 0xFF;
} else if (_vm->_features & GF_OLD_BUNDLE) {
for (i = 0; i < 16; i++)
- palette[i] = i;
+ _palette[i] = i;
// Make stuff more visible on CGA. Based on disassembly
if (_vm->_renderMode == Common::kRenderCGA && _vm->_version > 2) {
- palette[6] = 5;
- palette[7] = 15;
+ _palette[6] = 5;
+ _palette[7] = 15;
}
} else {
for (i = 0; i < 32; i++)
- palette[i] = 0xFF;
+ _palette[i] = 0xFF;
}
}
@@ -1425,21 +1425,21 @@ void Actor::startWalkActor(int destX, int destY, int dir) {
if (!isInCurrentRoom()) {
_pos.x = abr.x;
_pos.y = abr.y;
- if (!(_vm->_version == 6 && ignoreTurns) && dir != -1)
+ if (!(_vm->_version == 6 && _ignoreTurns) && dir != -1)
setDirection(dir);
return;
}
- if (ignoreBoxes) {
+ if (_ignoreBoxes) {
abr.box = kInvalidBox;
_walkbox = kInvalidBox;
} else {
- if (_vm->checkXYInBoxBounds(walkdata.destbox, abr.x, abr.y)) {
- abr.box = walkdata.destbox;
+ if (_vm->checkXYInBoxBounds(_walkdata.destbox, abr.x, abr.y)) {
+ abr.box = _walkdata.destbox;
} else {
abr = adjustXYToBeInBox(abr.x, abr.y);
}
- if (moving && walkdata.destdir == dir && walkdata.dest.x == abr.x && walkdata.dest.y == abr.y)
+ if (_moving && _walkdata.destdir == dir && _walkdata.dest.x == abr.x && _walkdata.dest.y == abr.y)
return;
}
@@ -1448,30 +1448,30 @@ void Actor::startWalkActor(int destX, int destY, int dir) {
return;
}
- walkdata.dest.x = abr.x;
- walkdata.dest.y = abr.y;
- walkdata.destbox = abr.box;
- walkdata.destdir = dir;
- moving = (moving & MF_IN_LEG) | MF_NEW_LEG;
- walkdata.point3.x = 32000;
+ _walkdata.dest.x = abr.x;
+ _walkdata.dest.y = abr.y;
+ _walkdata.destbox = abr.box;
+ _walkdata.destdir = dir;
+ _moving = (_moving & MF_IN_LEG) | MF_NEW_LEG;
+ _walkdata.point3.x = 32000;
- walkdata.curbox = _walkbox;
+ _walkdata.curbox = _walkbox;
}
void Actor::startWalkAnim(int cmd, int angle) {
if (angle == -1)
- angle = facing;
+ angle = _facing;
/* Note: walk scripts aren't required to make the Dig
* work as usual
*/
- if (walkScript) {
+ if (_walkScript) {
int args[16];
memset(args, 0, sizeof(args));
- args[0] = number;
+ args[0] = _number;
args[1] = cmd;
args[2] = angle;
- _vm->runScript(walkScript, 1, 0, args);
+ _vm->runScript(_walkScript, 1, 0, args);
} else {
switch (cmd) {
case 1: /* start walk */
@@ -1494,77 +1494,77 @@ void Actor::walkActor() {
Common::Point foundPath;
if (_vm->_version >= 7) {
- if (moving & MF_FROZEN) {
- if (moving & MF_TURN) {
+ if (_moving & MF_FROZEN) {
+ if (_moving & MF_TURN) {
new_dir = updateActorDirection(false);
- if (facing != new_dir)
+ if (_facing != new_dir)
setDirection(new_dir);
else
- moving &= ~MF_TURN;
+ _moving &= ~MF_TURN;
}
return;
}
}
- if (!moving)
+ if (!_moving)
return;
- if (!(moving & MF_NEW_LEG)) {
- if (moving & MF_IN_LEG && actorWalkStep())
+ if (!(_moving & MF_NEW_LEG)) {
+ if (_moving & MF_IN_LEG && actorWalkStep())
return;
- if (moving & MF_LAST_LEG) {
- moving = 0;
- setBox(walkdata.destbox);
- startWalkAnim(3, walkdata.destdir);
+ if (_moving & MF_LAST_LEG) {
+ _moving = 0;
+ setBox(_walkdata.destbox);
+ startWalkAnim(3, _walkdata.destdir);
return;
}
- if (moving & MF_TURN) {
+ if (_moving & MF_TURN) {
new_dir = updateActorDirection(false);
- if (facing != new_dir)
+ if (_facing != new_dir)
setDirection(new_dir);
else
- moving = 0;
+ _moving = 0;
return;
}
- setBox(walkdata.curbox);
- moving &= MF_IN_LEG;
+ setBox(_walkdata.curbox);
+ _moving &= MF_IN_LEG;
}
- moving &= ~MF_NEW_LEG;
+ _moving &= ~MF_NEW_LEG;
do {
if (_walkbox == kInvalidBox) {
- setBox(walkdata.destbox);
- walkdata.curbox = walkdata.destbox;
+ setBox(_walkdata.destbox);
+ _walkdata.curbox = _walkdata.destbox;
break;
}
- if (_walkbox == walkdata.destbox)
+ if (_walkbox == _walkdata.destbox)
break;
- next_box = _vm->getPathToDestBox(_walkbox, walkdata.destbox);
+ next_box = _vm->getPathToDestBox(_walkbox, _walkdata.destbox);
if (next_box < 0) {
- walkdata.destbox = _walkbox;
- moving |= MF_LAST_LEG;
+ _walkdata.destbox = _walkbox;
+ _moving |= MF_LAST_LEG;
return;
}
- walkdata.curbox = next_box;
+ _walkdata.curbox = next_box;
- if (findPathTowards(_walkbox, next_box, walkdata.destbox, foundPath))
+ if (findPathTowards(_walkbox, next_box, _walkdata.destbox, foundPath))
break;
if (calcMovementFactor(foundPath))
return;
- setBox(walkdata.curbox);
+ setBox(_walkdata.curbox);
} while (1);
- moving |= MF_LAST_LEG;
- calcMovementFactor(walkdata.dest);
+ _moving |= MF_LAST_LEG;
+ calcMovementFactor(_walkdata.dest);
}
/*
@@ -1572,45 +1572,45 @@ void Actor::walkActorV12() {
Common::Point foundPath, tmp;
int new_dir, next_box;
- if (moving & MF_TURN) {
+ if (_moving & MF_TURN) {
new_dir = updateActorDirection(false);
- if (facing != new_dir)
+ if (_facing != new_dir)
setDirection(new_dir);
else
- moving = 0;
+ _moving = 0;
return;
}
- if (!moving)
+ if (!_moving)
return;
- if (moving & MF_IN_LEG) {
+ if (_moving & MF_IN_LEG) {
actorWalkStep();
} else {
- if (moving & MF_LAST_LEG) {
- moving = 0;
- startWalkAnim(3, walkdata.destdir);
+ if (_moving & MF_LAST_LEG) {
+ _moving = 0;
+ startWalkAnim(3, _walkdata.destdir);
} else {
- setBox(walkdata.curbox);
- if (_walkbox == walkdata.destbox) {
- foundPath = walkdata.dest;
- moving |= MF_LAST_LEG;
+ setBox(_walkdata.curbox);
+ if (_walkbox == _walkdata.destbox) {
+ foundPath = _walkdata.dest;
+ _moving |= MF_LAST_LEG;
} else {
- next_box = _vm->getPathToDestBox(_walkbox, walkdata.destbox);
+ next_box = _vm->getPathToDestBox(_walkbox, _walkdata.destbox);
if (next_box < 0) {
- moving |= MF_LAST_LEG;
+ _moving |= MF_LAST_LEG;
return;
}
// Can't walk through locked boxes
int flags = _vm->getBoxFlags(next_box);
if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
- moving |= MF_LAST_LEG;
+ _moving |= MF_LAST_LEG;
}
- walkdata.curbox = next_box;
+ _walkdata.curbox = next_box;
- _vm->getClosestPtOnBox(walkdata.curbox, x, y, tmp.x, tmp.y);
+ _vm->getClosestPtOnBox(_walkdata.curbox, x, y, tmp.x, tmp.y);
_vm->getClosestPtOnBox(_walkbox, tmp.x, tmp.y, foundPath.x, foundPath.y);
}
calcMovementFactor(foundPath);
@@ -1623,91 +1623,91 @@ void Actor::walkActorOld() {
Common::Point p2, p3; // Gate locations
int new_dir, next_box, loopCtr = 0;
- if (!moving)
+ if (!_moving)
return;
- if (!(moving & MF_NEW_LEG)) {
- if (moving & MF_IN_LEG && actorWalkStep())
+ if (!(_moving & MF_NEW_LEG)) {
+ if (_moving & MF_IN_LEG && actorWalkStep())
return;
- if (moving & MF_LAST_LEG) {
- moving = 0;
- startWalkAnim(3, walkdata.destdir);
+ if (_moving & MF_LAST_LEG) {
+ _moving = 0;
+ startWalkAnim(3, _walkdata.destdir);
return;
}
- if (moving & MF_TURN) {
+ if (_moving & MF_TURN) {
new_dir = updateActorDirection(false);
- if (facing != new_dir)
+ if (_facing != new_dir)
setDirection(new_dir);
else
- moving = 0;
+ _moving = 0;
return;
}
- if (walkdata.point3.x != 32000) {
- if (calcMovementFactor(walkdata.point3)) {
- walkdata.point3.x = 32000;
+ if (_walkdata.point3.x != 32000) {
+ if (calcMovementFactor(_walkdata.point3)) {
+ _walkdata.point3.x = 32000;
return;
}
- walkdata.point3.x = 32000;
+ _walkdata.point3.x = 32000;
}
- setBox(walkdata.curbox);
- moving &= MF_IN_LEG;
+ setBox(_walkdata.curbox);
+ _moving &= MF_IN_LEG;
}
- moving &= ~MF_NEW_LEG;
+ _moving &= ~MF_NEW_LEG;
do {
loopCtr++;
if (_walkbox == kInvalidBox) {
- setBox(walkdata.destbox);
- walkdata.curbox = walkdata.destbox;
+ setBox(_walkdata.destbox);
+ _walkdata.curbox = _walkdata.destbox;
break;
}
- if (_walkbox == walkdata.destbox)
+ if (_walkbox == _walkdata.destbox)
break;
- next_box = _vm->getPathToDestBox(_walkbox, walkdata.destbox);
+ next_box = _vm->getPathToDestBox(_walkbox, _walkdata.destbox);
// WORKAROUND: To fully fix bug #774783, we add a special case
// here, resulting in a different next_box value for Hitler.
- if ((_vm->_gameId == GID_INDY3) && _vm->_roomResource == 46 && _walkbox == 1 && walkdata.destbox == 0 && number == 9)
+ if ((_vm->_gameId == GID_INDY3) && _vm->_roomResource == 46 && _walkbox == 1 && _walkdata.destbox == 0 && _number == 9)
next_box = 1;
if (next_box < 0) {
- moving |= MF_LAST_LEG;
+ _moving |= MF_LAST_LEG;
return;
}
// Can't walk through locked boxes
int flags = _vm->getBoxFlags(next_box);
if (flags & kBoxLocked && !(flags & kBoxPlayerOnly && !isPlayer())) {
- moving |= MF_LAST_LEG;
+ _moving |= MF_LAST_LEG;
// FIXME: Work in progress
-// walkdata.destdir = facing;
+// _walkdata.destdir = _facing;
return;
}
- walkdata.curbox = next_box;
+ _walkdata.curbox = next_box;
if (_vm->_version <= 2) {
- _vm->getClosestPtOnBox(walkdata.curbox, _pos.x, _pos.y, p2.x, p2.y);
+ _vm->getClosestPtOnBox(_walkdata.curbox, _pos.x, _pos.y, p2.x, p2.y);
_vm->getClosestPtOnBox(_walkbox, p2.x, p2.y, p3.x, p3.y);
// FIXME: Work in progress
// calcMovementFactor(p3);
// return;
} else {
- findPathTowardsOld(_walkbox, next_box, walkdata.destbox, p2, p3);
+ findPathTowardsOld(_walkbox, next_box, _walkdata.destbox, p2, p3);
if (p2.x == 32000 && p3.x == 32000) {
break;
}
if (p2.x != 32000) {
if (calcMovementFactor(p2)) {
- walkdata.point3 = p3;
+ _walkdata.point3 = p3;
return;
}
}
@@ -1715,24 +1715,24 @@ void Actor::walkActorOld() {
if (calcMovementFactor(p3))
return;
- setBox(walkdata.destbox);
+ setBox(_walkdata.destbox);
// FIXME: Ender added this recursion counter as a hack around
// a infinite loop in Maniac V1 - see bug #862245
if (loopCtr > 100) {
- moving |= MF_LAST_LEG;
+ _moving |= MF_LAST_LEG;
return;
}
} while (1);
- moving |= MF_LAST_LEG;
- calcMovementFactor(walkdata.dest);
+ _moving |= MF_LAST_LEG;
+ calcMovementFactor(_walkdata.dest);
}
byte *Actor::getActorName() {
- byte *ptr = _vm->getResourceAddress(rtActorName, number);
+ byte *ptr = _vm->getResourceAddress(rtActorName, _number);
if (ptr == NULL) {
- warning("Failed to find name of actor %d", number);
+ warning("Failed to find name of actor %d", _number);
}
return ptr;
}
@@ -1742,15 +1742,15 @@ void Actor::remapActorPaletteColor(int color, int new_color) {
int akpl_size, i;
byte akpl_color;
- akos = _vm->getResourceAddress(rtCostume, costume);
+ akos = _vm->getResourceAddress(rtCostume, _costume);
if (!akos) {
- warning("Can't remap actor %d, costume %d not found", number, costume);
+ warning("Can't remap actor %d, costume %d not found", _number, _costume);
return;
}
akpl = _vm->findResourceData(MKID('AKPL'), akos);
if (!akpl) {
- warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", number, costume);
+ warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", _number, _costume);
return;
}
@@ -1760,7 +1760,7 @@ void Actor::remapActorPaletteColor(int color, int new_color) {
for (i = 0; i < akpl_size; i++) {
akpl_color = *akpl++;
if (akpl_color == color) {
- palette[i] = new_color;
+ _palette[i] = new_color;
return;
}
}
@@ -1773,22 +1773,22 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
byte akpl_color;
if (!isInCurrentRoom()) {
- debugC(DEBUG_ACTORS, "Remap actor %d not in current room", number);
+ debugC(DEBUG_ACTORS, "Remap actor %d not in current room", _number);
return;
- } else if (costume < 1 || costume >= _vm->_numCostumes - 1) {
- debugC(DEBUG_ACTORS, "Remap actor %d invalid costume %d", number, costume);
+ } else if (_costume < 1 || _costume >= _vm->_numCostumes - 1) {
+ debugC(DEBUG_ACTORS, "Remap actor %d invalid costume %d", _number, _costume);
return;
}
- akos = _vm->getResourceAddress(rtCostume, costume);
+ akos = _vm->getResourceAddress(rtCostume, _costume);
if (!akos) {
- warning("Can't remap actor %d, costume %d not found", number, costume);
+ warning("Can't remap actor %d, costume %d not found", _number, _costume);
return;
}
akpl = _vm->findResourceData(MKID('AKPL'), akos);
if (!akpl) {
- warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", number, costume);
+ warning("Can't remap actor %d, costume %d doesn't contain an AKPL block", _number, _costume);
return;
}
@@ -1798,7 +1798,7 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
rgbs = _vm->findResourceData(MKID('RGBS'), akos);
if (!rgbs) {
- debugC(DEBUG_ACTORS, "Can't remap actor %d costume %d doesn't contain an RGB block", number, costume);
+ debugC(DEBUG_ACTORS, "Can't remap actor %d costume %d doesn't contain an RGB block", _number, _costume);
return;
}
@@ -1814,25 +1814,25 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
r = (r * r_fact) >> 8;
g = (g * g_fact) >> 8;
b = (b * b_fact) >> 8;
- palette[i] = _vm->remapPaletteColor(r, g, b, threshold);
+ _palette[i] = _vm->remapPaletteColor(r, g, b, threshold);
}
}
}
void Actor::classChanged(int cls, bool value) {
if (cls == kObjectClassAlwaysClip)
- forceClip = value;
+ _forceClip = value;
if (cls == kObjectClassIgnoreBoxes)
- ignoreBoxes = value;
+ _ignoreBoxes = value;
}
bool Actor::isInClass(int cls) {
- return _vm->getClass(number, cls);
+ return _vm->getClass(_number, cls);
}
bool Actor::isPlayer() {
if (_vm->_version <= 2)
- return _vm->VAR(42) <= number && number <= _vm->VAR(43);
+ return _vm->VAR(42) <= _number && _number <= _vm->VAR(43);
else
return isInClass(kObjectClassPlayer);
}
@@ -1841,39 +1841,39 @@ void Actor::setUserCondition(int slot, int set) {
debug(1, "Actor::setUserCondition(%d, %d)", slot, set);
assert(slot >= 1 && slot <= 0x20);
if (set == 0) {
- heCondMask &= ~(1 << (slot + 0xF));
+ _heCondMask &= ~(1 << (slot + 0xF));
} else {
- heCondMask |= 1 << (slot + 0xF);
+ _heCondMask |= 1 << (slot + 0xF);
}
- if (heCondMask & 0x3FF) {
- heCondMask &= ~1;
+ if (_heCondMask & 0x3FF) {
+ _heCondMask &= ~1;
} else {
- heCondMask |= 1;
+ _heCondMask |= 1;
}
}
bool Actor::isUserConditionSet(int slot) const {
assert(slot >= 1 && slot <= 0x20);
- return (heCondMask & (1 << (slot + 0xF))) != 0;
+ return (_heCondMask & (1 << (slot + 0xF))) != 0;
}
void Actor::setTalkCondition(int slot) {
debug(1, "Actor::setTalkCondition(%d)", slot);
assert(slot >= 1 && slot <= 0x10);
- heCondMask = (heCondMask & ~0x3FF) | 1;
+ _heCondMask = (_heCondMask & ~0x3FF) | 1;
if (slot != 1) {
- heCondMask |= 1 << (slot - 1);
- if (heCondMask & 0x3FF) {
- heCondMask &= ~1;
+ _heCondMask |= 1 << (slot - 1);
+ if (_heCondMask & 0x3FF) {
+ _heCondMask &= ~1;
} else {
- heCondMask |= 1;
+ _heCondMask |= 1;
}
}
}
bool Actor::isTalkConditionSet(int slot) const {
assert(slot >= 1 && slot <= 0x10);
- return (heCondMask & (1 << (slot - 1))) != 0;
+ return (_heCondMask & (1 << (slot - 1))) != 0;
}
void ScummEngine::preProcessAuxQueue() {
@@ -1895,7 +1895,7 @@ void ScummEngine::postProcessAuxQueue() {
AuxEntry *ae = &_auxEntries[i];
if (ae->actorNum != -1) {
Actor *a = derefActor(ae->actorNum, "postProcessAuxQueue");
- const uint8 *cost = getResourceAddress(rtCostume, a->costume);
+ const uint8 *cost = getResourceAddress(rtCostume, a->_costume);
int dy = a->_offsY + a->_pos.y - a->getElevation();
int dx = a->_offsX + a->_pos.x;
@@ -1946,11 +1946,11 @@ void ScummEngine::postProcessAuxQueue() {
}
const uint8 *axer = findResourceData(MKID('AXER'), auxd);
if (axer) {
- a->auxBlock.visible = true;
- a->auxBlock.r.left = (int16)READ_LE_UINT16(axer + 0) + dx;
- a->auxBlock.r.top = (int16)READ_LE_UINT16(axer + 2) + dy;
- a->auxBlock.r.right = (int16)READ_LE_UINT16(axer + 4) + dx;
- a->auxBlock.r.bottom = (int16)READ_LE_UINT16(axer + 6) + dy;
+ a->_auxBlock.visible = true;
+ a->_auxBlock.r.left = (int16)READ_LE_UINT16(axer + 0) + dx;
+ a->_auxBlock.r.top = (int16)READ_LE_UINT16(axer + 2) + dy;
+ a->_auxBlock.r.right = (int16)READ_LE_UINT16(axer + 4) + dx;
+ a->_auxBlock.r.bottom = (int16)READ_LE_UINT16(axer + 6) + dy;
}
}
}
@@ -1959,11 +1959,11 @@ void ScummEngine::postProcessAuxQueue() {
}
void ScummEngine::queueAuxBlock(Actor *a) {
- if (!a->auxBlock.visible)
+ if (!a->_auxBlock.visible)
return;
assert(_auxBlocksNum < ARRAYSIZE(_auxBlocks));
- _auxBlocks[_auxBlocksNum] = a->auxBlock;
+ _auxBlocks[_auxBlocksNum] = a->_auxBlock;
++_auxBlocksNum;
}
@@ -1982,95 +1982,95 @@ const SaveLoadEntry *Actor::getSaveLoadEntries() {
MKLINE(Actor, _pos.y, sleInt16, VER(8)),
MKLINE(Actor, _offsX, sleInt16, VER(32)),
MKLINE(Actor, _offsY, sleInt16, VER(32)),
- MKLINE(Actor, top, sleInt16, VER(8)),
- MKLINE(Actor, bottom, sleInt16, VER(8)),
+ MKLINE(Actor, _top, sleInt16, VER(8)),
+ MKLINE(Actor, _bottom, sleInt16, VER(8)),
MKLINE(Actor, _elevation, sleInt16, VER(8)),
- MKLINE(Actor, width, sleUint16, VER(8)),
- MKLINE(Actor, facing, sleUint16, VER(8)),
- MKLINE(Actor, costume, sleUint16, VER(8)),
- MKLINE(Actor, room, sleByte, VER(8)),
- MKLINE(Actor, talkColor, sleByte, VER(8)),
- MKLINE(Actor, talkFrequency, sleInt16, VER(16)),
- MKLINE(Actor, talkPan, sleInt16, VER(24)),
- MKLINE(Actor, talkVolume, sleInt16, VER(29)),
- MKLINE(Actor, boxscale, sleUint16, VER(34)),
- MKLINE(Actor, scalex, sleByte, VER(8)),
- MKLINE(Actor, scaley, sleByte, VER(8)),
- MKLINE(Actor, charset, sleByte, VER(8)),
+ MKLINE(Actor, _width, sleUint16, VER(8)),
+ MKLINE(Actor, _facing, sleUint16, VER(8)),
+ MKLINE(Actor, _costume, sleUint16, VER(8)),
+ MKLINE(Actor, _room, sleByte, VER(8)),
+ MKLINE(Actor, _talkColor, sleByte, VER(8)),
+ MKLINE(Actor, _talkFrequency, sleInt16, VER(16)),
+ MKLINE(Actor, _talkPan, sleInt16, VER(24)),
+ MKLINE(Actor, _talkVolume, sleInt16, VER(29)),
+ MKLINE(Actor, _boxscale, sleUint16, VER(34)),
+ MKLINE(Actor, _scalex, sleByte, VER(8)),
+ MKLINE(Actor, _scaley, sleByte, VER(8)),
+ MKLINE(Actor, _charset, sleByte, VER(8)),
// Actor sound grew from 8 to 32 bytes
- MKARRAY_OLD(Actor, sound[0], sleByte, 8, VER(8), VER(36)),
- MKARRAY(Actor, sound[0], sleByte, 32, VER(37)),
+ MKARRAY_OLD(Actor, _sound[0], sleByte, 8, VER(8), VER(36)),
+ MKARRAY(Actor, _sound[0], sleByte, 32, VER(37)),
// Actor animVariable grew from 8 to 27
- MKARRAY_OLD(Actor, animVariable[0], sleUint16, 8, VER(8), VER(40)),
- MKARRAY(Actor, animVariable[0], sleUint16, 27, VER(41)),
+ MKARRAY_OLD(Actor, _animVariable[0], sleUint16, 8, VER(8), VER(40)),
+ MKARRAY(Actor, _animVariable[0], sleUint16, 27, VER(41)),
- MKLINE(Actor, targetFacing, sleUint16, VER(8)),
- MKLINE(Actor, moving, sleByte, VER(8)),
- MKLINE(Actor, ignoreBoxes, sleByte, VER(8)),
- MKLINE(Actor, forceClip, sleByte, VER(8)),
+ MKLINE(Actor, _targetFacing, sleUint16, VER(8)),
+ MKLINE(Actor, _moving, sleByte, VER(8)),
+ MKLINE(Actor, _ignoreBoxes, sleByte, VER(8)),
+ MKLINE(Actor, _forceClip, sleByte, VER(8)),
MKLINE(Actor, _initFrame, sleByte, VER(8)),
MKLINE(Actor, _walkFrame, sleByte, VER(8)),
MKLINE(Actor, _standFrame, sleByte, VER(8)),
MKLINE(Actor, _talkStartFrame, sleByte, VER(8)),
MKLINE(Actor, _talkStopFrame, sleByte, VER(8)),
- MKLINE(Actor, speedx, sleUint16, VER(8)),
- MKLINE(Actor, speedy, sleUint16, VER(8)),
- MKLINE(Actor, cost.animCounter, sleUint16, VER(8)),
- MKLINE(Actor, cost.soundCounter, sleByte, VER(8)),
- MKLINE(Actor, drawToBackBuf, sleByte, VER(32)),
- MKLINE(Actor, flip, sleByte, VER(32)),
- MKLINE(Actor, heSkipLimbs, sleByte, VER(32)),
+ MKLINE(Actor, _speedx, sleUint16, VER(8)),
+ MKLINE(Actor, _speedy, sleUint16, VER(8)),
+ MKLINE(Actor, _cost.animCounter, sleUint16, VER(8)),
+ MKLINE(Actor, _cost.soundCounter, sleByte, VER(8)),
+ MKLINE(Actor, _drawToBackBuf, sleByte, VER(32)),
+ MKLINE(Actor, _flip, sleByte, VER(32)),
+ MKLINE(Actor, _heSkipLimbs, sleByte, VER(32)),
// Actor palette grew from 64 to 256 bytes
- MKARRAY_OLD(Actor, palette[0], sleByte, 64, VER(8), VER(9)),
- MKARRAY(Actor, palette[0], sleByte, 256, VER(10)),
+ MKARRAY_OLD(Actor, _palette[0], sleByte, 64, VER(8), VER(9)),
+ MKARRAY(Actor, _palette[0], sleByte, 256, VER(10)),
- MK_OBSOLETE(Actor, mask, sleByte, VER(8), VER(9)),
+ MK_OBSOLETE(Actor, _mask, sleByte, VER(8), VER(9)),
MKLINE(Actor, _shadowMode, sleByte, VER(8)),
- MKLINE(Actor, visible, sleByte, VER(8)),
- MKLINE(Actor, frame, sleByte, VER(8)),
- MKLINE(Actor, animSpeed, sleByte, VER(8)),
- MKLINE(Actor, animProgress, sleByte, VER(8)),
+ MKLINE(Actor, _visible, sleByte, VER(8)),
+ MKLINE(Actor, _frame, sleByte, VER(8)),
+ MKLINE(Actor, _animSpeed, sleByte, VER(8)),
+ MKLINE(Actor, _animProgress, sleByte, VER(8)),
MKLINE(Actor, _walkbox, sleByte, VER(8)),
- MKLINE(Actor, needRedraw, sleByte, VER(8)),
- MKLINE(Actor, needBgReset, sleByte, VER(8)),
- MKLINE(Actor, costumeNeedsInit, sleByte, VER(8)),
- MKLINE(Actor, heCondMask, sleUint32, VER(38)),
-
- MKLINE(Actor, talkPosY, sleInt16, VER(8)),
- MKLINE(Actor, talkPosX, sleInt16, VER(8)),
- MKLINE(Actor, ignoreTurns, sleByte, VER(8)),
+ MKLINE(Actor, _needRedraw, sleByte, VER(8)),
+ MKLINE(Actor, _needBgReset, sleByte, VER(8)),
+ MKLINE(Actor, _costumeNeedsInit, sleByte, VER(8)),
+ MKLINE(Actor, _heCondMask, sleUint32, VER(38)),
+
+ MKLINE(Actor, _talkPosY, sleInt16, VER(8)),
+ MKLINE(Actor, _talkPosX, sleInt16, VER(8)),
+ MKLINE(Actor, _ignoreTurns, sleByte, VER(8)),
MKLINE(Actor, _layer, sleByte, VER(8)),
- MKLINE(Actor, talkScript, sleUint16, VER(8)),
- MKLINE(Actor, walkScript, sleUint16, VER(8)),
-
- MKLINE(Actor, walkdata.dest.x, sleInt16, VER(8)),
- MKLINE(Actor, walkdata.dest.y, sleInt16, VER(8)),
- MKLINE(Actor, walkdata.destbox, sleByte, VER(8)),
- MKLINE(Actor, walkdata.destdir, sleUint16, VER(8)),
- MKLINE(Actor, walkdata.curbox, sleByte, VER(8)),
- MKLINE(Actor, walkdata.cur.x, sleInt16, VER(8)),
- MKLINE(Actor, walkdata.cur.y, sleInt16, VER(8)),
- MKLINE(Actor, walkdata.next.x, sleInt16, VER(8)),
- MKLINE(Actor, walkdata.next.y, sleInt16, VER(8)),
- MKLINE(Actor, walkdata.deltaXFactor, sleInt32, VER(8)),
- MKLINE(Actor, walkdata.deltaYFactor, sleInt32, VER(8)),
- MKLINE(Actor, walkdata.xfrac, sleUint16, VER(8)),
- MKLINE(Actor, walkdata.yfrac, sleUint16, VER(8)),
-
- MKLINE(Actor, walkdata.point3.x, sleUint16, VER(42)),
- MKLINE(Actor, walkdata.point3.y, sleUint16, VER(42)),
+ MKLINE(Actor, _talkScript, sleUint16, VER(8)),
+ MKLINE(Actor, _walkScript, sleUint16, VER(8)),
+
+ MKLINE(Actor, _walkdata.dest.x, sleInt16, VER(8)),
+ MKLINE(Actor, _walkdata.dest.y, sleInt16, VER(8)),
+ MKLINE(Actor, _walkdata.destbox, sleByte, VER(8)),
+ MKLINE(Actor, _walkdata.destdir, sleUint16, VER(8)),
+ MKLINE(Actor, _walkdata.curbox, sleByte, VER(8)),
+ MKLINE(Actor, _walkdata.cur.x, sleInt16, VER(8)),
+ MKLINE(Actor, _walkdata.cur.y, sleInt16, VER(8)),
+ MKLINE(Actor, _walkdata.next.x, sleInt16, VER(8)),
+ MKLINE(Actor, _walkdata.next.y, sleInt16, VER(8)),
+ MKLINE(Actor, _walkdata.deltaXFactor, sleInt32, VER(8)),
+ MKLINE(Actor, _walkdata.deltaYFactor, sleInt32, VER(8)),
+ MKLINE(Actor, _walkdata.xfrac, sleUint16, VER(8)),
+ MKLINE(Actor, _walkdata.yfrac, sleUint16, VER(8)),
+
+ MKLINE(Actor, _walkdata.point3.x, sleUint16, VER(42)),
+ MKLINE(Actor, _walkdata.point3.y, sleUint16, VER(42)),
- MKARRAY(Actor, cost.active[0], sleByte, 16, VER(8)),
- MKLINE(Actor, cost.stopped, sleUint16, VER(8)),
- MKARRAY(Actor, cost.curpos[0], sleUint16, 16, VER(8)),
- MKARRAY(Actor, cost.start[0], sleUint16, 16, VER(8)),
- MKARRAY(Actor, cost.end[0], sleUint16, 16, VER(8)),
- MKARRAY(Actor, cost.frame[0], sleUint16, 16, VER(8)),
+ MKARRAY(Actor, _cost.active[0], sleByte, 16, VER(8)),
+ MKLINE(Actor, _cost.stopped, sleUint16, VER(8)),
+ MKARRAY(Actor, _cost.curpos[0], sleUint16, 16, VER(8)),
+ MKARRAY(Actor, _cost.start[0], sleUint16, 16, VER(8)),
+ MKARRAY(Actor, _cost.end[0], sleUint16, 16, VER(8)),
+ MKARRAY(Actor, _cost.frame[0], sleUint16, 16, VER(8)),
MKEND()
};
diff --git a/scumm/actor.h b/scumm/actor.h
index 26283d3df4..ed63cc567e 100644
--- a/scumm/actor.h
+++ b/scumm/actor.h
@@ -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);
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index 7dbdc2359b..1e4f0357d7 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -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);
}
}
}
diff --git a/scumm/base-costume.cpp b/scumm/base-costume.cpp
index b6a8fd79eb..e7f13ec1ea 100644
--- a/scumm/base-costume.cpp
+++ b/scumm/base-costume.cpp
@@ -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;
}
diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp
index 7e5926ba57..ab3643b9bb 100644
--- a/scumm/boxes.cpp
+++ b/scumm/boxes.cpp
@@ -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;
}
}
diff --git a/scumm/camera.cpp b/scumm/camera.cpp
index 22e476a251..489740a5b5 100644
--- a/scumm/camera.cpp
+++ b/scumm/camera.cpp
@@ -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);
}
diff --git a/scumm/costume.cpp b/scumm/costume.cpp
index 3e72384832..5dad213ba4 100644
--- a/scumm/costume.cpp
+++ b/scumm/costume.cpp
@@ -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);
}
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index 8d5b0710dd..b033a318eb 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -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;
diff --git a/scumm/imuse_digi/dimuse_track.cpp b/scumm/imuse_digi/dimuse_track.cpp
index dc1c38161f..87072a8fd0 100644
--- a/scumm/imuse_digi/dimuse_track.cpp
+++ b/scumm/imuse_digi/dimuse_track.cpp
@@ -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;
}
}
diff --git a/scumm/insane/insane.cpp b/scumm/insane/insane.cpp
index 5f23226a78..a8a2da98cd 100644
--- a/scumm/insane/insane.cpp
+++ b/scumm/insane/insane.cpp
@@ -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) {
diff --git a/scumm/object.cpp b/scumm/object.cpp
index 0c9232b9a2..c44e9a112a 100644
--- a/scumm/object.cpp
+++ b/scumm/object.cpp
@@ -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;
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index 792c0a44e1..620b094006 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -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
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index a67de44b39..4f27b74f93 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -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);
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index e4eed6b1a3..f2648cf651 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -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;
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 77e9ee3909..d9ff2a583f 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -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;
}
diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp
index 960524fd0a..b7175b9826 100644
--- a/scumm/script_v6he.cpp
+++ b/scumm/script_v6he.cpp
@@ -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
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index d9995b2680..af51631b42 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -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:
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index a857f98113..5a87e80cbe 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -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));
}
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index 0b76bf0f05..910a72201d 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -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)
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index 9d41d20449..209bd21a57 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -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;
}
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index 52e29ccde4..d5bb7f7ef9 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -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);
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 9606704edf..7851906584 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -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) {
diff --git a/scumm/string.cpp b/scumm/string.cpp
index 79fcdadd04..c1748e3669 100644
--- a/scumm/string.cpp
+++ b/scumm/string.cpp
@@ -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);