aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur
diff options
context:
space:
mode:
authorPaul Gilbert2013-06-01 13:01:09 -0400
committerPaul Gilbert2013-06-01 13:01:09 -0400
commitb85aa4f8d92ecb1d66052837b0128786b52e3ee1 (patch)
treeb776c910134e1a45685d4e50767e8121a06a6dc9 /engines/voyeur
parent99f474a3b6471392295f6d1cc33acd6ae4123447 (diff)
downloadscummvm-rg350-b85aa4f8d92ecb1d66052837b0128786b52e3ee1.tar.gz
scummvm-rg350-b85aa4f8d92ecb1d66052837b0128786b52e3ee1.tar.bz2
scummvm-rg350-b85aa4f8d92ecb1d66052837b0128786b52e3ee1.zip
VOYEUR: Implemented the restoreBack method
Diffstat (limited to 'engines/voyeur')
-rw-r--r--engines/voyeur/files.h5
-rw-r--r--engines/voyeur/graphics.cpp18
-rw-r--r--engines/voyeur/graphics.h2
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();
};