diff options
-rw-r--r-- | engines/voyeur/events.cpp | 22 | ||||
-rw-r--r-- | engines/voyeur/events.h | 2 | ||||
-rw-r--r-- | engines/voyeur/files.cpp | 4 | ||||
-rw-r--r-- | engines/voyeur/files.h | 2 | ||||
-rw-r--r-- | engines/voyeur/game.cpp | 4 | ||||
-rw-r--r-- | engines/voyeur/game.h | 3 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 16 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 1 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 4 | ||||
-rw-r--r-- | engines/voyeur/voyeur.h | 1 |
10 files changed, 43 insertions, 16 deletions
diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index f84c97879a..c7ec6b99a7 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -49,4 +49,26 @@ void EventsManager::vStopCycle() { _cycleStatus &= 2; } +void EventsManager::sWaitFlip() { + // TODO: See if this needs a proper wait loop with event polling + //while (_intPtr._field39) ; + + Common::Array<ViewPortResource *> &viewPorts = *_vm->_graphicsManager._viewPortListPtr; + for (uint idx = 0; idx < viewPorts.size(); ++idx) { + ViewPortResource &viewPort = *viewPorts[idx]; + + if (_vm->_graphicsManager._saveBack && (viewPort._flags & 0x40)) { + Common::Rect *clipPtr = _vm->_graphicsManager._clipPtr; + _vm->_graphicsManager._clipPtr = &viewPort._clipRect; + + if (viewPort._restoreFn) + (_vm->_graphicsManager.*viewPort._restoreFn)(&viewPort); + + _vm->_graphicsManager._clipPtr = clipPtr; + viewPort._field40[viewPort._pageIndex] = 0; + viewPort._flags &= 0xFFBF; + } + } +} + } // End of namespace Voyeur diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h index a3696a9568..98e491a56a 100644 --- a/engines/voyeur/events.h +++ b/engines/voyeur/events.h @@ -36,6 +36,7 @@ private: static void mainVoyeurIntFunc(); public: + IntData _intPtr; IntNode _fadeIntNode; IntNode _cycleIntNode; IntNode _evintnode; @@ -48,6 +49,7 @@ public: void resetMouse(); void startMainClockInt(); void vStopCycle(); + void sWaitFlip(); }; } // End of namespace Voyeur diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 05617a04cc..aacefd99f3 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -618,7 +618,9 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src): state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x38), &_field38); state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x3C), &_field3C); - _field42 = (int16)READ_LE_UINT16(src + 0x42); + for (int i = 0; i < 3; ++i) + _field40[i] = (int16)READ_LE_UINT16(src + 0x40 + 2 * i); + xs = READ_LE_UINT16(src + 0x46); ys = READ_LE_UINT16(src + 0x48); _clipRect = Common::Rect(xs, ys, xs + READ_LE_UINT16(src + 0x4A), diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 8e00731b78..ccbea8a209 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -235,7 +235,7 @@ public: byte *_field34; byte *_field38; byte *_field3C; - int16 _field42; + int16 _field40[3]; Common::Rect _clipRect; byte *_field7A; GraphicMethodPtr _fn1; diff --git a/engines/voyeur/game.cpp b/engines/voyeur/game.cpp index 26e5d3113b..e38863a1e4 100644 --- a/engines/voyeur/game.cpp +++ b/engines/voyeur/game.cpp @@ -24,6 +24,10 @@ namespace Voyeur { +IntData::IntData() { + _field9 = false; +} + void IntData::audioInit() { } diff --git a/engines/voyeur/game.h b/engines/voyeur/game.h index 99f97fd9d1..35fffbe649 100644 --- a/engines/voyeur/game.h +++ b/engines/voyeur/game.h @@ -111,9 +111,12 @@ public: class IntData { public: + bool _field9; byte *_colors; Common::List<IntNode *> _intNodes; public: + IntData(); + void audioInit(); void addIntNode(IntNode *node); diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 0b47e935fb..b0487a0e8b 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -53,7 +53,7 @@ void GraphicsManager::addFadeInt() { node._curTime = 0; node._timeReset = 1; - _vm->_intPtr.addIntNode(&node); + _vm->_eventsManager._intPtr.addIntNode(&node); } void GraphicsManager::vInitColor() { @@ -63,15 +63,15 @@ void GraphicsManager::vInitColor() { } void GraphicsManager::fadeIntFunc() { - + // TODO: more } void GraphicsManager::vDoFadeInt() { - + // TODO: more } void GraphicsManager::vDoCycleInt() { - + // TODO: more } void GraphicsManager::setupMCGASaveRect(ViewPortResource *viewPort) { @@ -87,7 +87,7 @@ void GraphicsManager::setupMCGASaveRect(ViewPortResource *viewPort) { _clipPtr = clipRect; } - viewPort->_field42 = -1; + viewPort->_field40[1] = -1; } void GraphicsManager::addRectOptSaveRect(ViewPortResource *viewPort, int y, Common::Rect *bounds) { @@ -99,7 +99,7 @@ void GraphicsManager::restoreMCGASaveRect(ViewPortResource *viewPort) { } void GraphicsManager::addRectNoSaveBack(ViewPortResource *viewPort, int y, Common::Rect *bounds) { - + // TODO: more } void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, @@ -313,8 +313,4 @@ void GraphicsManager::flipPage() { } } -void GraphicsManager::sWaitFlip() { - -} - } // End of namespace Voyeur diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 1c86952f33..c34c2b44d3 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -87,7 +87,6 @@ public: void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &offset, void *v3); void sDisplayPic(PictureResource *pic); void flipPage(); - void sWaitFlip(); }; } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index 27bf8585c9..1ff1bdea22 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -131,7 +131,7 @@ void VoyeurEngine::initBolt() { } void VoyeurEngine::vInitInterrupts() { - _intPtr._colors = &_graphicsManager._VGAColors[0]; + _eventsManager._intPtr._colors = &_graphicsManager._VGAColors[0]; } void VoyeurEngine::initInput() { @@ -147,7 +147,7 @@ void VoyeurEngine::doHeadTitle() { (*_graphicsManager._vPort)->_flags |= 8; _graphicsManager.flipPage(); - _graphicsManager.sWaitFlip(); + _eventsManager.sWaitFlip(); // TODO: } diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index d8fb4ad711..818615faaa 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -79,7 +79,6 @@ protected: virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; public: - IntData _intPtr; EventsManager _eventsManager; FilesManager _filesManager; GraphicsManager _graphicsManager; |