diff options
author | Paul Gilbert | 2013-06-01 13:01:09 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-06-01 13:01:09 -0400 |
commit | b85aa4f8d92ecb1d66052837b0128786b52e3ee1 (patch) | |
tree | b776c910134e1a45685d4e50767e8121a06a6dc9 /engines | |
parent | 99f474a3b6471392295f6d1cc33acd6ae4123447 (diff) | |
download | scummvm-rg350-b85aa4f8d92ecb1d66052837b0128786b52e3ee1.tar.gz scummvm-rg350-b85aa4f8d92ecb1d66052837b0128786b52e3ee1.tar.bz2 scummvm-rg350-b85aa4f8d92ecb1d66052837b0128786b52e3ee1.zip |
VOYEUR: Implemented the restoreBack method
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/files.h | 5 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 18 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 2 |
3 files changed, 21 insertions, 4 deletions
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 32c203eec8..da3d277f73 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -232,8 +232,13 @@ public: PictureResource *_activePage; PictureResource *_pages[2]; byte *_field30; + + // Rect lists and counts. Note that _rectListCount values of '-1' seem to have + // special significance, which is why I'm not making them redundant in favour + // of the arrays' .size() method Common::Array<Common::Rect> *_rectListPtr[3]; int _rectListCount[3]; + Common::Rect _clipRect; byte *_field7A; GraphicMethodPtr _fn1; diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 3acf2a35f5..eaa7dfa621 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -83,7 +83,7 @@ void GraphicsManager::setupMCGASaveRect(ViewPortResource *viewPort) { Common::Rect *clipRect = _clipPtr; _clipPtr = &viewPort->_clipRect; - sDrawPic(viewPort->_activePage, viewPort->_currentPic, Common::Point(), NULL); + sDrawPic(viewPort->_activePage, viewPort->_currentPic, Common::Point()); _clipPtr = clipRect; } @@ -120,7 +120,7 @@ void GraphicsManager::addRectNoSaveBack(ViewPortResource *viewPort, int idx, con } void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, - const Common::Point &offset, void *v3) { + const Common::Point &offset) { int var4C = 0; int width1, width2; int widthDiff, widthDiff2; @@ -339,7 +339,19 @@ void GraphicsManager::flipPage() { void GraphicsManager::restoreBack(Common::Array<Common::Rect> &rectList, int rectListCount, PictureResource *srcPic, PictureResource *destPic) { - //TODO + bool saveBack = _saveBack; + _saveBack = false; + + if (rectListCount == -1) { + sDrawPic(srcPic, destPic, Common::Point()); + } else { + for (int i = rectListCount; i >= 0; --i) { + _clipPtr = &rectList[i]; + sDrawPic(srcPic, destPic, Common::Point()); + } + } + + _saveBack = saveBack; } } // End of namespace Voyeur diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 263d44eb65..7bb25d33df 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -87,7 +87,7 @@ public: void addRectNoSaveBack(ViewPortResource *viewPort, int idx, const Common::Rect &bounds); void EMSMapPageHandle(int v1, int v2, int v3); - void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &offset, void *v3); + void sDrawPic(DisplayResource *srcDisplay, DisplayResource *destDisplay, const Common::Point &offset); void sDisplayPic(PictureResource *pic); void flipPage(); }; |