diff options
author | Max Horn | 2005-04-28 00:45:06 +0000 |
---|---|---|
committer | Max Horn | 2005-04-28 00:45:06 +0000 |
commit | 5109e82c35c027c5ab695e54666476b04734c786 (patch) | |
tree | 59eda6e60e7098a5e6104ee3f9056cdf22161151 | |
parent | 3ee1fe9b579dc3e822d3e1103addc2d6516fe06a (diff) | |
download | scummvm-rg350-5109e82c35c027c5ab695e54666476b04734c786.tar.gz scummvm-rg350-5109e82c35c027c5ab695e54666476b04734c786.tar.bz2 scummvm-rg350-5109e82c35c027c5ab695e54666476b04734c786.zip |
Refactor HE actor post/pre-processing code a bit (some more cleanup for HE90 could probably be done, but I'll leave that to the HE folks for now :-)
svn-id: r17847
-rw-r--r-- | scumm/actor.cpp | 32 | ||||
-rw-r--r-- | scumm/intern.h | 7 | ||||
-rw-r--r-- | scumm/scumm.cpp | 18 | ||||
-rw-r--r-- | scumm/scumm.h | 6 |
4 files changed, 38 insertions, 25 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 291b8697ea..7f797e9309 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -27,6 +27,7 @@ #include "scumm/boxes.h" #include "scumm/charset.h" #include "scumm/costume.h" +#include "scumm/intern.h" #include "scumm/object.h" #include "scumm/resource.h" #include "scumm/saveload.h" @@ -976,9 +977,6 @@ static int compareDrawOrder(const void* a, const void* b) } void ScummEngine::processActors() { - if (_skipProcessActors) - return; - int numactors = 0; // TODO : put this actors as a member array. It never has to grow or shrink @@ -1018,6 +1016,30 @@ void ScummEngine::processActors() { akos_processQueue(); } +void ScummEngine_v70he::processActors() { + // TODO: The HE 90 stuff should be moved to a new method, too, + // if possible (ScummEngine_v90he::processActors). + if (_heversion >= 71) { + preProcessAuxQueue(); + } + if (_heversion >= 90) { + ((ScummEngine_v90he *)this)->spritesMarkDirty(0); + ((ScummEngine_v90he *)this)->spritesProcessWiz(true); + } + + if (!_skipProcessActors) + ScummEngine::processActors(); + + if (_heversion >= 71) { + postProcessAuxQueue(); + } + if (_heversion >= 90) { + ((ScummEngine_v90he *)this)->spritesMarkDirty(1); + ((ScummEngine_v90he *)this)->spritesProcessWiz(false); + } +} + + // Used in Scumm v8, to allow the verb coin to be drawn over the inventory // chest. I'm assuming that draw order won't matter here. void ScummEngine::processUpperActors() { @@ -1943,7 +1965,7 @@ bool Actor::isTalkConditionSet(int slot) const { return (_heCondMask & (1 << (slot - 1))) != 0; } -void ScummEngine::preProcessAuxQueue() { +void ScummEngine_v70he::preProcessAuxQueue() { if (!_skipProcessActors) { for (int i = 0; i < _auxBlocksNum; ++i) { AuxBlock *ab = &_auxBlocks[i]; @@ -1956,7 +1978,7 @@ void ScummEngine::preProcessAuxQueue() { _auxBlocksNum = 0; } -void ScummEngine::postProcessAuxQueue() { +void ScummEngine_v70he::postProcessAuxQueue() { if (!_skipProcessActors) { for (int i = 0; i < _auxEntriesNum; ++i) { AuxEntry *ae = &_auxEntries[i]; diff --git a/scumm/intern.h b/scumm/intern.h index a07fb65dbe..224c571524 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -694,6 +694,9 @@ protected: byte *_heV7RoomOffsets; int32 _heSndSoundId, _heSndOffset, _heSndChannel, _heSndFlags, _heSndSoundFreq; + + bool _skipProcessActors; + public: ScummEngine_v70he(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]); ~ScummEngine_v70he(); @@ -716,6 +719,10 @@ protected: virtual void redrawBGAreas(); + virtual void processActors(); + void preProcessAuxQueue(); + void postProcessAuxQueue(); + int getStringCharWidth(byte chr); virtual int setupStringArray(int size); void appendSubstring(int dst, int src, int len2, int len); diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp index ac1ead9617..29b199b772 100644 --- a/scumm/scumm.cpp +++ b/scumm/scumm.cpp @@ -918,7 +918,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS _actorClipOverride.right = 640; _skipDrawObject = 0; - _skipProcessActors = 0; _auxBlocksNum = 0; memset(_auxBlocks, 0, sizeof(_auxBlocks)); _auxEntriesNum = 0; @@ -1269,6 +1268,8 @@ ScummEngine_v70he::ScummEngine_v70he(GameDetector *detector, OSystem *syst, cons _heSndFlags = 0; _heSndSoundFreq = 0; + _skipProcessActors = 0; + VAR_NUM_SOUND_CHANNELS = 0xFF; } @@ -2120,26 +2121,11 @@ load_game: drawFlashlight(); setActorRedrawFlags(); } - if (_heversion >= 71) { - preProcessAuxQueue(); - } - if (_heversion >= 90) { - ((ScummEngine_v90he *)this)->spritesMarkDirty(0); - ((ScummEngine_v90he *)this)->spritesProcessWiz(true); - } processActors(); _fullRedraw = false; - if (_heversion >= 71) { - postProcessAuxQueue(); - } - if (_heversion >= 90) { - ((ScummEngine_v90he *)this)->spritesMarkDirty(1); - ((ScummEngine_v90he *)this)->spritesProcessWiz(false); - } - if (_version >= 4 && _heversion <= 61) cyclePalette(); palManipulate(); diff --git a/scumm/scumm.h b/scumm/scumm.h index ce963d25c1..af68c69698 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -825,7 +825,7 @@ protected: void showActors(); void setupV1ActorTalkColor(); void resetActorBgs(); - void processActors(); + virtual void processActors(); void processUpperActors(); int getActorFromPos(int x, int y); @@ -836,8 +836,6 @@ public: AuxEntry _auxEntries[16]; uint16 _auxEntriesNum; - void preProcessAuxQueue(); - void postProcessAuxQueue(); void queueAuxBlock(Actor *a); void queueAuxEntry(int actorNum, int subIndex); @@ -1068,7 +1066,7 @@ public: byte _HEV7ActorPalette[256]; byte _roomPalette[256]; byte *_shadowPalette; - bool _skipDrawObject, _skipProcessActors; + bool _skipDrawObject; int _timers[4]; int _voiceMode; |