diff options
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/actor.cpp | 14 | ||||
-rw-r--r-- | scumm/actor.h | 4 | ||||
-rw-r--r-- | scumm/akos.cpp | 32 | ||||
-rw-r--r-- | scumm/script_v6he.cpp | 8 | ||||
-rw-r--r-- | scumm/script_v72he.cpp | 10 | ||||
-rw-r--r-- | scumm/scumm.cpp | 14 | ||||
-rw-r--r-- | scumm/scumm.h | 24 |
7 files changed, 56 insertions, 50 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 230180be93..7029a02802 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1846,7 +1846,7 @@ void Actor::setUserCondition(int slot, int set) { } } -bool Actor::isUserConditionSet(int slot) { +bool Actor::isUserConditionSet(int slot) const { assert(slot >= 1 && slot <= 0x20); return (condMask & (1 << (slot + 0xF))) != 0; } @@ -1865,7 +1865,7 @@ void Actor::setTalkCondition(int slot) { } } -bool Actor::isTalkConditionSet(int slot) { +bool Actor::isTalkConditionSet(int slot) const { assert(slot >= 1 && slot <= 0x10); return (condMask & (1 << (slot - 1))) != 0; } @@ -1874,8 +1874,8 @@ void ScummEngine::preProcessAuxQueue() { if (!_skipProcessActors) { for (int i = 0; i < _auxBlocksNum; ++i) { AuxBlock *ab = &_auxBlocks[i]; - assert(ab->r.top <= ab->r.bottom); if (ab->visible) { + assert(ab->r.top <= ab->r.bottom); gdi.copyVirtScreenBuffers(ab->r); } } @@ -1897,6 +1897,14 @@ void ScummEngine::postProcessAuxQueue() { assert(akax); const uint8 *auxd = findPalInPals(akax, ae->subIndex) - _resourceHeaderSize; assert(auxd); + const uint8 *frel = findResourceData(MKID('FREL'), auxd); + if (frel) { + warning("unhandled FREL block"); + } + const uint8 *disp = findResourceData(MKID('DISP'), auxd); + if (disp) { + warning("unhandled DISP block"); + } const uint8 *axfd = findResourceData(MKID('AXFD'), auxd); assert(axfd); diff --git a/scumm/actor.h b/scumm/actor.h index 918acd5361..e06af5a118 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -247,10 +247,10 @@ public: void classChanged(int cls, bool value); void setUserCondition(int slot, int set); - bool isUserConditionSet(int slot); + bool isUserConditionSet(int slot) const; void setTalkCondition(int slot); - bool isTalkConditionSet(int slot); + bool isTalkConditionSet(int slot) const; // Used by the save/load syste: static const SaveLoadEntry *getSaveLoadEntries(); diff --git a/scumm/akos.cpp b/scumm/akos.cpp index f98f4892be..2153fe14c3 100644 --- a/scumm/akos.cpp +++ b/scumm/akos.cpp @@ -1617,25 +1617,25 @@ bool ScummEngine::akos_increaseAnim(Actor *a, int chan, const byte *aksq, const } void ScummEngine::akos_queCommand(byte cmd, Actor *a, int param_1, int param_2) { - checkRange(32, 0, _queuePos, "akos_queCommand overflow"); + checkRange(32, 0, _akosQueuePos, "akos_queCommand overflow"); - _queuePos++; - _queueCmd[_queuePos] = cmd; - _queueActor[_queuePos] = a->number; - _queueParam1[_queuePos] = param_1; - _queueParam2[_queuePos] = param_2; + _akosQueuePos++; + _akosQueue[_akosQueuePos].cmd = cmd; + _akosQueue[_akosQueuePos].actor = a->number; + _akosQueue[_akosQueuePos].param1 = param_1; + _akosQueue[_akosQueuePos].param2 = param_2; } void ScummEngine::akos_processQueue() { byte cmd; int actor, param_1, param_2; - while (_queuePos) { - cmd = _queueCmd[_queuePos]; - actor = _queueActor[_queuePos]; - param_1 = _queueParam1[_queuePos]; - param_2 = _queueParam2[_queuePos]; - _queuePos--; + while (_akosQueuePos) { + cmd = _akosQueue[_akosQueuePos].cmd; + actor = _akosQueue[_akosQueuePos].actor; + param_1 = _akosQueue[_akosQueuePos].param1; + param_2 = _akosQueue[_akosQueuePos].param2; + _akosQueuePos--; Actor *a = derefActor(actor, "akos_processQueue"); @@ -1678,12 +1678,12 @@ void ScummEngine::akos_processQueue() { if (_heversion >= 71) { _actorToPrintStrFor = a->number; - a->talkPosX = _queueTalkPosX[param_1]; - a->talkPosY = _queueTalkPosY[param_1]; - a->talkColor = _queueTalkColor[param_1]; + a->talkPosX = _talkQueue[param_1].posX; + a->talkPosY = _talkQueue[param_1].posY; + a->talkColor = _talkQueue[param_1].color; _string[0].loadDefault(); - actorTalk(_queueTalkString[param_1]); + actorTalk(_talkQueue[param_1].sentence); } else if (param_1 != 0) { if (_imuseDigital) { diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp index c4bc56b399..c4b1a12402 100644 --- a/scumm/script_v6he.cpp +++ b/scumm/script_v6he.cpp @@ -737,11 +737,11 @@ void ScummEngine_v60he::o60_actorOps() { int slot = pop(); int len = resStrLen(string) + 1; - addMessageToStack(string, _queueTalkString[slot], len); + addMessageToStack(string, _talkQueue[slot].sentence, len); - _queueTalkPosX[slot] = a->talkPosX; - _queueTalkPosY[slot] = a->talkPosY; - _queueTalkColor[slot] = a->talkColor; + _talkQueue[slot].posX = a->talkPosX; + _talkQueue[slot].posY = a->talkPosY; + _talkQueue[slot].color = a->talkColor; break; } default: diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp index 24ca02e5d0..e5ea4f1296 100644 --- a/scumm/script_v72he.cpp +++ b/scumm/script_v72he.cpp @@ -914,7 +914,7 @@ void ScummEngine_v72he::o72_actorOps() { return; } - a = derefActorSafe(_curActor, "o60_actorOps"); + a = derefActorSafe(_curActor, "o72_actorOps"); if (!a) return; @@ -1092,11 +1092,11 @@ void ScummEngine_v72he::o72_actorOps() { int slot = pop(); int len = resStrLen(string) + 1; - addMessageToStack(string, _queueTalkString[slot], len); + addMessageToStack(string, _talkQueue[slot].sentence, len); - _queueTalkPosX[slot] = a->talkPosX; - _queueTalkPosY[slot] = a->talkPosY; - _queueTalkColor[slot] = a->talkColor; + _talkQueue[slot].posX = a->talkPosX; + _talkQueue[slot].posY = a->talkPosY; + _talkQueue[slot].color = a->talkColor; break; } default: diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index b715a50342..36aa58eb60 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -703,16 +703,10 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _wizState = 0; _wizFlag = 0; - memset(_queueCmd, 0, sizeof(_queueCmd)); - memset(_queueActor, 0, sizeof(_queueActor)); - memset(_queueParam1, 0, sizeof(_queueParam1)); - memset(_queueParam2, 0, sizeof(_queueParam2)); - _queuePos = 0; - - memset(_queueTalkPosX, 0, sizeof(_queueTalkPosX)); - memset(_queueTalkPosY, 0, sizeof(_queueTalkPosY)); - memset(_queueTalkColor, 0, sizeof(_queueTalkColor)); - memset(_queueTalkString, 0, sizeof(_queueTalkString)); + memset(_akosQueue, 0, sizeof(_akosQueue)); + _akosQueuePos = 0; + + memset(_talkQueue, 0, sizeof(_talkQueue)); // // Init all VARS to 0xFF diff --git a/scumm/scumm.h b/scumm/scumm.h index 7463deb914..a5f69b285a 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -872,16 +872,20 @@ public: int cost_frameToAnim(Actor *a, int frame); // Akos Class - int16 _queueCmd[32]; - int16 _queueActor[32]; - int16 _queueParam1[32]; - int16 _queueParam2[32]; - int16 _queuePos; - - int16 _queueTalkPosX[16]; - int16 _queueTalkPosY[16]; - int16 _queueTalkColor[16]; - byte _queueTalkString[16][128]; + struct { + int16 cmd; + int16 actor; + int16 param1; + int16 param2; + } _akosQueue[32]; + int16 _akosQueuePos; + + struct { + int16 posX; + int16 posY; + int16 color; + byte sentence[128]; + } _talkQueue[16]; Common::Rect _actorClipOverride; |