aboutsummaryrefslogtreecommitdiff
path: root/engines/voyeur/files.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2013-06-01 12:35:50 -0400
committerPaul Gilbert2013-06-01 12:35:50 -0400
commit99f474a3b6471392295f6d1cc33acd6ae4123447 (patch)
treed4d45fe999a1b72abe6ace55b98d69fbe1b3f269 /engines/voyeur/files.cpp
parent8b6d3169cc407ba000dac4d9b4bec5719fce52a4 (diff)
downloadscummvm-rg350-99f474a3b6471392295f6d1cc33acd6ae4123447.tar.gz
scummvm-rg350-99f474a3b6471392295f6d1cc33acd6ae4123447.tar.bz2
scummvm-rg350-99f474a3b6471392295f6d1cc33acd6ae4123447.zip
VOYEUR: Implemented the restoreMCGASaveRect method
Diffstat (limited to 'engines/voyeur/files.cpp')
-rw-r--r--engines/voyeur/files.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp
index aacefd99f3..8522cc77d7 100644
--- a/engines/voyeur/files.cpp
+++ b/engines/voyeur/files.cpp
@@ -614,12 +614,21 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src):
_pages[1] = state._curLibPtr->getPictureResouce(READ_LE_UINT32(src + 0x2C));
state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x30), &_field30);
- state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x34), &_field34);
- state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x38), &_field38);
- state._curLibPtr->resolveIt(READ_LE_UINT32(src + 0x3C), &_field3C);
- for (int i = 0; i < 3; ++i)
- _field40[i] = (int16)READ_LE_UINT16(src + 0x40 + 2 * i);
+ // Get the rect list
+ for (int i = 0; i < 3; ++i) {
+ _rectListCount[i] = (int16)READ_LE_UINT16(src + 0x40 + 2 * i);
+
+ int16 *rectList = (int16 *)state._curLibPtr->memberAddrOffset(READ_LE_UINT32(src + 0x34 + i * 4));
+ _rectListPtr[i] = new Common::Array<Common::Rect>();
+
+ for (int i = 0; i < _rectListCount[0]; ++i) {
+ int xs = FROM_LE_16(rectList[0]);
+ int ys = FROM_LE_16(rectList[1]);
+ _rectListPtr[i]->push_back(Common::Rect(xs, ys, xs + FROM_LE_16(rectList[2]),
+ ys + FROM_LE_16(rectList[3])));
+ }
+ }
xs = READ_LE_UINT16(src + 0x46);
ys = READ_LE_UINT16(src + 0x48);
@@ -637,6 +646,11 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src):
_addFn = &GraphicsManager::addRectNoSaveBack;
}
+ViewPortResource::~ViewPortResource() {
+ for (int i = 0; i < 3; ++i)
+ delete _rectListPtr[i];
+}
+
void ViewPortResource::setupViewPort(PictureResource *page, Common::Rect *clipRect,
ViewPortSetupPtr setupFn, ViewPortAddPtr addFn, ViewPortRestorePtr restoreFn) {
PictureResource *pic = _currentPic;