diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/animation.cpp | 6 | ||||
-rw-r--r-- | engines/voyeur/data.cpp | 16 | ||||
-rw-r--r-- | engines/voyeur/events.cpp | 54 | ||||
-rw-r--r-- | engines/voyeur/files.cpp | 62 | ||||
-rw-r--r-- | engines/voyeur/files_threads.cpp | 74 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/voyeur/graphics.h | 4 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 146 | ||||
-rw-r--r-- | engines/voyeur/voyeur.h | 2 | ||||
-rw-r--r-- | engines/voyeur/voyeur_game.cpp | 306 |
10 files changed, 337 insertions, 335 deletions
diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index 86ab7001d9..be6148c351 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -471,7 +471,7 @@ void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset, if (hasDirtyPalette()) { const byte *palette = getPalette(); - vm->_graphicsManager.setPalette128(palette, paletteStart, paletteCount); + vm->_graphicsManager->setPalette128(palette, paletteStart, paletteCount); } if (needsUpdate()) { @@ -483,7 +483,7 @@ void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset, Common::Point pt(READ_LE_UINT16(imgPos + 4 * picCtr) - 32, READ_LE_UINT16(imgPos + 4 * picCtr + 2) - 20); - vm->_graphicsManager.sDrawPic(newPic, &videoFrame, pt); + vm->_graphicsManager->sDrawPic(newPic, &videoFrame, pt); ++picCtr; } } @@ -491,7 +491,7 @@ void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset, // Decode the next frame and display const Graphics::Surface *frame = decodeNextFrame(); Common::copy((const byte *)frame->getPixels(), (const byte *)frame->getPixels() + 320 * 200, - (byte *)vm->_graphicsManager._screenSurface.getPixels()); + (byte *)vm->_graphicsManager->_screenSurface.getPixels()); } vm->_eventsManager->getMouseInfo(); diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp index b54160a917..9e29ae4618 100644 --- a/engines/voyeur/data.cpp +++ b/engines/voyeur/data.cpp @@ -238,10 +238,10 @@ void SVoy::reviewAnEvidEvent(int eventIndex) { int frameOff = e._computerOff; if (_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId)) { - _vm->_graphicsManager._backColors = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._cMapResource; - _vm->_graphicsManager._backgroundPage = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._picResource; - (*_vm->_graphicsManager._vPort)->setupViewPort(_vm->_graphicsManager._backgroundPage); - _vm->_graphicsManager._backColors->startFade(); + _vm->_graphicsManager->_backColors = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._cMapResource; + _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._picResource; + (*_vm->_graphicsManager->_vPort)->setupViewPort(_vm->_graphicsManager->_backgroundPage); + _vm->_graphicsManager->_backColors->startFade(); _vm->doEvidDisplay(frameOff, e._dead); _vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId); @@ -260,10 +260,10 @@ void SVoy::reviewComputerEvent(int eventIndex) { _computerTextId = e._computerOn; if (_vm->_bVoy->getBoltGroup(_vm->_playStampGroupId)) { - _vm->_graphicsManager._backColors = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._cMapResource; - _vm->_graphicsManager._backgroundPage = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._picResource; - (*_vm->_graphicsManager._vPort)->setupViewPort(_vm->_graphicsManager._backgroundPage); - _vm->_graphicsManager._backColors->startFade(); + _vm->_graphicsManager->_backColors = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._cMapResource; + _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._picResource; + (*_vm->_graphicsManager->_vPort)->setupViewPort(_vm->_graphicsManager->_backgroundPage); + _vm->_graphicsManager->_backColors->startFade(); _vm->flipPageAndWaitForFade(); _vm->getComputerBrush(); diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index 0e948d8dc3..13fadd3ced 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -109,18 +109,18 @@ void EventsManager::mainVoyeurIntFunc() { } void EventsManager::sWaitFlip() { - Common::Array<ViewPortResource *> &viewPorts = _vm->_graphicsManager._viewPortListPtr->_entries; + Common::Array<ViewPortResource *> &viewPorts = _vm->_graphicsManager->_viewPortListPtr->_entries; for (uint idx = 0; idx < viewPorts.size(); ++idx) { ViewPortResource &viewPort = *viewPorts[idx]; - if (_vm->_graphicsManager._saveBack && (viewPort._flags & DISPFLAG_40)) { - Common::Rect *clipPtr = _vm->_graphicsManager._clipPtr; - _vm->_graphicsManager._clipPtr = &viewPort._clipRect; + if (_vm->_graphicsManager->_saveBack && (viewPort._flags & DISPFLAG_40)) { + Common::Rect *clipPtr = _vm->_graphicsManager->_clipPtr; + _vm->_graphicsManager->_clipPtr = &viewPort._clipRect; if (viewPort._restoreFn) - (_vm->_graphicsManager.*viewPort._restoreFn)(&viewPort); + (_vm->_graphicsManager->*viewPort._restoreFn)(&viewPort); - _vm->_graphicsManager._clipPtr = clipPtr; + _vm->_graphicsManager->_clipPtr = clipPtr; viewPort._rectListCount[viewPort._pageIndex] = 0; viewPort._rectListPtr[viewPort._pageIndex]->clear(); viewPort._flags &= ~DISPFLAG_40; @@ -156,7 +156,7 @@ void EventsManager::checkForNextFrameCounter() { showMousePosition(); // Display the frame - g_system->copyRectToScreen((byte *)_vm->_graphicsManager._screenSurface.getPixels(), + g_system->copyRectToScreen((byte *)_vm->_graphicsManager->_screenSurface.getPixels(), SCREEN_WIDTH, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT); g_system->updateScreen(); @@ -176,9 +176,9 @@ void EventsManager::showMousePosition() { mousePos += Common::String::format(" - (%d,%d)", pt.x, pt.y); } - _vm->_graphicsManager._screenSurface.fillRect( + _vm->_graphicsManager->_screenSurface.fillRect( Common::Rect(0, 0, 110, font.getFontHeight()), 0); - font.drawString(&_vm->_graphicsManager._screenSurface, mousePos, + font.drawString(&_vm->_graphicsManager->_screenSurface, mousePos, 0, 0, 110, 63); } @@ -301,11 +301,11 @@ void EventsManager::startFade(CMapResource *cMap) { if (cMap->_steps > 0) { _fadeStatus = cMap->_fadeStatus | 1; - byte *vgaP = &_vm->_graphicsManager._VGAColors[_fadeFirstCol * 3]; + byte *vgaP = &_vm->_graphicsManager->_VGAColors[_fadeFirstCol * 3]; int mapIndex = 0; for (int idx = _fadeFirstCol; idx <= _fadeLastCol; ++idx, vgaP += 3) { - ViewPortPalEntry &palEntry = _vm->_graphicsManager._viewPortListPtr->_palette[idx]; + ViewPortPalEntry &palEntry = _vm->_graphicsManager->_viewPortListPtr->_palette[idx]; palEntry._rEntry = vgaP[0] << 8; int rDiff = (cMap->_entries[mapIndex * 3] << 8) - palEntry._rEntry; palEntry._rChange = rDiff / cMap->_steps; @@ -327,7 +327,7 @@ void EventsManager::startFade(CMapResource *cMap) { _intPtr._skipFading = true; _fadeIntNode._flags &= ~1; } else { - byte *vgaP = &_vm->_graphicsManager._VGAColors[_fadeFirstCol * 3]; + byte *vgaP = &_vm->_graphicsManager->_VGAColors[_fadeFirstCol * 3]; int mapIndex = 0; for (int idx = _fadeFirstCol; idx <= _fadeLastCol; ++idx, vgaP += 3) { @@ -373,8 +373,8 @@ void EventsManager::vDoFadeInt() { } for (int i = _fadeFirstCol; i <= _fadeLastCol; ++i) { - ViewPortPalEntry &palEntry = _vm->_graphicsManager._viewPortListPtr->_palette[i]; - byte *vgaP = &_vm->_graphicsManager._VGAColors[palEntry._palIndex * 3]; + ViewPortPalEntry &palEntry = _vm->_graphicsManager->_viewPortListPtr->_palette[i]; + byte *vgaP = &_vm->_graphicsManager->_VGAColors[palEntry._palIndex * 3]; palEntry._rEntry += palEntry._rChange; palEntry._gEntry += palEntry._gChange; @@ -397,7 +397,7 @@ void EventsManager::vDoCycleInt() { for (int idx = 3; idx >= 0; --idx) { if (_cyclePtr->_type[idx] && --_cycleTime[idx] <= 0) { byte *pSrc = _cycleNext[idx]; - byte *pPal = _vm->_graphicsManager._VGAColors; + byte *pPal = _vm->_graphicsManager->_VGAColors; if (_cyclePtr->_type[idx] != 1) { // New palette data being specified - loop to set entries @@ -523,7 +523,7 @@ void EventsManager::setCursor(PictureResource *pic) { cursor._bounds = pic->_bounds; cursor._flags = DISPFLAG_CURSOR; - _vm->_graphicsManager.sDrawPic(pic, &cursor, Common::Point()); + _vm->_graphicsManager->sDrawPic(pic, &cursor, Common::Point()); } void EventsManager::setCursor(byte *cursorData, int width, int height) { @@ -533,16 +533,16 @@ void EventsManager::setCursor(byte *cursorData, int width, int height) { void EventsManager::setCursorColor(int idx, int mode) { switch (mode) { case 0: - _vm->_graphicsManager.setColor(idx, 90, 90, 232); + _vm->_graphicsManager->setColor(idx, 90, 90, 232); break; case 1: - _vm->_graphicsManager.setColor(idx, 232, 90, 90); + _vm->_graphicsManager->setColor(idx, 232, 90, 90); break; case 2: - _vm->_graphicsManager.setColor(idx, 90, 232, 90); + _vm->_graphicsManager->setColor(idx, 90, 232, 90); break; case 3: - _vm->_graphicsManager.setColor(idx, 90, 232, 232); + _vm->_graphicsManager->setColor(idx, 90, 232, 232); break; default: break; @@ -566,12 +566,12 @@ void EventsManager::getMouseInfo() { if (_cursorBlinked) { _cursorBlinked = false; - _vm->_graphicsManager.setOneColor(128, 220, 20, 20); - _vm->_graphicsManager.setColor(128, 220, 20, 20); + _vm->_graphicsManager->setOneColor(128, 220, 20, 20); + _vm->_graphicsManager->setColor(128, 220, 20, 20); } else { _cursorBlinked = true; - _vm->_graphicsManager.setOneColor(128, 220, 220, 220); - _vm->_graphicsManager.setColor(128, 220, 220, 220); + _vm->_graphicsManager->setOneColor(128, 220, 220, 220); + _vm->_graphicsManager->setColor(128, 220, 220, 220); } } } @@ -587,11 +587,11 @@ void EventsManager::getMouseInfo() { void EventsManager::startCursorBlink() { if (_vm->_voy->_eventFlags & EVTFLAG_RECORDING) { - _vm->_graphicsManager.setOneColor(128, 55, 5, 5); - _vm->_graphicsManager.setColor(128, 220, 20, 20); + _vm->_graphicsManager->setOneColor(128, 55, 5, 5); + _vm->_graphicsManager->setColor(128, 220, 20, 20); _intPtr._hasPalette = true; - _vm->_graphicsManager.drawDot(); + _vm->_graphicsManager->drawDot(); //copySection(); } } diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 4841ff7173..63551ce6b9 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -486,8 +486,8 @@ void BVoyBoltFile::initViewPortList() { _state._curMemberPtr->_viewPortListResource = res = new ViewPortListResource( _state, _state._curMemberPtr->_data); - _state._vm->_graphicsManager._viewPortListPtr = res; - _state._vm->_graphicsManager._vPort = &res->_entries[0]; + _state._vm->_graphicsManager->_viewPortListPtr = res; + _state._vm->_graphicsManager->_vPort = &res->_entries[0]; } void BVoyBoltFile::initFontInfo() { @@ -754,24 +754,24 @@ DisplayResource::DisplayResource(VoyeurEngine *vm) { void DisplayResource::sFillBox(int width, int height) { assert(_vm); - bool saveBack = _vm->_graphicsManager._saveBack; - _vm->_graphicsManager._saveBack = false; + bool saveBack = _vm->_graphicsManager->_saveBack; + _vm->_graphicsManager->_saveBack = false; PictureResource pr; pr._flags = 1; pr._select = 0xff; pr._pick = 0; - pr._onOff = _vm->_graphicsManager._drawPtr->_penColor; + pr._onOff = _vm->_graphicsManager->_drawPtr->_penColor; pr._bounds = Common::Rect(0, 0, width, height); - _vm->_graphicsManager.sDrawPic(&pr, this, _vm->_graphicsManager._drawPtr->_pos); - _vm->_graphicsManager._saveBack = saveBack; + _vm->_graphicsManager->sDrawPic(&pr, this, _vm->_graphicsManager->_drawPtr->_pos); + _vm->_graphicsManager->_saveBack = saveBack; } bool DisplayResource::clipRect(Common::Rect &rect) { Common::Rect clippingRect; - if (_vm->_graphicsManager._clipPtr) { - clippingRect = *_vm->_graphicsManager._clipPtr; + if (_vm->_graphicsManager->_clipPtr) { + clippingRect = *_vm->_graphicsManager->_clipPtr; } else if (_flags & DISPFLAG_VIEWPORT) { clippingRect = ((ViewPortResource *)this)->_clipRect; } else { @@ -806,11 +806,11 @@ bool DisplayResource::clipRect(Common::Rect &rect) { } int DisplayResource::drawText(const Common::String &msg) { - GraphicsManager &gfxManager = _vm->_graphicsManager; + GraphicsManager &gfxManager = *_vm->_graphicsManager; assert(gfxManager._fontPtr); assert(gfxManager._fontPtr->_curFont); FontInfoResource &fontInfo = *gfxManager._fontPtr; - PictureResource &fontChar = *_vm->_graphicsManager._fontChar; + PictureResource &fontChar = *_vm->_graphicsManager->_fontChar; FontResource &fontData = *fontInfo._curFont; int xShadows[9] = { 0, 1, 1, 1, 0, -1, -1, -1, 0 }; int yShadows[9] = { 0, 1, 0, -1, -1, -1, 0, 1, 1 }; @@ -995,7 +995,7 @@ int DisplayResource::textWidth(const Common::String &msg) { return 0; const char *msgP = msg.c_str(); - FontResource &fontData = *_vm->_graphicsManager._fontPtr->_curFont; + FontResource &fontData = *_vm->_graphicsManager->_fontPtr->_curFont; int minChar = fontData._minChar; int maxChar = fontData._maxChar; int padding = fontData._padding; @@ -1081,9 +1081,9 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src): mode = 226; } - if (mode != state._vm->_graphicsManager._SVGAMode) { - state._vm->_graphicsManager._SVGAMode = mode; - state._vm->_graphicsManager.clearPalette(); + if (mode != state._vm->_graphicsManager->_SVGAMode) { + state._vm->_graphicsManager->_SVGAMode = mode; + state._vm->_graphicsManager->clearPalette(); } int screenOffset = READ_LE_UINT32(&src[18]) & 0xffff; @@ -1092,12 +1092,12 @@ PictureResource::PictureResource(BoltFilesState &state, const byte *src): if (_flags & PICFLAG_CLEAR_SCREEN) { // Clear screen picture. That's right. This game actually has a picture // resource flag to clear the screen! Bizarre. - Graphics::Surface &s = state._vm->_graphicsManager._screenSurface; + Graphics::Surface &s = state._vm->_graphicsManager->_screenSurface; s.fillRect(Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT), 0); } else { // Direct screen loading picture. In this case, the raw data of the resource // is directly decompressed into the screen surface. Again, bizarre. - byte *pDest = (byte *)state._vm->_graphicsManager._screenSurface.getPixels(); + byte *pDest = (byte *)state._vm->_graphicsManager->_screenSurface.getPixels(); state.decompress(pDest, SCREEN_WIDTH * SCREEN_HEIGHT, state._curMemberPtr->_mode); } } else { @@ -1320,11 +1320,11 @@ void ViewPortResource::setupViewPort(PictureResource *page, Common::Rect *clippi _restoreFn = restoreFn; if (setupFn) - (_state._vm->_graphicsManager.*setupFn)(this); + (_state._vm->_graphicsManager->*setupFn)(this); } void ViewPortResource::setupViewPort() { - setupViewPort(_state._vm->_graphicsManager._backgroundPage, NULL, + setupViewPort(_state._vm->_graphicsManager->_backgroundPage, NULL, &GraphicsManager::setupMCGASaveRect, &GraphicsManager::addRectOptSaveRect, &GraphicsManager::restoreMCGASaveRect); } @@ -1340,7 +1340,7 @@ void ViewPortResource::addSaveRect(int pageIndex, const Common::Rect &r) { if (clipRect(rect)) { if (_addFn) { - (_state._vm->_graphicsManager.*_addFn)(this, pageIndex, rect); + (_state._vm->_graphicsManager->*_addFn)(this, pageIndex, rect); } else if (_rectListCount[pageIndex] != -1) { _rectListPtr[pageIndex]->push_back(rect); } @@ -1348,26 +1348,26 @@ void ViewPortResource::addSaveRect(int pageIndex, const Common::Rect &r) { } void ViewPortResource::fillPic(byte onOff) { - _state._vm->_graphicsManager.fillPic(this, onOff); + _state._vm->_graphicsManager->fillPic(this, onOff); } void ViewPortResource::drawIfaceTime() { // Hour display - _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort, + _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, (_state._vm->_gameHour / 10) == 0 ? 10 : _state._vm->_gameHour / 10, Common::Point(161, 25)); - _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort, + _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, _state._vm->_gameHour % 10, Common::Point(172, 25)); // Minute display - _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort, + _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, _state._vm->_gameMinute / 10, Common::Point(190, 25)); - _state._vm->_graphicsManager.drawANumber(*_state._vm->_graphicsManager._vPort, + _state._vm->_graphicsManager->drawANumber(*_state._vm->_graphicsManager->_vPort, _state._vm->_gameMinute % 10, Common::Point(201, 25)); // AM/PM indicator PictureResource *pic = _state._vm->_bVoy->boltEntry(_state._vm->_voy->_isAM ? 272 : 273)._picResource; - _state._vm->_graphicsManager.sDrawPic(pic, *_state._vm->_graphicsManager._vPort, + _state._vm->_graphicsManager->sDrawPic(pic, *_state._vm->_graphicsManager->_vPort, Common::Point(215, 27)); } @@ -1375,9 +1375,9 @@ void ViewPortResource::drawPicPerm(PictureResource *pic, const Common::Point &pt Common::Rect bounds = pic->_bounds; bounds.translate(pt.x, pt.y); - bool saveBack = _state._vm->_graphicsManager._saveBack; - _state._vm->_graphicsManager._saveBack = false; - _state._vm->_graphicsManager.sDrawPic(pic, this, pt); + bool saveBack = _state._vm->_graphicsManager->_saveBack; + _state._vm->_graphicsManager->_saveBack = false; + _state._vm->_graphicsManager->sDrawPic(pic, this, pt); clipRect(bounds); for (int pageIndex = 0; pageIndex < _pageCount; ++pageIndex) { @@ -1386,7 +1386,7 @@ void ViewPortResource::drawPicPerm(PictureResource *pic, const Common::Point &pt } } - _state._vm->_graphicsManager._saveBack = saveBack; + _state._vm->_graphicsManager->_saveBack = saveBack; } /*------------------------------------------------------------------------*/ @@ -1519,7 +1519,7 @@ CMapResource::CMapResource(BoltFilesState &state, const byte *src): _vm(state._v _entries = new byte[count * 3]; Common::copy(src + 6, src + 6 + 3 * count, _entries); - int palIndex = state._vm->_graphicsManager._viewPortListPtr->_palIndex; + int palIndex = state._vm->_graphicsManager->_viewPortListPtr->_palIndex; if (_end > palIndex) _end = palIndex; if (_start > palIndex) diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index 385e61ecee..603eb64a35 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -458,7 +458,7 @@ void ThreadResource::parsePlayCommands() { pic = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + i * 2)._picResource; pal = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + i * 2 + 1)._cMapResource; - (*_vm->_graphicsManager._vPort)->setupViewPort(pic); + (*_vm->_graphicsManager->_vPort)->setupViewPort(pic); pal->startFade(); _vm->flipPageAndWaitForFade(); @@ -977,10 +977,10 @@ int ThreadResource::doApt() { _vm->_soundManager->startVOCPlay(_vm->_soundManager->getVOCFileName(_vm->_currentVocId)); _vm->_currentVocId = 151; - _vm->_graphicsManager.setColor(129, 82, 82, 82); - _vm->_graphicsManager.setColor(130, 112, 112, 112); - _vm->_graphicsManager.setColor(131, 215, 215, 215); - _vm->_graphicsManager.setColor(132, 235, 235, 235); + _vm->_graphicsManager->setColor(129, 82, 82, 82); + _vm->_graphicsManager->setColor(130, 112, 112, 112); + _vm->_graphicsManager->setColor(131, 215, 215, 215); + _vm->_graphicsManager->setColor(132, 235, 235, 235); _vm->_eventsManager->_intPtr._hasPalette = true; @@ -1030,7 +1030,7 @@ int ThreadResource::doApt() { // Draw the text description for the highlighted hotspot pic = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + hotspotId + 6)._picResource; - _vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort, + _vm->_graphicsManager->sDrawPic(pic, *_vm->_graphicsManager->_vPort, Common::Point(106, 200)); } @@ -1045,7 +1045,7 @@ int ThreadResource::doApt() { // Draw either standard or highlighted eye cursor pic = _vm->_bVoy->boltEntry((hotspotId == -1) ? _vm->_playStampGroupId + 2 : _vm->_playStampGroupId + 3)._picResource; - _vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort, pt); + _vm->_graphicsManager->sDrawPic(pic, *_vm->_graphicsManager->_vPort, pt); _vm->flipPageAndWait(); @@ -1098,10 +1098,10 @@ void ThreadResource::doRoom() { if (!vm._bVoy->getBoltGroup(vm._playStampGroupId, true)) return; - vm._graphicsManager._backColors = vm._bVoy->boltEntry(vm._playStampGroupId + 1)._cMapResource; - vm._graphicsManager._backgroundPage = vm._bVoy->boltEntry(vm._playStampGroupId)._picResource; - (*vm._graphicsManager._vPort)->setupViewPort(vm._graphicsManager._backgroundPage); - vm._graphicsManager._backColors->startFade(); + vm._graphicsManager->_backColors = vm._bVoy->boltEntry(vm._playStampGroupId + 1)._cMapResource; + vm._graphicsManager->_backgroundPage = vm._bVoy->boltEntry(vm._playStampGroupId)._picResource; + (*vm._graphicsManager->_vPort)->setupViewPort(vm._graphicsManager->_backgroundPage); + vm._graphicsManager->_backColors->startFade(); voy._fadingStep1 = 2; voy._fadingStep2 = 0; @@ -1130,7 +1130,7 @@ void ThreadResource::doRoom() { bool breakFlag = false; while (!vm.shouldQuit() && !breakFlag) { _vm->_voyeurArea = AREA_ROOM; - vm._graphicsManager.setColor(128, 0, 255, 0); + vm._graphicsManager->setColor(128, 0, 255, 0); vm._eventsManager->_intPtr._hasPalette = true; do { @@ -1171,7 +1171,7 @@ void ThreadResource::doRoom() { } vm._eventsManager->_intPtr._hasPalette = true; - vm._graphicsManager.flipPage(); + vm._graphicsManager->flipPage(); vm._eventsManager->sWaitFlip(); } while (!vm.shouldQuit() && !vm._eventsManager->_mouseClicked); @@ -1219,13 +1219,13 @@ void ThreadResource::doRoom() { // WORKAROUND: Skipped code from the original, that freed the group, // reloaded it, and reloaded the cursors - vm._graphicsManager._backColors = vm._bVoy->boltEntry( + vm._graphicsManager->_backColors = vm._bVoy->boltEntry( vm._playStampGroupId + 1)._cMapResource; - vm._graphicsManager._backgroundPage = vm._bVoy->boltEntry( + vm._graphicsManager->_backgroundPage = vm._bVoy->boltEntry( vm._playStampGroupId)._picResource; - (*vm._graphicsManager._vPort)->setupViewPort(); - vm._graphicsManager._backColors->startFade(); + (*vm._graphicsManager->_vPort)->setupViewPort(); + vm._graphicsManager->_backColors->startFade(); _vm->flipPageAndWait(); while (!vm.shouldQuit() && (vm._eventsManager->_fadeStatus & 1)) @@ -1250,7 +1250,7 @@ void ThreadResource::doRoom() { _vm->flipPageAndWait(); - vm._graphicsManager.fadeUpICF1(); + vm._graphicsManager->fadeUpICF1(); voy._eventFlags &= EVTFLAG_RECORDING; vm._eventsManager->showCursor(); } @@ -1332,7 +1332,7 @@ int ThreadResource::doInterface() { _vm->_soundManager->startVOCPlay(fname); _vm->_eventsManager->getMouseInfo(); - _vm->_graphicsManager.setColor(240, 220, 220, 220); + _vm->_graphicsManager->setColor(240, 220, 220, 220); _vm->_eventsManager->_intPtr._hasPalette = true; _vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; @@ -1406,20 +1406,20 @@ int ThreadResource::doInterface() { // Regularly update the time display if (_vm->_voy->_RTANum & 2) { - _vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort, + _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, _vm->_gameMinute / 10, Common::Point(190, 25)); - _vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort, + _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, _vm->_gameMinute % 10, Common::Point(201, 25)); if (_vm->_voy->_RTANum & 4) { int v = _vm->_gameHour / 10; - _vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort, + _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, v == 0 ? 10 : v, Common::Point(161, 25)); - _vm->_graphicsManager.drawANumber(*_vm->_graphicsManager._vPort, + _vm->_graphicsManager->drawANumber(*_vm->_graphicsManager->_vPort, _vm->_gameHour % 10, Common::Point(172, 25)); pic = _vm->_bVoy->boltEntry(_vm->_voy->_isAM ? 272 : 273)._picResource; - _vm->_graphicsManager.sDrawPic(pic, *_vm->_graphicsManager._vPort, + _vm->_graphicsManager->sDrawPic(pic, *_vm->_graphicsManager->_vPort, Common::Point(215, 27)); } } @@ -1585,16 +1585,16 @@ void ThreadResource::loadTheApt() { doAptAnim(1); _vm->_bVoy->getBoltGroup(_vm->_playStampGroupId); _vm->_voy->_aptLoadMode = -1; - _vm->_graphicsManager._backgroundPage = _vm->_bVoy->boltEntry( + _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry( _vm->_playStampGroupId + 5)._picResource; - (*_vm->_graphicsManager._vPort)->setupViewPort( - _vm->_graphicsManager._backgroundPage); + (*_vm->_graphicsManager->_vPort)->setupViewPort( + _vm->_graphicsManager->_backgroundPage); } else { _vm->_bVoy->getBoltGroup(_vm->_playStampGroupId); - _vm->_graphicsManager._backgroundPage = _vm->_bVoy->boltEntry( + _vm->_graphicsManager->_backgroundPage = _vm->_bVoy->boltEntry( _vm->_playStampGroupId + 5)._picResource; - (*_vm->_graphicsManager._vPort)->setupViewPort( - _vm->_graphicsManager._backgroundPage); + (*_vm->_graphicsManager->_vPort)->setupViewPort( + _vm->_graphicsManager->_backgroundPage); } CMapResource *pal = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + 4)._cMapResource; @@ -1604,10 +1604,10 @@ void ThreadResource::loadTheApt() { } void ThreadResource::freeTheApt() { - _vm->_graphicsManager.fadeDownICF1(5); + _vm->_graphicsManager->fadeDownICF1(5); _vm->flipPageAndWaitForFade(); - _vm->_graphicsManager.fadeUpICF1(); + _vm->_graphicsManager->fadeUpICF1(); if (_vm->_currentVocId != -1) { _vm->_soundManager->stopVOCPlay(); @@ -1615,17 +1615,17 @@ void ThreadResource::freeTheApt() { } if (_vm->_voy->_aptLoadMode == -1) { - _vm->_graphicsManager.fadeDownICF(6); + _vm->_graphicsManager->fadeDownICF(6); } else { doAptAnim(2); } if (_vm->_voy->_aptLoadMode == 140) { - _vm->_graphicsManager.screenReset(); - _vm->_graphicsManager.resetPalette(); + _vm->_graphicsManager->screenReset(); + _vm->_graphicsManager->resetPalette(); } - (*_vm->_graphicsManager._vPort)->setupViewPort(nullptr); + (*_vm->_graphicsManager->_vPort)->setupViewPort(nullptr); _vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId); _vm->_playStampGroupId = -1; _vm->_voy->_viewBounds = nullptr; @@ -1685,7 +1685,7 @@ void ThreadResource::doAptAnim(int mode) { for (int idx = 0; (idx < 6) && !_vm->shouldQuit(); ++idx) { PictureResource *pic = _vm->_bVoy->boltEntry(id + idx + 1)._picResource; - (*_vm->_graphicsManager._vPort)->setupViewPort(pic); + (*_vm->_graphicsManager->_vPort)->setupViewPort(pic); pal->startFade(); _vm->flipPageAndWait(); diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index a4dc27bd02..ce5b91fb8a 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -38,7 +38,7 @@ DrawInfo::DrawInfo(int penColor, const Common::Point &pos) { /*------------------------------------------------------------------------*/ -GraphicsManager::GraphicsManager(): _defaultDrawInfo(1, Common::Point()), _drawPtr(&_defaultDrawInfo) { +GraphicsManager::GraphicsManager(VoyeurEngine *vm) : _defaultDrawInfo(1, Common::Point()), _drawPtr(&_defaultDrawInfo), _vm(vm) { _SVGAMode = 0; _planeSelect = 0; _saveBack = true; diff --git a/engines/voyeur/graphics.h b/engines/voyeur/graphics.h index 57d72228c5..f736c8a7f9 100644 --- a/engines/voyeur/graphics.h +++ b/engines/voyeur/graphics.h @@ -80,9 +80,9 @@ private: void restoreBack(Common::Array<Common::Rect> &rectList, int rectListCount, PictureResource *srcPic, PictureResource *destPic); public: - GraphicsManager(); + GraphicsManager(VoyeurEngine *vm); ~GraphicsManager(); - void setVm(VoyeurEngine *vm) { _vm = vm; } + void sInitGraphics(); void setupMCGASaveRect(ViewPortResource *viewPort); diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index d0cfb05569..c26841f481 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -42,6 +42,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) _debugger = nullptr; _eventsManager = nullptr; _filesManager = nullptr; + _graphicsManager = nullptr; _soundManager = nullptr; _voy = nullptr; _bVoy = NULL; @@ -70,10 +71,10 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) } void VoyeurEngine::initializeManagers() { - _graphicsManager.setVm(this); _debugger = new Debugger(this); _eventsManager = new EventsManager(this); _filesManager = new FilesManager(this); + _graphicsManager = new GraphicsManager(this); _soundManager = new SoundManager(this, _mixer); _voy = new SVoy(this); } @@ -82,8 +83,9 @@ VoyeurEngine::~VoyeurEngine() { delete _bVoy; delete _voy; delete _soundManager; - delete _eventsManager; + delete _graphicsManager; delete _filesManager; + delete _eventsManager; delete _debugger; } @@ -124,9 +126,9 @@ void VoyeurEngine::globalInitBolt() { _bVoy->getBoltGroup(0x000); _bVoy->getBoltGroup(0x100); - _graphicsManager._fontPtr = &_defaultFontInfo; - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; - assert(_graphicsManager._fontPtr->_curFont); + _graphicsManager->_fontPtr = &_defaultFontInfo; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; + assert(_graphicsManager->_fontPtr->_curFont); // Setup default flags _voy->_viewBounds = nullptr; @@ -136,13 +138,13 @@ void VoyeurEngine::globalInitBolt() { void VoyeurEngine::initBolt() { vInitInterrupts(); - _graphicsManager.sInitGraphics(); + _graphicsManager->sInitGraphics(); _eventsManager->vInitColor(); initInput(); } void VoyeurEngine::vInitInterrupts() { - _eventsManager->_intPtr._palette = &_graphicsManager._VGAColors[0]; + _eventsManager->_intPtr._palette = &_graphicsManager->_VGAColors[0]; } void VoyeurEngine::initInput() { @@ -205,8 +207,8 @@ bool VoyeurEngine::doHeadTitle() { } void VoyeurEngine::showConversionScreen() { - _graphicsManager._backgroundPage = _bVoy->boltEntry(0x502)._picResource; - (*_graphicsManager._vPort)->setupViewPort(); + _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x502)._picResource; + (*_graphicsManager->_vPort)->setupViewPort(); flipPageAndWait(); // Immediate palette load to show the initial screen @@ -229,7 +231,7 @@ void VoyeurEngine::showConversionScreen() { flipPageAndWaitForFade(); - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); } bool VoyeurEngine::doLock() { @@ -249,23 +251,23 @@ bool VoyeurEngine::doLock() { byte *keyData = _bVoy->memberAddr(0x705); int keyCount = READ_LE_UINT16(keyData); - _graphicsManager._backColors = _bVoy->getCMapResource(0x7010000); - _graphicsManager._backgroundPage = _bVoy->getPictureResource(0x700); - (*_graphicsManager._vPort)->setupViewPort(); + _graphicsManager->_backColors = _bVoy->getCMapResource(0x7010000); + _graphicsManager->_backgroundPage = _bVoy->getPictureResource(0x700); + (*_graphicsManager->_vPort)->setupViewPort(); - _graphicsManager._backColors->startFade(); - (*_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; - _graphicsManager.flipPage(); + _graphicsManager->_backColors->startFade(); + (*_graphicsManager->_vPort)->_parent->_flags |= DISPFLAG_8; + _graphicsManager->flipPage(); _eventsManager->sWaitFlip(); while (!shouldQuit() && (_eventsManager->_fadeStatus & 1)) _eventsManager->delay(1); _eventsManager->setCursorColor(127, 0); - _graphicsManager.setColor(1, 64, 64, 64); - _graphicsManager.setColor(2, 96, 96, 96); - _graphicsManager.setColor(3, 160, 160, 160); - _graphicsManager.setColor(4, 224, 224, 224); + _graphicsManager->setColor(1, 64, 64, 64); + _graphicsManager->setColor(2, 96, 96, 96); + _graphicsManager->setColor(3, 160, 160, 160); + _graphicsManager->setColor(4, 224, 224, 224); // Set up the cursor _eventsManager->setCursor(cursorPic); @@ -273,9 +275,9 @@ bool VoyeurEngine::doLock() { _eventsManager->_intPtr._hasPalette = true; - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x708)._fontResource; - _graphicsManager._fontPtr->_fontSaveBack = 0; - _graphicsManager._fontPtr->_fontFlags = 0; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x708)._fontResource; + _graphicsManager->_fontPtr->_fontSaveBack = 0; + _graphicsManager->_fontPtr->_fontFlags = 0; Common::String dateString = "ScummVM"; Common::String displayString = Common::String::format("Last Play %s", dateString.c_str()); @@ -284,16 +286,16 @@ bool VoyeurEngine::doLock() { bool breakFlag = false; bool flag = false; while (!breakFlag && !shouldQuit()) { - (*_graphicsManager._vPort)->setupViewPort(); + (*_graphicsManager->_vPort)->setupViewPort(); flipPageAndWait(); // Display the last play time - _graphicsManager._fontPtr->_pos = Common::Point(0, 97); - _graphicsManager._fontPtr->_justify = ALIGN_CENTER; - _graphicsManager._fontPtr->_justifyWidth = 384; - _graphicsManager._fontPtr->_justifyHeight = 97; + _graphicsManager->_fontPtr->_pos = Common::Point(0, 97); + _graphicsManager->_fontPtr->_justify = ALIGN_CENTER; + _graphicsManager->_fontPtr->_justifyWidth = 384; + _graphicsManager->_fontPtr->_justifyHeight = 97; - (*_graphicsManager._vPort)->drawText(displayString); + (*_graphicsManager->_vPort)->drawText(displayString); flipPageAndWait(); if (firstLoop) { @@ -363,7 +365,7 @@ bool VoyeurEngine::doLock() { } else if (key == 11) { // New code if ((password.empty() && displayString.empty()) || (password != displayString)) { - (*_graphicsManager._vPort)->setupViewPort(); + (*_graphicsManager->_vPort)->setupViewPort(); flag = true; displayString = ""; continue; @@ -380,9 +382,9 @@ bool VoyeurEngine::doLock() { _soundManager->playVOCMap(wrongVoc, wrongVocSize); } - _graphicsManager.fillPic(*_graphicsManager._vPort); + _graphicsManager->fillPic(*_graphicsManager->_vPort); flipPageAndWait(); - _graphicsManager.resetPalette(); + _graphicsManager->resetPalette(); _voy->_viewBounds = nullptr; _bVoy->freeBoltGroup(0x700); @@ -398,9 +400,9 @@ bool VoyeurEngine::doLock() { void VoyeurEngine::showTitleScreen() { if (_bVoy->getBoltGroup(0x500)) { - _graphicsManager._backgroundPage = _bVoy->getPictureResource(0x500); + _graphicsManager->_backgroundPage = _bVoy->getPictureResource(0x500); - (*_graphicsManager._vPort)->setupViewPort(); + (*_graphicsManager->_vPort)->setupViewPort(); flipPageAndWait(); // Immediate palette load to show the initial screen @@ -423,19 +425,19 @@ void VoyeurEngine::showTitleScreen() { if (shouldQuit()) return; - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); _eventsManager->delayClick(200); // Voyeur title playRL2Video("a1100100.rl2"); - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); _bVoy->freeBoltGroup(0x500); } } void VoyeurEngine::doOpening() { - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); if (!_bVoy->getBoltGroup(0x200, true)) return; @@ -461,10 +463,10 @@ void VoyeurEngine::doOpening() { _voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; for (int i = 0; i < 256; ++i) - _graphicsManager.setColor(i, 8, 8, 8); + _graphicsManager->setColor(i, 8, 8, 8); _eventsManager->_intPtr._hasPalette = true; - (*_graphicsManager._vPort)->setupViewPort(); + (*_graphicsManager->_vPort)->setupViewPort(); flipPageAndWait(); RL2Decoder decoder; @@ -474,14 +476,14 @@ void VoyeurEngine::doOpening() { while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked) { if (decoder.hasDirtyPalette()) { const byte *palette = decoder.getPalette(); - _graphicsManager.setPalette(palette, 0, 256); + _graphicsManager->setPalette(palette, 0, 256); } if (decoder.needsUpdate()) { const Graphics::Surface *frame = decoder.decodeNextFrame(); Common::copy((const byte *)frame->getPixels(), (const byte *)frame->getPixels() + 320 * 200, - (byte *)_graphicsManager._screenSurface.getPixels()); + (byte *)_graphicsManager->_screenSurface.getPixels()); if (decoder.getCurFrame() >= (int32)READ_LE_UINT32(frameTable + frameIndex * 4)) { if (creditShow) { @@ -501,7 +503,7 @@ void VoyeurEngine::doOpening() { } if (textPic) { - _graphicsManager.sDrawPic(textPic, *_graphicsManager._vPort, textPos); + _graphicsManager->sDrawPic(textPic, *_graphicsManager->_vPort, textPos); flipPageAndWait(); } } @@ -528,14 +530,14 @@ void VoyeurEngine::playRL2Video(const Common::String &filename) { while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked) { if (decoder.hasDirtyPalette()) { const byte *palette = decoder.getPalette(); - _graphicsManager.setPalette(palette, 0, 256); + _graphicsManager->setPalette(palette, 0, 256); } if (decoder.needsUpdate()) { const Graphics::Surface *frame = decoder.decodeNextFrame(); Common::copy((const byte *)frame->getPixels(), (const byte *)frame->getPixels() + 320 * 200, - (byte *)_graphicsManager._screenSurface.getPixels()); + (byte *)_graphicsManager->_screenSurface.getPixels()); } _eventsManager->getMouseInfo(); @@ -575,15 +577,15 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { const Graphics::Surface *frame = decoder.decodeNextFrame(); Common::copy((const byte *)frame->getPixels(), (const byte *)frame->getPixels() + 320 * 200, - (byte *)_graphicsManager._screenSurface.getPixels()); + (byte *)_graphicsManager->_screenSurface.getPixels()); if (_voy->_eventFlags & EVTFLAG_RECORDING) - _graphicsManager.drawDot(); + _graphicsManager->drawDot(); } if (decoder.hasDirtyPalette()) { const byte *palette = decoder.getPalette(); - _graphicsManager.setPalette(palette, 0, decoder.getPaletteCount()); - _graphicsManager.setOneColor(128, 220, 20, 20); + _graphicsManager->setPalette(palette, 0, decoder.getPaletteCount()); + _graphicsManager->setOneColor(128, 220, 20, 20); } _eventsManager->getMouseInfo(); @@ -591,13 +593,13 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { } // RL2 finished - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); _voy->_eventFlags &= ~EVTFLAG_RECORDING; if (_voy->_eventFlags & EVTFLAG_8) { assert(pic); - byte *imgData = (*_graphicsManager._vPort)->_currentPic->_imgData; - (*_graphicsManager._vPort)->_currentPic->_imgData = pic->_imgData; + byte *imgData = (*_graphicsManager->_vPort)->_currentPic->_imgData; + (*_graphicsManager->_vPort)->_currentPic->_imgData = pic->_imgData; pic->_imgData = imgData; _voy->_eventFlags &= ~EVTFLAG_8; } @@ -605,13 +607,13 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { void VoyeurEngine::playAudio(int audioId) { _bVoy->getBoltGroup(0x7F00); - _graphicsManager._backgroundPage = _bVoy->boltEntry(0x7F00 + + _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x7F00 + BLIND_TABLE[audioId] * 2)._picResource; - _graphicsManager._backColors = _bVoy->boltEntry(0x7F01 + + _graphicsManager->_backColors = _bVoy->boltEntry(0x7F01 + BLIND_TABLE[audioId] * 2)._cMapResource; - (*_graphicsManager._vPort)->setupViewPort(); - _graphicsManager._backColors->startFade(); + (*_graphicsManager->_vPort)->setupViewPort(); + _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); _voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; @@ -630,26 +632,26 @@ void VoyeurEngine::playAudio(int audioId) { _soundManager->stopVOCPlay(); _bVoy->freeBoltGroup(0x7F00); - (*_graphicsManager._vPort)->setupViewPort(NULL); + (*_graphicsManager->_vPort)->setupViewPort(NULL); _voy->_eventFlags &= ~EVTFLAG_RECORDING; _voy->_playStampMode = 129; } void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::String &location) { - _graphicsManager.setColor(128, 16, 16, 16); - _graphicsManager.setColor(224, 220, 220, 220); + _graphicsManager->setColor(128, 16, 16, 16); + _graphicsManager->setColor(224, 220, 220, 220); _eventsManager->_intPtr._hasPalette = true; - (*_graphicsManager._vPort)->setupViewPort(NULL); - (*_graphicsManager._vPort)->fillPic(128); - _graphicsManager.flipPage(); + (*_graphicsManager->_vPort)->setupViewPort(NULL); + (*_graphicsManager->_vPort)->fillPic(128); + _graphicsManager->flipPage(); _eventsManager->sWaitFlip(); flipPageAndWait(); - (*_graphicsManager._vPort)->fillPic(128); + (*_graphicsManager->_vPort)->fillPic(128); - FontInfoResource &fi = *_graphicsManager._fontPtr; + FontInfoResource &fi = *_graphicsManager->_fontPtr; fi._curFont = _bVoy->boltEntry(257)._fontResource; fi._foreColor = 224; fi._fontSaveBack = 0; @@ -658,7 +660,7 @@ void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::St fi._justifyWidth = 384; fi._justifyHeight = 120; - (*_graphicsManager._vPort)->drawText(time); + (*_graphicsManager->_vPort)->drawText(time); if (!location.empty()) { fi._pos = Common::Point(0, 138); @@ -666,7 +668,7 @@ void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::St fi._justifyWidth = 384; fi._justifyHeight = 140; - (*_graphicsManager._vPort)->drawText(location); + (*_graphicsManager->_vPort)->drawText(location); } flipPageAndWait(); @@ -677,8 +679,8 @@ void VoyeurEngine::saveLastInplay() { } void VoyeurEngine::flipPageAndWait() { - (*_graphicsManager._vPort)->_flags |= DISPFLAG_8; - _graphicsManager.flipPage(); + (*_graphicsManager->_vPort)->_flags |= DISPFLAG_8; + _graphicsManager->flipPage(); _eventsManager->sWaitFlip(); } @@ -699,7 +701,7 @@ void VoyeurEngine::showEndingNews() { PictureResource *pic = _bVoy->boltEntry(_playStampGroupId)._picResource; CMapResource *pal = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource; - (*_graphicsManager._vPort)->setupViewPort(pic); + (*_graphicsManager->_vPort)->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); @@ -714,7 +716,7 @@ void VoyeurEngine::showEndingNews() { pal = _bVoy->boltEntry(_playStampGroupId + idx * 2 + 1)._cMapResource; } - (*_graphicsManager._vPort)->setupViewPort(pic); + (*_graphicsManager->_vPort)->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); @@ -849,7 +851,7 @@ void VoyeurEngine::synchronize(Common::Serializer &s) { // Sub-systems _voy->synchronize(s); - _graphicsManager.synchronize(s); + _graphicsManager->synchronize(s); _mainThread->synchronize(s); _controlPtr->_state->synchronize(s); } @@ -903,8 +905,8 @@ void VoyeurSavegameHeader::write(Common::OutSaveFile *f, VoyeurEngine *vm, const // Create a thumbnail and save it Graphics::Surface *thumb = new Graphics::Surface(); - ::createThumbnail(thumb, (byte *)vm->_graphicsManager._screenSurface.getPixels(), - SCREEN_WIDTH, SCREEN_HEIGHT, vm->_graphicsManager._VGAColors); + ::createThumbnail(thumb, (byte *)vm->_graphicsManager->_screenSurface.getPixels(), + SCREEN_WIDTH, SCREEN_HEIGHT, vm->_graphicsManager->_VGAColors); Graphics::saveThumbnail(*f, *thumb); thumb->free(); delete thumb; diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index 76f8b5e3c4..4b90f8559d 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -160,7 +160,7 @@ public: Debugger *_debugger; EventsManager *_eventsManager; FilesManager *_filesManager; - GraphicsManager _graphicsManager; + GraphicsManager *_graphicsManager; SoundManager *_soundManager; SVoy *_voy; diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp index 75dd5b603d..23fc722493 100644 --- a/engines/voyeur/voyeur_game.cpp +++ b/engines/voyeur/voyeur_game.cpp @@ -149,8 +149,8 @@ void VoyeurEngine::playStamp() { case 130: { // user selected to send the tape if (_bVoy->getBoltGroup(_playStampGroupId)) { - _graphicsManager._backgroundPage = _bVoy->boltEntry(_playStampGroupId)._picResource; - _graphicsManager._backColors = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource; + _graphicsManager->_backgroundPage = _bVoy->boltEntry(_playStampGroupId)._picResource; + _graphicsManager->_backColors = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource; buttonId = getChooseButton(); if (_eventsManager->_rightClick) @@ -158,7 +158,7 @@ void VoyeurEngine::playStamp() { buttonId = 4; _bVoy->freeBoltGroup(_playStampGroupId); - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); _playStampGroupId = -1; flag = true; @@ -232,8 +232,8 @@ void VoyeurEngine::closeStamp() { } void VoyeurEngine::doTailTitle() { - (*_graphicsManager._vPort)->setupViewPort(NULL); - _graphicsManager.screenReset(); + (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->screenReset(); if (_bVoy->getBoltGroup(0x600)) { RL2Decoder decoder; @@ -245,12 +245,12 @@ void VoyeurEngine::doTailTitle() { doClosingCredits(); if (!shouldQuit() && !_eventsManager->_mouseClicked) { - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); PictureResource *pic = _bVoy->boltEntry(0x602)._picResource; CMapResource *pal = _bVoy->boltEntry(0x603)._cMapResource; - (*_graphicsManager._vPort)->setupViewPort(pic); + (*_graphicsManager->_vPort)->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); _eventsManager->delayClick(300); @@ -258,7 +258,7 @@ void VoyeurEngine::doTailTitle() { pic = _bVoy->boltEntry(0x604)._picResource; pal = _bVoy->boltEntry(0x605)._cMapResource; - (*_graphicsManager._vPort)->setupViewPort(pic); + (*_graphicsManager->_vPort)->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); _eventsManager->delayClick(120); @@ -283,26 +283,26 @@ void VoyeurEngine::doClosingCredits() { const char *msg = (const char *)_bVoy->memberAddr(0x404); const byte *creditList = (const byte *)_bVoy->memberAddr(0x405); - (*_graphicsManager._vPort)->setupViewPort(NULL); - _graphicsManager.setColor(1, 180, 180, 180); - _graphicsManager.setColor(2, 200, 200, 200); + (*_graphicsManager->_vPort)->setupViewPort(NULL); + _graphicsManager->setColor(1, 180, 180, 180); + _graphicsManager->setColor(2, 200, 200, 200); _eventsManager->_intPtr._hasPalette = true; - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x402)._fontResource; - _graphicsManager._fontPtr->_foreColor = 2; - _graphicsManager._fontPtr->_backColor = 2; - _graphicsManager._fontPtr->_fontSaveBack = false; - _graphicsManager._fontPtr->_fontFlags = 0; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x402)._fontResource; + _graphicsManager->_fontPtr->_foreColor = 2; + _graphicsManager->_fontPtr->_backColor = 2; + _graphicsManager->_fontPtr->_fontSaveBack = false; + _graphicsManager->_fontPtr->_fontFlags = 0; _soundManager->startVOCPlay(152); - FontInfoResource &fi = *_graphicsManager._fontPtr; + FontInfoResource &fi = *_graphicsManager->_fontPtr; for (int idx = 0; idx < 78; ++idx) { const byte *entry = creditList + idx * 6; int flags = READ_LE_UINT16(entry + 4); if (flags & 0x10) - (*_graphicsManager._vPort)->fillPic(); + (*_graphicsManager->_vPort)->fillPic(); if (flags & 1) { fi._foreColor = 1; @@ -312,7 +312,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry)); - (*_graphicsManager._vPort)->drawText(msg); + (*_graphicsManager->_vPort)->drawText(msg); msg += strlen(msg) + 1; } @@ -324,7 +324,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry)); - (*_graphicsManager._vPort)->drawText(msg); + (*_graphicsManager->_vPort)->drawText(msg); msg += strlen(msg) + 1; } @@ -336,7 +336,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(38, READ_LE_UINT16(entry)); - (*_graphicsManager._vPort)->drawText(msg); + (*_graphicsManager->_vPort)->drawText(msg); msg += strlen(msg) + 1; fi._foreColor = 2; @@ -345,7 +345,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(198, READ_LE_UINT16(entry)); - (*_graphicsManager._vPort)->drawText(msg); + (*_graphicsManager->_vPort)->drawText(msg); msg += strlen(msg) + 1; } @@ -357,7 +357,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry)); - (*_graphicsManager._vPort)->drawText(msg); + (*_graphicsManager->_vPort)->drawText(msg); msg += strlen(msg) + 1; fi._foreColor = 2; @@ -367,7 +367,7 @@ void VoyeurEngine::doClosingCredits() { fi._justifyHeight = 240; fi._pos = Common::Point(0, READ_LE_UINT16(entry) + 13); - (*_graphicsManager._vPort)->drawText(msg); + (*_graphicsManager->_vPort)->drawText(msg); msg += strlen(msg) + 1; } @@ -381,19 +381,19 @@ void VoyeurEngine::doClosingCredits() { } _soundManager->stopVOCPlay(); - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; _bVoy->freeBoltGroup(0x400); } void VoyeurEngine::doPiracy() { - _graphicsManager.screenReset(); - _graphicsManager.setColor(1, 0, 0, 0); - _graphicsManager.setColor(2, 255, 255, 255); + _graphicsManager->screenReset(); + _graphicsManager->setColor(1, 0, 0, 0); + _graphicsManager->setColor(2, 255, 255, 255); _eventsManager->_intPtr._hasPalette = true; - (*_graphicsManager._vPort)->setupViewPort(NULL); - (*_graphicsManager._vPort)->fillPic(1); + (*_graphicsManager->_vPort)->setupViewPort(NULL); + (*_graphicsManager->_vPort)->fillPic(1); - FontInfoResource &fi = *_graphicsManager._fontPtr; + FontInfoResource &fi = *_graphicsManager->_fontPtr; fi._curFont = _bVoy->boltEntry(0x101)._fontResource; fi._foreColor = 2; fi._backColor = 2; @@ -407,7 +407,7 @@ void VoyeurEngine::doPiracy() { int yp, idx; for (idx = 0, yp = 33; idx < 10; ++idx) { fi._pos = Common::Point(0, yp); - (*_graphicsManager._vPort)->drawText(PIRACY_MESSAGE[idx]); + (*_graphicsManager->_vPort)->drawText(PIRACY_MESSAGE[idx]); yp += fi._curFont->_fontHeight + 4; } @@ -440,27 +440,27 @@ void VoyeurEngine::reviewTape() { _voy->_viewBounds = _bVoy->boltEntry(0x907)._rectResource; Common::Array<RectEntry> &hotspots = _bVoy->boltEntry(0x906)._rectResource->_entries; - _graphicsManager._backColors = _bVoy->boltEntry(0x902)._cMapResource; - _graphicsManager._backgroundPage = _bVoy->boltEntry(0x901)._picResource; - (*_graphicsManager._vPort)->setupViewPort(_graphicsManager._backgroundPage); - _graphicsManager._backColors->startFade(); + _graphicsManager->_backColors = _bVoy->boltEntry(0x902)._cMapResource; + _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x901)._picResource; + (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); - _graphicsManager.setColor(1, 32, 32, 32); - _graphicsManager.setColor(2, 96, 96, 96); - _graphicsManager.setColor(3, 160, 160, 160); - _graphicsManager.setColor(4, 224, 224, 224); - _graphicsManager.setColor(9, 24, 64, 24); - _graphicsManager.setColor(10, 64, 132, 64); - _graphicsManager.setColor(11, 100, 192, 100); - _graphicsManager.setColor(12, 120, 248, 120); + _graphicsManager->setColor(1, 32, 32, 32); + _graphicsManager->setColor(2, 96, 96, 96); + _graphicsManager->setColor(3, 160, 160, 160); + _graphicsManager->setColor(4, 224, 224, 224); + _graphicsManager->setColor(9, 24, 64, 24); + _graphicsManager->setColor(10, 64, 132, 64); + _graphicsManager->setColor(11, 100, 192, 100); + _graphicsManager->setColor(12, 120, 248, 120); _eventsManager->setCursorColor(128, 1); _eventsManager->_intPtr._hasPalette = true; - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x909)._fontResource; - _graphicsManager._fontPtr->_fontSaveBack = false; - _graphicsManager._fontPtr->_fontFlags = 0; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x909)._fontResource; + _graphicsManager->_fontPtr->_fontSaveBack = false; + _graphicsManager->_fontPtr->_fontFlags = 0; _eventsManager->getMouseInfo(); if (newX == -1) { @@ -482,37 +482,37 @@ void VoyeurEngine::reviewTape() { needRedraw = false; flipPageAndWait(); - _graphicsManager._drawPtr->_penColor = 0; - _graphicsManager._drawPtr->_pos = Common::Point(tempRect.left, tempRect.top); - _graphicsManager._backgroundPage->sFillBox(tempRect.width(), tempRect.height()); + _graphicsManager->_drawPtr->_penColor = 0; + _graphicsManager->_drawPtr->_pos = Common::Point(tempRect.left, tempRect.top); + _graphicsManager->_backgroundPage->sFillBox(tempRect.width(), tempRect.height()); int yp = 45; int eventNum = eventStart; for (int lineNum = 0; lineNum < 8 && eventNum < _voy->_eventCount; ++lineNum, ++eventNum) { - _graphicsManager._fontPtr->_picFlags = 0; - _graphicsManager._fontPtr->_picSelect = 0xff; - _graphicsManager._fontPtr->_picPick = 7; - _graphicsManager._fontPtr->_picOnOff = (lineNum == eventLine) ? 8 : 0; - _graphicsManager._fontPtr->_pos = Common::Point(68, yp); - _graphicsManager._fontPtr->_justify = ALIGN_LEFT; - _graphicsManager._fontPtr->_justifyWidth = 0; - _graphicsManager._fontPtr->_justifyHeight = 0; + _graphicsManager->_fontPtr->_picFlags = 0; + _graphicsManager->_fontPtr->_picSelect = 0xff; + _graphicsManager->_fontPtr->_picPick = 7; + _graphicsManager->_fontPtr->_picOnOff = (lineNum == eventLine) ? 8 : 0; + _graphicsManager->_fontPtr->_pos = Common::Point(68, yp); + _graphicsManager->_fontPtr->_justify = ALIGN_LEFT; + _graphicsManager->_fontPtr->_justifyWidth = 0; + _graphicsManager->_fontPtr->_justifyHeight = 0; Common::String msg = _eventsManager->getEvidString(eventNum); - _graphicsManager._backgroundPage->drawText(msg); + _graphicsManager->_backgroundPage->drawText(msg); yp += 15; } - (*_graphicsManager._vPort)->addSaveRect( - (*_graphicsManager._vPort)->_lastPage, tempRect); + (*_graphicsManager->_vPort)->addSaveRect( + (*_graphicsManager->_vPort)->_lastPage, tempRect); flipPageAndWait(); - (*_graphicsManager._vPort)->addSaveRect( - (*_graphicsManager._vPort)->_lastPage, tempRect); + (*_graphicsManager->_vPort)->addSaveRect( + (*_graphicsManager->_vPort)->_lastPage, tempRect); } - _graphicsManager.sDrawPic(cursor, *_graphicsManager._vPort, + _graphicsManager->sDrawPic(cursor, *_graphicsManager->_vPort, _eventsManager->getMousePos()); flipPageAndWait(); @@ -544,34 +544,34 @@ void VoyeurEngine::reviewTape() { flipPageAndWait(); - _graphicsManager._drawPtr->_penColor = 0; - _graphicsManager._drawPtr->_pos = Common::Point(tempRect.left, tempRect.top); - _graphicsManager._backgroundPage->sFillBox(tempRect.width(), tempRect.height()); + _graphicsManager->_drawPtr->_penColor = 0; + _graphicsManager->_drawPtr->_pos = Common::Point(tempRect.left, tempRect.top); + _graphicsManager->_backgroundPage->sFillBox(tempRect.width(), tempRect.height()); int yp = 45; int eventNum = eventStart; for (int idx = 0; idx < 8 && eventNum < _voy->_eventCount; ++idx, ++eventNum) { - _graphicsManager._fontPtr->_picFlags = 0; - _graphicsManager._fontPtr->_picSelect = 0xff; - _graphicsManager._fontPtr->_picPick = 7; - _graphicsManager._fontPtr->_picOnOff = (idx == eventLine) ? 8 : 0; - _graphicsManager._fontPtr->_pos = Common::Point(68, yp); - _graphicsManager._fontPtr->_justify = ALIGN_LEFT; - _graphicsManager._fontPtr->_justifyWidth = 0; - _graphicsManager._fontPtr->_justifyHeight = 0; + _graphicsManager->_fontPtr->_picFlags = 0; + _graphicsManager->_fontPtr->_picSelect = 0xff; + _graphicsManager->_fontPtr->_picPick = 7; + _graphicsManager->_fontPtr->_picOnOff = (idx == eventLine) ? 8 : 0; + _graphicsManager->_fontPtr->_pos = Common::Point(68, yp); + _graphicsManager->_fontPtr->_justify = ALIGN_LEFT; + _graphicsManager->_fontPtr->_justifyWidth = 0; + _graphicsManager->_fontPtr->_justifyHeight = 0; Common::String msg = _eventsManager->getEvidString(eventNum); - _graphicsManager._backgroundPage->drawText(msg); + _graphicsManager->_backgroundPage->drawText(msg); yp += 15; } - (*_graphicsManager._vPort)->addSaveRect( - (*_graphicsManager._vPort)->_lastPage, tempRect); + (*_graphicsManager->_vPort)->addSaveRect( + (*_graphicsManager->_vPort)->_lastPage, tempRect); flipPageAndWait(); - (*_graphicsManager._vPort)->addSaveRect( - (*_graphicsManager._vPort)->_lastPage, tempRect); + (*_graphicsManager->_vPort)->addSaveRect( + (*_graphicsManager->_vPort)->_lastPage, tempRect); flipPageAndWait(); _eventsManager->getMouseInfo(); @@ -651,7 +651,7 @@ void VoyeurEngine::reviewTape() { newY = _eventsManager->getMousePos().y; _voy->_fadingType = 0; _voy->_viewBounds = nullptr; - (*_graphicsManager._vPort)->setupViewPort(NULL); + (*_graphicsManager->_vPort)->setupViewPort(NULL); if (_currentVocId != -1) { _voy->_vocSecondsOffset = _voy->_RTVNum - _voy->_musicStartTime; @@ -674,13 +674,13 @@ void VoyeurEngine::reviewTape() { _voy->_vocSecondsOffset = e._computerOn; _bVoy->getBoltGroup(0x7F00); - _graphicsManager._backgroundPage = _bVoy->boltEntry(0x7F00 + + _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x7F00 + BLIND_TABLE[_audioVideoId])._picResource; - _graphicsManager._backColors = _bVoy->boltEntry(0x7F01 + + _graphicsManager->_backColors = _bVoy->boltEntry(0x7F01 + BLIND_TABLE[_audioVideoId])._cMapResource; - (*_graphicsManager._vPort)->setupViewPort(_graphicsManager._backgroundPage); - _graphicsManager._backColors->startFade(); + (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); _eventsManager->_intPtr._flashStep = 1; @@ -726,16 +726,16 @@ void VoyeurEngine::reviewTape() { } } - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; - (*_graphicsManager._vPort)->fillPic(0); + (*_graphicsManager->_vPort)->fillPic(0); flipPageAndWait(); _bVoy->freeBoltGroup(0x900); } void VoyeurEngine::doGossip() { - _graphicsManager.resetPalette(); - _graphicsManager.screenReset(); + _graphicsManager->resetPalette(); + _graphicsManager->screenReset(); if (!_bVoy->getBoltGroup(0x300)) return; @@ -753,7 +753,7 @@ void VoyeurEngine::doGossip() { // Transfer initial background to video decoder PictureResource videoFrame(decoder.getVideoTrack()->getBackSurface()); bgPic->_bounds.moveTo(0, 0); - _graphicsManager.sDrawPic(bgPic, &videoFrame, Common::Point(0, 0)); + _graphicsManager->sDrawPic(bgPic, &videoFrame, Common::Point(0, 0)); byte *frameNumsP = _bVoy->memberAddr(0x309); byte *posP = _bVoy->boltEntry(0x30A)._data; @@ -763,8 +763,8 @@ void VoyeurEngine::doGossip() { decoder.close(); // Reset the palette and clear the screen - _graphicsManager.resetPalette(); - _graphicsManager.screenReset(); + _graphicsManager->resetPalette(); + _graphicsManager->screenReset(); // Play interview video RL2Decoder decoder2; @@ -776,7 +776,7 @@ void VoyeurEngine::doGossip() { decoder2.close(); _bVoy->freeBoltGroup(0x300); - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); } void VoyeurEngine::doTapePlaying() { @@ -784,14 +784,14 @@ void VoyeurEngine::doTapePlaying() { return; _eventsManager->getMouseInfo(); - _graphicsManager._backColors = _bVoy->boltEntry(0xA01)._cMapResource; - _graphicsManager._backgroundPage = _bVoy->boltEntry(0xA00)._picResource; + _graphicsManager->_backColors = _bVoy->boltEntry(0xA01)._cMapResource; + _graphicsManager->_backgroundPage = _bVoy->boltEntry(0xA00)._picResource; PictureResource *pic = _bVoy->boltEntry(0xA02)._picResource; VInitCycleResource *cycle = _bVoy->boltEntry(0xA05)._vInitCycleResource; - (*_graphicsManager._vPort)->setupViewPort(_graphicsManager._backgroundPage); - _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(57, 30)); - _graphicsManager._backColors->startFade(); + (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(57, 30)); + _graphicsManager->_backColors->startFade(); flipPageAndWaitForFade(); cycle->vStartCycle(); @@ -933,9 +933,9 @@ int VoyeurEngine::getChooseButton() { + 6)._rectResource->_entries; int selectedIndex = -1; - (*_graphicsManager._vPort)->setupViewPort(_graphicsManager._backgroundPage); - _graphicsManager._backColors->_steps = 0; - _graphicsManager._backColors->startFade(); + (*_graphicsManager->_vPort)->setupViewPort(_graphicsManager->_backgroundPage); + _graphicsManager->_backColors->_steps = 0; + _graphicsManager->_backColors->startFade(); flipPageAndWait(); _voy->_viewBounds = _bVoy->boltEntry(_playStampGroupId + 7)._rectResource; @@ -956,7 +956,7 @@ int VoyeurEngine::getChooseButton() { selectedIndex = idx; if (selectedIndex != prevIndex) { PictureResource *btnPic = _bVoy->boltEntry(_playStampGroupId + 8 + idx)._picResource; - _graphicsManager.sDrawPic(btnPic, *_graphicsManager._vPort, + _graphicsManager->sDrawPic(btnPic, *_graphicsManager->_vPort, Common::Point(106, 200)); cursorPic = _bVoy->boltEntry(_playStampGroupId + 4)._picResource; @@ -968,11 +968,11 @@ int VoyeurEngine::getChooseButton() { if (selectedIndex == -1) { cursorPic = _bVoy->boltEntry(_playStampGroupId + 2)._picResource; PictureResource *btnPic = _bVoy->boltEntry(_playStampGroupId + 12)._picResource; - _graphicsManager.sDrawPic(btnPic, *_graphicsManager._vPort, + _graphicsManager->sDrawPic(btnPic, *_graphicsManager->_vPort, Common::Point(106, 200)); } - _graphicsManager.sDrawPic(cursorPic, *_graphicsManager._vPort, + _graphicsManager->sDrawPic(cursorPic, *_graphicsManager->_vPort, Common::Point(pt.x + 13, pt.y - 12)); flipPageAndWait(); @@ -983,9 +983,9 @@ int VoyeurEngine::getChooseButton() { } void VoyeurEngine::makeViewFinder() { - _graphicsManager._backgroundPage = _bVoy->boltEntry(0x103)._picResource; - _graphicsManager.sDrawPic(_graphicsManager._backgroundPage, - *_graphicsManager._vPort, Common::Point(0, 0)); + _graphicsManager->_backgroundPage = _bVoy->boltEntry(0x103)._picResource; + _graphicsManager->sDrawPic(_graphicsManager->_backgroundPage, + *_graphicsManager->_vPort, Common::Point(0, 0)); CMapResource *pal = _bVoy->boltEntry(0x104)._cMapResource; int palOffset = 0; @@ -1017,22 +1017,22 @@ void VoyeurEngine::makeViewFinder() { break; } - (*_graphicsManager._vPort)->drawIfaceTime(); + (*_graphicsManager->_vPort)->drawIfaceTime(); doTimeBar(); pal->startFade(); flipPageAndWaitForFade(); - _graphicsManager.setColor(241, 105, 105, 105); - _graphicsManager.setColor(242, 105, 105, 105); - _graphicsManager.setColor(243, 105, 105, 105); - _graphicsManager.setColor(palOffset + 241, 219, 235, 235); + _graphicsManager->setColor(241, 105, 105, 105); + _graphicsManager->setColor(242, 105, 105, 105); + _graphicsManager->setColor(243, 105, 105, 105); + _graphicsManager->setColor(palOffset + 241, 219, 235, 235); _eventsManager->_intPtr._hasPalette = true; } void VoyeurEngine::makeViewFinderP() { - _graphicsManager.screenReset(); + _graphicsManager->screenReset(); } void VoyeurEngine::initIFace() { @@ -1080,7 +1080,7 @@ void VoyeurEngine::initIFace() { void VoyeurEngine::doScroll(const Common::Point &pt) { Common::Rect clipRect(72, 47, 72 + 240, 47 + 148); - (*_graphicsManager._vPort)->setupViewPort(NULL, &clipRect); + (*_graphicsManager->_vPort)->setupViewPort(NULL, &clipRect); int base = 0; switch (_voy->_transitionId) { @@ -1104,18 +1104,18 @@ void VoyeurEngine::doScroll(const Common::Point &pt) { if (base) { PictureResource *pic = _bVoy->boltEntry(base + 3)._picResource; - _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point(784 - pt.x - 712, 150 - pt.y - 104)); + _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)); + _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)); + _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)); + _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->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point(784 - pt.x - 712, 150 - pt.y + 136)); } - (*_graphicsManager._vPort)->setupViewPort(NULL); + (*_graphicsManager->_vPort)->setupViewPort(NULL); } void VoyeurEngine::checkTransition() { @@ -1127,7 +1127,7 @@ void VoyeurEngine::checkTransition() { // Only proceed if a valid day string was returned if (!day.empty()) { - _graphicsManager.fadeDownICF(6); + _graphicsManager->fadeDownICF(6); // Get the time of day string time = getTimeOfDay(); @@ -1165,7 +1165,7 @@ Common::String VoyeurEngine::getTimeOfDay() { } int VoyeurEngine::doComputerText(int maxLen) { - FontInfoResource &font = *_graphicsManager._fontPtr; + FontInfoResource &font = *_graphicsManager->_fontPtr; int totalChars = 0; font._curFont = _bVoy->boltEntry(0x4910)._fontResource; @@ -1182,7 +1182,7 @@ int VoyeurEngine::doComputerText(int maxLen) { font._justifyWidth = 384; font._justifyHeight = 100; font._pos = Common::Point(128, 100); - (*_graphicsManager._vPort)->drawText(END_OF_MESSAGE); + (*_graphicsManager->_vPort)->drawText(END_OF_MESSAGE); } else if (_voy->_RTVNum < _voy->_computerTimeMin && maxLen == 9999) { if (_currentVocId != -1) _soundManager->startVOCPlay(_currentVocId); @@ -1190,7 +1190,7 @@ int VoyeurEngine::doComputerText(int maxLen) { font._justifyWidth = 384; font._justifyHeight = 100; font._pos = Common::Point(120, 100); - (*_graphicsManager._vPort)->drawText(START_OF_MESSAGE); + (*_graphicsManager->_vPort)->drawText(START_OF_MESSAGE); } else { char *msg = (char *)_bVoy->memberAddr(0x4900 + _voy->_computerTextId); font._pos = Common::Point(96, 60); @@ -1208,14 +1208,14 @@ int VoyeurEngine::doComputerText(int maxLen) { if (c == '\0') { if (showEnd) { _eventsManager->delay(90); - _graphicsManager._drawPtr->_pos = Common::Point(96, 54); - _graphicsManager._drawPtr->_penColor = 254; - (*_graphicsManager._vPort)->sFillBox(196, 124); - _graphicsManager._fontPtr->_justify = ALIGN_LEFT; - _graphicsManager._fontPtr->_justifyWidth = 384; - _graphicsManager._fontPtr->_justifyHeight = 100; - _graphicsManager._fontPtr->_pos = Common::Point(128, 100); - (*_graphicsManager._vPort)->drawText(END_OF_MESSAGE); + _graphicsManager->_drawPtr->_pos = Common::Point(96, 54); + _graphicsManager->_drawPtr->_penColor = 254; + (*_graphicsManager->_vPort)->sFillBox(196, 124); + _graphicsManager->_fontPtr->_justify = ALIGN_LEFT; + _graphicsManager->_fontPtr->_justifyWidth = 384; + _graphicsManager->_fontPtr->_justifyHeight = 100; + _graphicsManager->_fontPtr->_pos = Common::Point(128, 100); + (*_graphicsManager->_vPort)->drawText(END_OF_MESSAGE); } break; } @@ -1225,20 +1225,20 @@ int VoyeurEngine::doComputerText(int maxLen) { yp += 10; } else { _eventsManager->delay(90); - _graphicsManager._drawPtr->_pos = Common::Point(96, 54); - _graphicsManager._drawPtr->_penColor = 255; - (*_graphicsManager._vPort)->sFillBox(196, 124); + _graphicsManager->_drawPtr->_pos = Common::Point(96, 54); + _graphicsManager->_drawPtr->_penColor = 255; + (*_graphicsManager->_vPort)->sFillBox(196, 124); yp = 60; } - _graphicsManager._fontPtr->_pos = Common::Point(96, yp); + _graphicsManager->_fontPtr->_pos = Common::Point(96, yp); } else if (c == '_') { showEnd = false; } else { - _graphicsManager._fontPtr->_justify = ALIGN_LEFT; - _graphicsManager._fontPtr->_justifyWidth = 0; - _graphicsManager._fontPtr->_justifyHeight = 0; - (*_graphicsManager._vPort)->drawText(Common::String(c)); + _graphicsManager->_fontPtr->_justify = ALIGN_LEFT; + _graphicsManager->_fontPtr->_justifyWidth = 0; + _graphicsManager->_fontPtr->_justifyHeight = 0; + (*_graphicsManager->_vPort)->drawText(Common::String(c)); _eventsManager->delay(4); } @@ -1253,7 +1253,7 @@ int VoyeurEngine::doComputerText(int maxLen) { flipPageAndWait(); - _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; + _graphicsManager->_fontPtr->_curFont = _bVoy->boltEntry(0x101)._fontResource; return totalChars; } @@ -1263,7 +1263,7 @@ void VoyeurEngine::getComputerBrush() { int xp = (384 - pic->_bounds.width()) / 2; int yp = (240 - pic->_bounds.height()) / 2 - 4; - (*_graphicsManager._vPort)->drawPicPerm(pic, Common::Point(xp, yp)); + (*_graphicsManager->_vPort)->drawPicPerm(pic, Common::Point(xp, yp)); CMapResource *pal = _bVoy->boltEntry(0x490F)._cMapResource; pal->startFade(); @@ -1281,17 +1281,17 @@ void VoyeurEngine::doTimeBar() { int height = ((_voy->_RTVLimit - _voy->_RTVNum) * 59) / _voy->_RTVLimit; int fullHeight = MAX(151 - height, 93); - _graphicsManager._drawPtr->_penColor = 134; - _graphicsManager._drawPtr->_pos = Common::Point(39, 92); + _graphicsManager->_drawPtr->_penColor = 134; + _graphicsManager->_drawPtr->_pos = Common::Point(39, 92); - (*_graphicsManager._vPort)->sFillBox(6, fullHeight - 92); + (*_graphicsManager->_vPort)->sFillBox(6, fullHeight - 92); if (height > 0) { - _graphicsManager.setColor(215, 238, 238, 238); + _graphicsManager->setColor(215, 238, 238, 238); _eventsManager->_intPtr._hasPalette = true; - _graphicsManager._drawPtr->_penColor = 215; - _graphicsManager._drawPtr->_pos = Common::Point(39, fullHeight); - (*_graphicsManager._vPort)->sFillBox(6, height); + _graphicsManager->_drawPtr->_penColor = 215; + _graphicsManager->_drawPtr->_pos = Common::Point(39, fullHeight); + (*_graphicsManager->_vPort)->sFillBox(6, height); } } } @@ -1304,9 +1304,9 @@ void VoyeurEngine::flashTimeBar() { _flashTimeVal = _eventsManager->_intPtr._flashTimer; if (_flashTimeFlag) - _graphicsManager.setColor(240, 220, 20, 20); + _graphicsManager->setColor(240, 220, 20, 20); else - _graphicsManager.setColor(240, 220, 220, 220); + _graphicsManager->setColor(240, 220, 220, 220); _eventsManager->_intPtr._hasPalette = true; _flashTimeFlag = !_flashTimeFlag; @@ -1344,7 +1344,7 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { _bVoy->getBoltGroup(_voy->_boltGroupId2); PictureResource *pic = _bVoy->boltEntry(_voy->_boltGroupId2 + evidId * 2)._picResource; - _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, Common::Point( + _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point( (384 - pic->_bounds.width()) / 2, (240 - pic->_bounds.height()) / 2)); _bVoy->freeBoltMember(_voy->_boltGroupId2 + evidId * 2); @@ -1395,7 +1395,7 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { continue; pic = _voy->_evPicPtrs[arrIndex]; - _graphicsManager.sDrawPic(pic, *_graphicsManager._vPort, + _graphicsManager->sDrawPic(pic, *_graphicsManager->_vPort, Common::Point((384 - pic->_bounds.width()) / 2, (240 - pic->_bounds.height()) / 2)); _voy->_evCmPtrs[arrIndex]->startFade(); |