From 156f78e7cdb4c49b437c378d7239806784bcee54 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 24 Dec 2013 10:32:41 +1100 Subject: VOYEUR: Bugfixes and move for doScroll method --- engines/voyeur/files.h | 4 ++++ engines/voyeur/files_threads.cpp | 2 +- engines/voyeur/graphics.cpp | 41 -------------------------------------- engines/voyeur/graphics.h | 1 - engines/voyeur/voyeur.h | 6 ++++++ engines/voyeur/voyeur_game.cpp | 43 +++++++++++++++++++++++++++++++++++++++- 6 files changed, 53 insertions(+), 44 deletions(-) (limited to 'engines/voyeur') diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 61c910be49..aa03383366 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -505,6 +505,10 @@ public: bool chooseSTAMPButton(int buttonId); void parsePlayCommands(); + + /** + * Do the camera view looking at the mansion + */ int doInterface(); void doRoom(); diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index be35143932..4432d7eb84 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -1438,7 +1438,7 @@ int ThreadResource::doInterface() { pt = _vm->_eventsManager.getMousePos(); if (pt.x != _currentMouseX || pt.y != _currentMouseY || regionIndex != priorRegionIndex) { priorRegionIndex = regionIndex; - _vm->_graphicsManager.doScroll(pt); + _vm->doScroll(pt); _currentMouseX = pt.x; _currentMouseY = pt.y; diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 185f51be54..a62a912c35 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -692,47 +692,6 @@ void GraphicsManager::screenReset() { _vm->_eventsManager.sWaitFlip(); } -void GraphicsManager::doScroll(const Common::Point &pt) { - Common::Rect clipRect(72, 47, 240, 148); - (*_vm->_graphicsManager._vPort)->setupViewPort(NULL, &clipRect); - - PictureResource *pic; - int base = 0; - switch (_vm->_voy._transitionId) { - case 0: - break; - case 1: - case 2: - case 5: - case 6: - case 7: - case 8: - case 9: - base = 0xB00; - break; - case 3: - base = 0xC00; - break; - default: - base = 0xD00; - } - - if (base) { - pic = _vm->_bVoy->boltEntry(base + 3)._picResource; - sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y - 104)); - pic = _vm->_bVoy->boltEntry(base + 4)._picResource; - sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y - 44)); - pic = _vm->_bVoy->boltEntry(base + 5)._picResource; - sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y + 16)); - pic = _vm->_bVoy->boltEntry(base + 6)._picResource; - sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y + 76)); - pic = _vm->_bVoy->boltEntry(base + 7)._picResource; - sDrawPic(pic, *_vPort, Common::Point(784 - pt.x + 712, 150 - pt.y + 136)); - } - - (*_vPort)->setupViewPort(); -} - void GraphicsManager::fadeDownICF1(int steps) { if (steps > 0) { int stepAmount = _vm->_voy._field4378 / steps; diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 1017726a0b..3bfef0ee81 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -112,7 +112,6 @@ public: void setColor(int idx, byte r, byte g, byte b); void setOneColor(int idx, byte r, byte g, byte b); void screenReset(); - void doScroll(const Common::Point &pt); void fadeDownICF1(int steps); void fadeUpICF1(int steps); void fadeDownICF(int steps); diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index a48f9c2784..0da5058992 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -165,6 +165,12 @@ public: * If necessary, flashes the time remaining bar on the video camera screen */ void flashTimeBar(); + + /** + * Handle scrolling of the mansion view in the camera sights + */ + void doScroll(const Common::Point &pt); + void checkPhoneCall(); void doEvidDisplay(int v1, int v2); diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp index b56f2c7551..1a6c2d1673 100644 --- a/engines/voyeur/voyeur_game.cpp +++ b/engines/voyeur/voyeur_game.cpp @@ -356,7 +356,7 @@ void VoyeurEngine::initIFace(){ CMapResource *pal = _bVoy->boltEntry(_playStamp1 + 2)._cMapResource; pal->startFade(); - _graphicsManager.doScroll(_eventsManager.getMousePos()); + doScroll(_eventsManager.getMousePos()); _voy._field4386 = _bVoy->memberAddr(_playStamp1); @@ -365,6 +365,47 @@ void VoyeurEngine::initIFace(){ // getting resources as needed will be fast enough. } +void VoyeurEngine::doScroll(const Common::Point &pt) { + Common::Rect clipRect(72, 47, 72 + 240, 47 + 148); + (*_graphicsManager._vPort)->setupViewPort(NULL, &clipRect); + + PictureResource *pic; + int base = 0; + switch (_voy._transitionId) { + case 0: + break; + case 1: + case 2: + case 5: + case 6: + case 7: + case 8: + case 9: + base = 0xB00; + break; + case 3: + base = 0xC00; + break; + default: + base = 0xD00; + } + + if (base) { + pic = _bVoy->boltEntry(base + 3)._picResource; + _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 104)); + pic = _bVoy->boltEntry(base + 4)._picResource; + _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 44)); + pic = _bVoy->boltEntry(base + 5)._picResource; + _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 16)); + pic = _bVoy->boltEntry(base + 6)._picResource; + _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 76)); + pic = _bVoy->boltEntry(base + 7)._picResource; + _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 136)); + } + + (*_graphicsManager._vPort)->setupViewPort(); +} + void VoyeurEngine::checkTransition(){ Common::String time, day; -- cgit v1.2.3