diff options
author | Paul Gilbert | 2013-05-30 08:31:06 -0400 |
---|---|---|
committer | Paul Gilbert | 2013-05-30 08:31:06 -0400 |
commit | 8e1325e5384171b23f0951e7874487ff94389be5 (patch) | |
tree | 643cecfe81dcf984365fa4ed1894b943aa329ac2 | |
parent | 04794adf5cd9ac330aa82e6af6abe1390fca6cb7 (diff) | |
download | scummvm-rg350-8e1325e5384171b23f0951e7874487ff94389be5.tar.gz scummvm-rg350-8e1325e5384171b23f0951e7874487ff94389be5.tar.bz2 scummvm-rg350-8e1325e5384171b23f0951e7874487ff94389be5.zip |
VOYEUR: Implemented the setupMCGASaveRect method
-rw-r--r-- | engines/voyeur/files.cpp | 26 | ||||
-rw-r--r-- | engines/voyeur/files.h | 2 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 20 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 4 |
4 files changed, 41 insertions, 11 deletions
diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 966e71bdb0..ee23855cbf 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -542,9 +542,9 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src) { if (mode != state._vm->_graphicsManager._SVGAMode) { state._vm->_graphicsManager._SVGAMode = mode; // TODO: If necessary, simulate SVGA mode change + warning("TODO: May need to implement SVGA stub code"); } - error("TODO: Implement extra picture resource modes"); // byte *imgData = _imgData; if (_flags & 0x10) { // TODO: Figure out what it's doing. Looks like a direct clearing @@ -591,6 +591,7 @@ PictureResource::~PictureResource() { ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src): _state(state) { + _flags = READ_LE_UINT16(src); _next = state._curLibPtr->getBoltEntry(READ_LE_UINT32(src + 2))._viewPortResource; int xs = READ_LE_UINT16(src + 0xC); @@ -609,6 +610,7 @@ 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); xs = READ_LE_UINT16(src + 0x46); ys = READ_LE_UINT16(src + 0x48); _clipRect = Common::Rect(xs, ys, xs + READ_LE_UINT16(src + 0x4A), @@ -628,8 +630,8 @@ ViewPortResource::ViewPortResource(BoltFilesState &state, const byte *src): void ViewPortResource::setupViewPort(PictureResource *page, Common::Rect *clipRect, ViewPortSetupPtr setupFn, ViewPortAddPtr addFn, ViewPortRestorePtr restoreFn) { PictureResource *pic = _picResource; - Common::Rect r(_bounds.left + pic->_bounds.left, _bounds.top + pic->_bounds.top, - _bounds.right, _bounds.bottom); + Common::Rect r = _bounds; + r.translate(pic->_bounds.left, pic->_bounds.top); int xDiff, yDiff; if (page) { @@ -638,16 +640,18 @@ void ViewPortResource::setupViewPort(PictureResource *page, Common::Rect *clipRe yDiff = page->_bounds.top - r.top; if (xDiff > 0) { + int width = r.width(); r.left = page->_bounds.left; - r.setWidth(xDiff <= r.width() ? r.width() - xDiff : 0); + r.setWidth(xDiff <= width ? width - xDiff : 0); } if (yDiff > 0) { + int height = r.height(); r.top = page->_bounds.top; - r.setHeight(yDiff <= r.height() ? r.height() - yDiff : 0); + r.setHeight(yDiff <= height ? height - yDiff : 0); } - xDiff = page->_bounds.left + page->_bounds.width(); - yDiff = page->_bounds.top + page->_bounds.height(); + xDiff = r.right - page->_bounds.right; + yDiff = r.bottom - page->_bounds.bottom; if (xDiff > 0) r.setWidth(xDiff <= r.width() ? r.width() - xDiff : 0); @@ -661,14 +665,16 @@ void ViewPortResource::setupViewPort(PictureResource *page, Common::Rect *clipRe yDiff = clipRect->top - r.top; if (xDiff > 0) { + int width = r.width(); r.left = clipRect->left; - r.setWidth(xDiff <= r.width() ? r.width() - xDiff : 0); + r.setWidth(xDiff <= width ? width - xDiff : 0); } if (yDiff > 0) { + int height = r.height(); r.top = clipRect->top; - r.setHeight(yDiff <= r.height() ? r.height() - yDiff : 0); + r.setHeight(yDiff <= height ? height - yDiff : 0); } - //dx=clipRec->left, cx=clipRect.y + xDiff = r.right - clipRect->right; yDiff = r.right - clipRect->right; diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 91f47e21dd..228b5093bb 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -218,6 +218,7 @@ private: void setupViewPort(PictureResource *page, Common::Rect *clipRect, ViewPortSetupPtr setupFn, ViewPortAddPtr addFn, ViewPortRestorePtr restoreFn); public: + int _flags; ViewPortResource *_next; Common::Rect _bounds; int _field18; @@ -229,6 +230,7 @@ public: byte *_field34; byte *_field38; byte *_field3C; + int16 _field42; Common::Rect _clipRect; byte *_field7A; GraphicMethodPtr _fn1; diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index e7bff00d31..33391703d3 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -29,9 +29,11 @@ namespace Voyeur { GraphicsManager::GraphicsManager() { - _palFlag = false; _SVGAPage = 0; _SVGAMode = 0; + _palFlag = false; + _MCGAMode = false; + _clipPtr = NULL; } void GraphicsManager::sInitGraphics() { @@ -67,7 +69,19 @@ void GraphicsManager::vDoCycleInt() { } void GraphicsManager::setupMCGASaveRect(ViewPortResource *viewPort) { + _MCGAMode = true; + + if (viewPort->_activePage) { + viewPort->_activePage->_flags |= 1; + Common::Rect *clipRect = _clipPtr; + _clipPtr = &viewPort->_clipRect; + + sDrawPic(viewPort->_activePage, viewPort->_picResource, viewPort, NULL); + _clipPtr = clipRect; + } + + viewPort->_field42 = -1; } void GraphicsManager::addRectOptSaveRect(ViewPortResource *viewPort, void *v2, void *v3) { @@ -82,4 +96,8 @@ void GraphicsManager::addRectNoSaveBack(ViewPortResource *viewPort, void *v2, vo } +void GraphicsManager::sDrawPic(PictureResource *pic, PictureResource *pic2, ViewPortResource *viewPort, void *v3) { + +} + } // End of namespace Voyeur diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 43f2563f0d..ce89621e67 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -56,6 +56,8 @@ public: int _SVGAPage; int _SVGAMode; ViewPortResource *_vPort; + bool _MCGAMode; + Common::Rect *_clipPtr; private: static void fadeIntFunc(); static void vDoFadeInt(); @@ -74,6 +76,8 @@ public: void addRectOptSaveRect(ViewPortResource *viewPort, void *v2, void *v3); void restoreMCGASaveRect(ViewPortResource *viewPort); void addRectNoSaveBack(ViewPortResource *viewPort, void *v2, void *v3); + + void sDrawPic(PictureResource *pic, PictureResource *pic2, ViewPortResource *viewPort, void *v3); }; } // End of namespace Voyeur |