diff options
-rw-r--r-- | engines/scumm/he/intern_he.h | 8 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/ai_main.h | 4 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/moonbase.cpp | 2 | ||||
-rw-r--r-- | engines/scumm/he/moonbase/moonbase.h | 4 | ||||
-rw-r--r-- | engines/scumm/he/wiz_he.cpp | 8 | ||||
-rw-r--r-- | engines/scumm/scumm.cpp | 14 | ||||
-rw-r--r-- | engines/scumm/scumm.h | 2 | ||||
-rw-r--r-- | engines/scumm/scumm_v2.h | 2 | ||||
-rw-r--r-- | engines/scumm/scumm_v6.h | 2 |
9 files changed, 26 insertions, 20 deletions
diff --git a/engines/scumm/he/intern_he.h b/engines/scumm/he/intern_he.h index 06e6b249f6..023b46d3af 100644 --- a/engines/scumm/he/intern_he.h +++ b/engines/scumm/he/intern_he.h @@ -247,10 +247,6 @@ public: void queueAuxEntry(int actorNum, int subIndex); void remapHEPalette(const uint8 *src, uint8 *dst); - -public: - /* Moonbase stuff */ - Moonbase *_moonbase; }; class ScummEngine_v72he : public ScummEngine_v71he { @@ -430,6 +426,7 @@ protected: class ScummEngine_v90he : public ScummEngine_v80he { friend class LogicHE; + friend class Moonbase; friend class MoviePlayer; friend class Sprite; @@ -458,6 +455,9 @@ protected: Sprite *_sprite; public: + Moonbase *_moonbase; + +public: ScummEngine_v90he(OSystem *syst, const DetectorResult &dr); ~ScummEngine_v90he(); diff --git a/engines/scumm/he/moonbase/ai_main.h b/engines/scumm/he/moonbase/ai_main.h index cfd3aadc8a..1317f62cfb 100644 --- a/engines/scumm/he/moonbase/ai_main.h +++ b/engines/scumm/he/moonbase/ai_main.h @@ -27,9 +27,9 @@ namespace Scumm { -class ScummEngine_v71he; +class ScummEngine_v90he; -extern ScummEngine_v71he *_vm; +extern ScummEngine_v90he *_vm; typedef Common::Array<int>::iterator intVecItr; diff --git a/engines/scumm/he/moonbase/moonbase.cpp b/engines/scumm/he/moonbase/moonbase.cpp index 9cc5040ea6..46d60ecc02 100644 --- a/engines/scumm/he/moonbase/moonbase.cpp +++ b/engines/scumm/he/moonbase/moonbase.cpp @@ -33,7 +33,7 @@ Moonbase::~Moonbase() { } int Moonbase::readFromArray(int array, int y, int x) { - _vm->VAR(116) = array; + _vm->VAR(((ScummEngine_v90he *)_vm)->VAR_U32_ARRAY_UNK) = array; return _vm->readArray(116, y, x); } diff --git a/engines/scumm/he/moonbase/moonbase.h b/engines/scumm/he/moonbase/moonbase.h index 7b2bdeb46b..a056b54051 100644 --- a/engines/scumm/he/moonbase/moonbase.h +++ b/engines/scumm/he/moonbase/moonbase.h @@ -40,6 +40,10 @@ public: uint8 *wizd, int srcx, int srcy, int rawROP, int paramROP); // FOW Stuff + bool isFOW(int resNum, int state, uint32 conditionBits) { + return resNum == _fowSentinelImage && state == _fowSentinelState && conditionBits == _fowSentinelConditionBits; + } + void initFOW(); void releaseFOWResources(); diff --git a/engines/scumm/he/wiz_he.cpp b/engines/scumm/he/wiz_he.cpp index 0976a532de..0ebfe67245 100644 --- a/engines/scumm/he/wiz_he.cpp +++ b/engines/scumm/he/wiz_he.cpp @@ -1573,10 +1573,8 @@ uint8 *Wiz::drawWizImage(int resNum, int state, int maskNum, int maskState, int } if (_vm->_game.id == GID_MOONBASE && - resNum == _vm->_moonbase->_fowSentinelImage && - state == _vm->_moonbase->_fowSentinelState && - conditionBits == _vm->_moonbase->_fowSentinelConditionBits) { - _vm->_moonbase->renderFOW(dst, dstPitch, dstType, cw, ch, flags); + ((ScummEngine_v90he *)_vm)->_moonbase->isFOW(resNum, state, conditionBits)) { + ((ScummEngine_v90he *)_vm)->_moonbase->renderFOW(dst, dstPitch, dstType, cw, ch, flags); x1 = 0; y1 = 0; width = rScreen.width(); @@ -1816,7 +1814,7 @@ void Wiz::copy555WizImage(uint8 *dst, uint8 *wizd, int dstPitch, int dstType, uint32 compID = READ_LE_UINT32(wizd); if (compID == 0x12340102) { - _vm->_moonbase->blitT14WizImage(dst, dstw, dsth, dstPitch, clipBox, wizd, srcx, srcy, rawROP, paramROP); + ((ScummEngine_v90he *)_vm)->_moonbase->blitT14WizImage(dst, dstw, dsth, dstPitch, clipBox, wizd, srcx, srcy, rawROP, paramROP); } else if (compID == 0x12340802) { warning("Distorion codec"); } else if (compID == 0x12340902) { diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 1f8a85b8c3..cfb0c70c4a 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -833,16 +833,9 @@ ScummEngine_v71he::ScummEngine_v71he(OSystem *syst, const DetectorResult &dr) _skipProcessActors = 0; VAR_WIZ_TCOLOR = 0xFF; - - /* Moonbase stuff */ - _moonbase = 0; - - if (_game.id == GID_MOONBASE) - _moonbase = new Moonbase(this); } ScummEngine_v71he::~ScummEngine_v71he() { - delete _moonbase; delete _wiz; } @@ -892,6 +885,12 @@ ScummEngine_v90he::ScummEngine_v90he(OSystem *syst, const DetectorResult &dr) VAR_U32_VERSION = 0xFF; VAR_U32_ARRAY_UNK = 0xFF; + + /* Moonbase stuff */ + _moonbase = 0; + + if (_game.id == GID_MOONBASE) + _moonbase = new Moonbase(this); } ScummEngine_v90he::~ScummEngine_v90he() { @@ -903,6 +902,7 @@ ScummEngine_v90he::~ScummEngine_v90he() { if (_game.heversion >= 99) { free(_hePalettes); } + delete _moonbase; } ScummEngine_vCUPhe::ScummEngine_vCUPhe(OSystem *syst, const DetectorResult &dr) : Engine(syst){ diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h index 62386d3346..e519fd9592 100644 --- a/engines/scumm/scumm.h +++ b/engines/scumm/scumm.h @@ -701,9 +701,11 @@ protected: void ignoreScriptByte() { fetchScriptByte(); } void push(int a); int pop(); +public: // TODO. FIXME virtual int readVar(uint var); virtual void writeVar(uint var, int value); +protected: void beginCutscene(int *args); void endCutscene(); void abortCutscene(); diff --git a/engines/scumm/scumm_v2.h b/engines/scumm/scumm_v2.h index e438008c1e..339964b0a4 100644 --- a/engines/scumm/scumm_v2.h +++ b/engines/scumm/scumm_v2.h @@ -77,9 +77,11 @@ protected: void getResultPosIndirect(); virtual void getResultPos(); +public: // TODO. FIXME virtual int readVar(uint var); virtual void writeVar(uint var, int value); +protected: virtual int getActiveObject(); void ifStateCommon(byte type); void ifNotStateCommon(byte type); diff --git a/engines/scumm/scumm_v6.h b/engines/scumm/scumm_v6.h index a17bb8f891..83b9f2f4f8 100644 --- a/engines/scumm/scumm_v6.h +++ b/engines/scumm/scumm_v6.h @@ -119,7 +119,7 @@ protected: ArrayHeader *getArray(int array); byte *defineArray(int array, int type, int dim2, int dim1); int findFreeArrayId(); -public: +public: // FIXME. TODO void nukeArray(int array); protected: |