aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--scumm/actor.cpp32
-rw-r--r--scumm/akos.cpp3
-rw-r--r--scumm/intern.h11
-rw-r--r--scumm/script_v7he.cpp2
-rw-r--r--scumm/scumm.cpp12
-rw-r--r--scumm/scumm.h16
6 files changed, 35 insertions, 41 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index a9e49addd9..a48d6429a1 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -147,11 +147,7 @@ void Actor::initActor(int mode) {
_clipOverride = _vm->_actorClipOverride;
- _auxBlock.visible = false;
- _auxBlock.r.left = 0;
- _auxBlock.r.top = 0;
- _auxBlock.r.right = -1;
- _auxBlock.r.bottom = -1;
+ _auxBlock.reset();
_hePaletteNum = 0;
_vm->_classData[_number] = (_vm->_version >= 7) ? _vm->_classData[0] : 0;
@@ -506,11 +502,7 @@ void Actor::startAnimActor(int f) {
// Causes Zak to lose his body in several scenes, see bug #771508
if (_vm->_version >= 3 && f == _initFrame) {
_cost.reset();
- _auxBlock.visible = false;
- _auxBlock.r.left = 0;
- _auxBlock.r.top = 0;
- _auxBlock.r.right = -1;
- _auxBlock.r.bottom = -1;
+ _auxBlock.reset();
}
_vm->_costumeLoader->costumeDecodeData(this, f, (uint) - 1);
_frame = f;
@@ -639,7 +631,7 @@ void Actor::putActor(int dstX, int dstY, byte newRoom) {
adjustActorPos();
} else {
if (_vm->_heversion >= 71)
- _vm->queueAuxBlock(this);
+ ((ScummEngine_v71he *)_vm)->queueAuxBlock(this);
hideActor();
}
} else {
@@ -801,11 +793,7 @@ void Actor::hideActor() {
_cost.soundCounter = 0;
_needRedraw = false;
_needBgReset = true;
- _auxBlock.visible = false;
- _auxBlock.r.left = 0;
- _auxBlock.r.top = 0;
- _auxBlock.r.right = -1;
- _auxBlock.r.bottom = -1;
+ _auxBlock.reset();
}
void Actor::showActor() {
@@ -1443,15 +1431,11 @@ void Actor::setActorCostume(int c) {
memset(_animVariable, 0, sizeof(_animVariable));
if (_vm->_heversion >= 71)
- _vm->queueAuxBlock(this);
+ ((ScummEngine_v71he *)_vm)->queueAuxBlock(this);
_costume = c;
_cost.reset();
- _auxBlock.visible = false;
- _auxBlock.r.left = 0;
- _auxBlock.r.top = 0;
- _auxBlock.r.right = -1;
- _auxBlock.r.bottom = -1;
+ _auxBlock.reset();
if (_visible) {
if (_costume) {
@@ -2058,7 +2042,7 @@ void ScummEngine_v71he::postProcessAuxQueue() {
}
#endif
-void ScummEngine::queueAuxBlock(Actor *a) {
+void ScummEngine_v71he::queueAuxBlock(Actor *a) {
if (!a->_auxBlock.visible)
return;
@@ -2067,7 +2051,7 @@ void ScummEngine::queueAuxBlock(Actor *a) {
++_auxBlocksNum;
}
-void ScummEngine::queueAuxEntry(int actorNum, int subIndex) {
+void ScummEngine_v71he::queueAuxEntry(int actorNum, int subIndex) {
assert(_auxEntriesNum < ARRAYSIZE(_auxEntries));
AuxEntry *ae = &_auxEntries[_auxEntriesNum];
ae->actorNum = actorNum;
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index d09b5de4f2..8b4a5ed56e 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -1728,7 +1728,8 @@ void ScummEngine::akos_processQueue() {
a->_offsY = param_2;
break;
case 7:
- queueAuxEntry(a->_number, param_1);
+ assert(_heversion >= 71);
+ ((ScummEngine_v71he *)this)->queueAuxEntry(a->_number, param_1);
break;
case 8:
_actorToPrintStrFor = a->_number;
diff --git a/scumm/intern.h b/scumm/intern.h
index e8becf5f3f..1f2e372ea9 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -795,7 +795,7 @@ protected:
class ScummEngine_v71he : public ScummEngine_v70he {
public:
- ScummEngine_v71he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]) : ScummEngine_v70he(detector, syst, gs, md5sum) {}
+ ScummEngine_v71he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
protected:
virtual void redrawBGAreas();
@@ -804,6 +804,15 @@ protected:
void preProcessAuxQueue();
void postProcessAuxQueue();
+public:
+ /* Actor AuxQueue stuff (HE) */
+ AuxBlock _auxBlocks[16];
+ uint16 _auxBlocksNum;
+ AuxEntry _auxEntries[16];
+ uint16 _auxEntriesNum;
+
+ void queueAuxBlock(Actor *a);
+ void queueAuxEntry(int actorNum, int subIndex);
};
class ScummEngine_v72he : public ScummEngine_v71he {
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index 5cf9ff5337..36ad8cb0c6 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -781,7 +781,7 @@ void ScummEngine_v70he::o70_kernelSetFunctions() {
break;
case 20: // HE72+
a = derefActor(args[1], "o70_kernelSetFunctions: 20");
- queueAuxBlock(a);
+ ((ScummEngine_v71he *)this)->queueAuxBlock(a);
break;
case 21:
_skipDrawObject = 1;
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 2b565043a1..9147c7ba96 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -950,10 +950,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_actorClipOverride.right = 640;
_skipDrawObject = 0;
- _auxBlocksNum = 0;
- memset(_auxBlocks, 0, sizeof(_auxBlocks));
- _auxEntriesNum = 0;
- memset(_auxEntries, 0, sizeof(_auxEntries));
memset(_timers, 0, sizeof(_timers));
memset(_akosQueue, 0, sizeof(_akosQueue));
@@ -1316,6 +1312,14 @@ ScummEngine_v70he::~ScummEngine_v70he() {
free(_heV7RoomOffsets);
}
+ScummEngine_v71he::ScummEngine_v71he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16])
+ : ScummEngine_v70he(detector, syst, gs, md5sum) {
+ _auxBlocksNum = 0;
+ memset(_auxBlocks, 0, sizeof(_auxBlocks));
+ _auxEntriesNum = 0;
+ memset(_auxEntries, 0, sizeof(_auxEntries));
+}
+
ScummEngine_v72he::ScummEngine_v72he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16])
: ScummEngine_v71he(detector, syst, gs, md5sum) {
VAR_NUM_ROOMS = 0xFF;
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 490429ac74..2346eb1a12 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -310,6 +310,12 @@ struct LangIndexNode {
struct AuxBlock {
bool visible;
Common::Rect r;
+
+ void reset() {
+ visible = false;
+ r.left = r.top = 0;
+ r.right = r.bottom = -1;
+ }
};
struct AuxEntry {
@@ -851,16 +857,6 @@ protected:
virtual void processActors();
void processUpperActors();
int getActorFromPos(int x, int y);
-
-public:
- /* Actor AuxQueue stuff (HE) */
- AuxBlock _auxBlocks[16];
- uint16 _auxBlocksNum;
- AuxEntry _auxEntries[16];
- uint16 _auxEntriesNum;
-
- void queueAuxBlock(Actor *a);
- void queueAuxEntry(int actorNum, int subIndex);
public:
/* Actor talking stuff */