diff options
author | Strangerke | 2014-02-27 07:29:49 +0100 |
---|---|---|
committer | Strangerke | 2014-02-27 07:29:49 +0100 |
commit | 9f74d13c57033f5cf60b711021f0b0b1e8697f9e (patch) | |
tree | d4e554e4f8a96a3cd40bcf9de8c690be2274b868 /engines/voyeur | |
parent | 9278ec342caf1c47ca5882103bb587ec40ab93e6 (diff) | |
download | scummvm-rg350-9f74d13c57033f5cf60b711021f0b0b1e8697f9e.tar.gz scummvm-rg350-9f74d13c57033f5cf60b711021f0b0b1e8697f9e.tar.bz2 scummvm-rg350-9f74d13c57033f5cf60b711021f0b0b1e8697f9e.zip |
VOYEUR: Remove setVm from EventManager
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/animation.cpp | 4 | ||||
-rw-r--r-- | engines/voyeur/data.cpp | 4 | ||||
-rw-r--r-- | engines/voyeur/events.cpp | 32 | ||||
-rw-r--r-- | engines/voyeur/events.h | 3 | ||||
-rw-r--r-- | engines/voyeur/files.cpp | 6 | ||||
-rw-r--r-- | engines/voyeur/files_threads.cpp | 164 | ||||
-rw-r--r-- | engines/voyeur/graphics.cpp | 22 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 114 | ||||
-rw-r--r-- | engines/voyeur/voyeur.h | 2 | ||||
-rw-r--r-- | engines/voyeur/voyeur_game.cpp | 166 |
10 files changed, 259 insertions, 258 deletions
diff --git a/engines/voyeur/animation.cpp b/engines/voyeur/animation.cpp index 40ea92f13b..86ab7001d9 100644 --- a/engines/voyeur/animation.cpp +++ b/engines/voyeur/animation.cpp @@ -467,7 +467,7 @@ void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset, PictureResource videoFrame(getVideoTrack()->getBackSurface()); int picCtr = 0; - while (!vm->shouldQuit() && !endOfVideo() && !vm->_eventsManager._mouseClicked) { + while (!vm->shouldQuit() && !endOfVideo() && !vm->_eventsManager->_mouseClicked) { if (hasDirtyPalette()) { const byte *palette = getPalette(); @@ -494,7 +494,7 @@ void RL2Decoder::play(VoyeurEngine *vm, int resourceOffset, (byte *)vm->_graphicsManager._screenSurface.getPixels()); } - vm->_eventsManager.getMouseInfo(); + vm->_eventsManager->getMouseInfo(); g_system->delayMillis(10); } } diff --git a/engines/voyeur/data.cpp b/engines/voyeur/data.cpp index 1b5b576a23..b54160a917 100644 --- a/engines/voyeur/data.cpp +++ b/engines/voyeur/data.cpp @@ -168,7 +168,7 @@ void SVoy::addVideoEventStart() { e._type = EVTYPE_VIDEO; e._audioVideoId = _vm->_audioVideoId; e._computerOn = _vocSecondsOffset; - e._dead = _vm->_eventsManager._videoDead; + e._dead = _vm->_eventsManager->_videoDead; } void SVoy::addVideoEventEnd() { @@ -186,7 +186,7 @@ void SVoy::addAudioEventStart() { e._type = EVTYPE_AUDIO; e._audioVideoId = _vm->_audioVideoId; e._computerOn = _vocSecondsOffset; - e._dead = _vm->_eventsManager._videoDead; + e._dead = _vm->_eventsManager->_videoDead; } void SVoy::addAudioEventEnd() { diff --git a/engines/voyeur/events.cpp b/engines/voyeur/events.cpp index ea726ac0ff..0e948d8dc3 100644 --- a/engines/voyeur/events.cpp +++ b/engines/voyeur/events.cpp @@ -61,8 +61,8 @@ IntData::IntData() { /*------------------------------------------------------------------------*/ -EventsManager::EventsManager(): _intPtr(_gameData), - _fadeIntNode(0, 0, 3), _cycleIntNode(0, 0, 3) { +EventsManager::EventsManager(VoyeurEngine *vm) : _intPtr(_gameData), + _fadeIntNode(0, 0, 3), _cycleIntNode(0, 0, 3), _vm(vm) { _cycleStatus = 0; _fadeStatus = 0; _priorFrameTime = g_system->getMillis(); @@ -244,7 +244,7 @@ void EventsManager::delayClick(int cycles) { g_system->delayMillis(10); getMouseInfo(); } while (!_vm->shouldQuit() && g_system->getMillis() < delayEnd - && !_vm->_eventsManager._mouseClicked); + && !_vm->_eventsManager->_mouseClicked); } void EventsManager::pollEvents() { @@ -268,18 +268,18 @@ void EventsManager::pollEvents() { } return; case Common::EVENT_LBUTTONDOWN: - _vm->_eventsManager._newLeftClick = true; - _vm->_eventsManager._newMouseClicked = true; + _vm->_eventsManager->_newLeftClick = true; + _vm->_eventsManager->_newMouseClicked = true; return; case Common::EVENT_RBUTTONDOWN: - _vm->_eventsManager._newRightClick = true; - _vm->_eventsManager._newMouseClicked = true; + _vm->_eventsManager->_newRightClick = true; + _vm->_eventsManager->_newMouseClicked = true; return; case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: - _vm->_eventsManager._newMouseClicked = false; - _vm->_eventsManager._newLeftClick = false; - _vm->_eventsManager._newRightClick = false; + _vm->_eventsManager->_newMouseClicked = false; + _vm->_eventsManager->_newLeftClick = false; + _vm->_eventsManager->_newRightClick = false; return; case Common::EVENT_MOUSEMOVE: _mousePos = event.mouse; @@ -576,13 +576,13 @@ void EventsManager::getMouseInfo() { } } - _vm->_eventsManager._mouseClicked = _vm->_eventsManager._newMouseClicked; - _vm->_eventsManager._leftClick = _vm->_eventsManager._newLeftClick; - _vm->_eventsManager._rightClick = _vm->_eventsManager._newRightClick; + _vm->_eventsManager->_mouseClicked = _vm->_eventsManager->_newMouseClicked; + _vm->_eventsManager->_leftClick = _vm->_eventsManager->_newLeftClick; + _vm->_eventsManager->_rightClick = _vm->_eventsManager->_newRightClick; - _vm->_eventsManager._newMouseClicked = false; - _vm->_eventsManager._newLeftClick = false; - _vm->_eventsManager._newRightClick = false; + _vm->_eventsManager->_newMouseClicked = false; + _vm->_eventsManager->_newLeftClick = false; + _vm->_eventsManager->_newRightClick = false; } void EventsManager::startCursorBlink() { diff --git a/engines/voyeur/events.h b/engines/voyeur/events.h index c032d35224..6f63ac09ee 100644 --- a/engines/voyeur/events.h +++ b/engines/voyeur/events.h @@ -112,8 +112,7 @@ public: byte *_cycleNext[4]; VInitCycleResource *_cyclePtr; - EventsManager(); - void setVm(VoyeurEngine *vm) { _vm = vm; } + EventsManager(VoyeurEngine *vm); void setMousePos(const Common::Point &p) { _mousePos = p; } void startMainClockInt(); diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index 6fe76e246f..f788e66833 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -1530,7 +1530,7 @@ CMapResource::~CMapResource() { } void CMapResource::startFade() { - _vm->_eventsManager.startFade(this); + _vm->_eventsManager->startFade(this); } /*------------------------------------------------------------------------*/ @@ -1545,7 +1545,7 @@ VInitCycleResource::VInitCycleResource(BoltFilesState &state, const byte *src): } void VInitCycleResource::vStartCycle() { - EventsManager &evt = _state._vm->_eventsManager; + EventsManager &evt = *_state._vm->_eventsManager; evt._cycleIntNode._flags |= 1; evt._cyclePtr = this; @@ -1559,7 +1559,7 @@ void VInitCycleResource::vStartCycle() { } void VInitCycleResource::vStopCycle() { - EventsManager &evt = _state._vm->_eventsManager; + EventsManager &evt = *_state._vm->_eventsManager; evt._cycleIntNode._flags |= 1; evt._cycleStatus &= ~1; } diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index b03e9ac99c..385e61ecee 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -327,7 +327,7 @@ void ThreadResource::parsePlayCommands() { _vm->_voy->_boltGroupId2 = -1; _vm->_voy->_computerTextId = -1; _vm->_voy->_eventFlags &= ~EVTFLAG_8; - _vm->_eventsManager._videoDead = -1; + _vm->_eventsManager->_videoDead = -1; // Reset hotspot data _vm->_voy->_videoHotspotTimes.reset(); @@ -372,8 +372,8 @@ void ThreadResource::parsePlayCommands() { _vm->playAudio(_vm->_audioVideoId); _vm->_voy->addAudioEventEnd(); - _vm->_eventsManager.incrementTime(1); - _vm->_eventsManager.incrementTime(1); + _vm->_eventsManager->incrementTime(1); + _vm->_eventsManager->incrementTime(1); _vm->_audioVideoId = -1; parseIndex = 999; } @@ -404,19 +404,19 @@ void ThreadResource::parsePlayCommands() { _vm->_voy->_eventFlags &= ~EVTFLAG_RECORDING; _vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED; _vm->_voy->addVideoEventEnd(); - _vm->_eventsManager.incrementTime(1); + _vm->_eventsManager->incrementTime(1); _vm->_audioVideoId = -1; _vm->_playStampGroupId = -1; - if (_vm->_eventsManager._videoDead != -1) { + if (_vm->_eventsManager->_videoDead != -1) { _vm->_bVoy->freeBoltGroup(0xE00); - _vm->_eventsManager._videoDead = -1; + _vm->_eventsManager->_videoDead = -1; _vm->flipPageAndWait(); } - _vm->_eventsManager._videoDead = -1; - if (_stateCount == 2 && _vm->_eventsManager._mouseClicked == 0) { + _vm->_eventsManager->_videoDead = -1; + if (_stateCount == 2 && _vm->_eventsManager->_mouseClicked == 0) { _vm->_voy->_playStampMode = 132; parseIndex = 999; } else { @@ -452,7 +452,7 @@ void ThreadResource::parsePlayCommands() { } else { int count = _vm->_bVoy->getBoltGroup(_vm->_playStampGroupId)->_entries.size() / 2; _vm->_soundManager->stopVOCPlay(); - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); for (int i = 0; i < count; ++i) { pic = _vm->_bVoy->boltEntry(_vm->_playStampGroupId + i * 2)._picResource; @@ -471,18 +471,18 @@ void ThreadResource::parsePlayCommands() { Common::String file = Common::String::format("news%d.voc", i + 1); _vm->_soundManager->startVOCPlay(file); - while (!_vm->shouldQuit() && !_vm->_eventsManager._mouseClicked && + while (!_vm->shouldQuit() && !_vm->_eventsManager->_mouseClicked && _vm->_soundManager->getVOCStatus()) { - _vm->_eventsManager.delayClick(1); - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->delayClick(1); + _vm->_eventsManager->getMouseInfo(); } _vm->_soundManager->stopVOCPlay(); if (i == (count - 1)) - _vm->_eventsManager.delayClick(480); + _vm->_eventsManager->delayClick(480); - if (_vm->shouldQuit() || _vm->_eventsManager._mouseClicked) + if (_vm->shouldQuit() || _vm->_eventsManager->_mouseClicked) break; } @@ -957,7 +957,7 @@ int ThreadResource::doApt() { _vm->_voy->_viewBounds = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._rectResource; Common::Array<RectEntry> &hotspots = _vm->_bVoy->boltEntry( _vm->_playStampGroupId + 1)._rectResource->_entries; - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); // Very first time apartment is shown, start the phone message if (_aptPos.x == -1) { @@ -973,7 +973,7 @@ int ThreadResource::doApt() { _aptPos.y = hotspots[4].top + 28; } - _vm->_eventsManager.setMousePos(Common::Point(_aptPos.x, _aptPos.y)); + _vm->_eventsManager->setMousePos(Common::Point(_aptPos.x, _aptPos.y)); _vm->_soundManager->startVOCPlay(_vm->_soundManager->getVOCFileName(_vm->_currentVocId)); _vm->_currentVocId = 151; @@ -982,7 +982,7 @@ int ThreadResource::doApt() { _vm->_graphicsManager.setColor(131, 215, 215, 215); _vm->_graphicsManager.setColor(132, 235, 235, 235); - _vm->_eventsManager._intPtr._hasPalette = true; + _vm->_eventsManager->_intPtr._hasPalette = true; // Main loop to allow users to move the cursor and select hotspots int hotspotId; @@ -1000,7 +1000,7 @@ int ThreadResource::doApt() { _vm->_loadGameSlot = -1; } - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); if (!_vm->_soundManager->getVOCStatus()) { // Previous sound ended, so start up a new one _vm->_currentVocId = 151 - _vm->getRandomNumber(4); @@ -1009,7 +1009,7 @@ int ThreadResource::doApt() { // Loop through the hotspot list hotspotId = -1; - pt = _vm->_eventsManager.getMousePos(); + pt = _vm->_eventsManager->getMousePos(); for (int idx = 0; idx < (int)hotspots.size(); ++idx) { if (hotspots[idx].contains(pt)) { // Cursor is within hotspot area @@ -1049,15 +1049,15 @@ int ThreadResource::doApt() { _vm->flipPageAndWait(); - if (hotspotId == 42 && _vm->_eventsManager._leftClick) { + if (hotspotId == 42 && _vm->_eventsManager->_leftClick) { // Show the ScummVM GMM - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); _vm->openMainMenuDialog(); } - } while (!_vm->shouldQuit() && (!_vm->_eventsManager._leftClick || hotspotId == -1)); + } while (!_vm->shouldQuit() && (!_vm->_eventsManager->_leftClick || hotspotId == -1)); - pt = _vm->_eventsManager.getMousePos(); + pt = _vm->_eventsManager->getMousePos(); _aptPos.x = pt.x; _aptPos.y = pt.y; @@ -1112,13 +1112,13 @@ void ThreadResource::doRoom() { PictureResource *crosshairsCursor = vm._bVoy->boltEntry(vm._playStampGroupId + 2)._picResource; PictureResource *magnifierCursor = vm._bVoy->boltEntry(vm._playStampGroupId + 3)._picResource; - vm._eventsManager.showCursor(); + vm._eventsManager->showCursor(); RectResource viewBounds(48, 38, 336, 202); voy._viewBounds = &viewBounds; - vm._eventsManager.getMouseInfo(); - vm._eventsManager.setMousePos(Common::Point(192, 120)); + vm._eventsManager->getMouseInfo(); + vm._eventsManager->setMousePos(Common::Point(192, 120)); voy._fadingType = 0; vm._currentVocId = 146; voy._musicStartTime = voy._RTVNum; @@ -1131,7 +1131,7 @@ void ThreadResource::doRoom() { while (!vm.shouldQuit() && !breakFlag) { _vm->_voyeurArea = AREA_ROOM; vm._graphicsManager.setColor(128, 0, 255, 0); - vm._eventsManager._intPtr._hasPalette = true; + vm._eventsManager->_intPtr._hasPalette = true; do { if (vm._currentVocId != -1 && !vm._soundManager->getVOCStatus()) { @@ -1140,8 +1140,8 @@ void ThreadResource::doRoom() { vm._soundManager->startVOCPlay(vm._currentVocId); } - vm._eventsManager.getMouseInfo(); - Common::Point pt = vm._eventsManager.getMousePos(); + vm._eventsManager->getMouseInfo(); + Common::Point pt = vm._eventsManager->getMousePos(); pt += Common::Point(30, 15); hotspotId = -1; @@ -1159,33 +1159,33 @@ void ThreadResource::doRoom() { } if (hotspotId == -1) { - vm._eventsManager.setCursorColor(128, 0); - vm._eventsManager.setCursor(crosshairsCursor); + vm._eventsManager->setCursorColor(128, 0); + vm._eventsManager->setCursor(crosshairsCursor); } else if (hotspotId != 999 || voy._RTVNum < voy._computerTimeMin || (voy._computerTimeMax - 2) < voy._RTVNum) { - vm._eventsManager.setCursorColor(128, 1); - vm._eventsManager.setCursor(magnifierCursor); + vm._eventsManager->setCursorColor(128, 1); + vm._eventsManager->setCursor(magnifierCursor); } else { - vm._eventsManager.setCursorColor(128, 2); - vm._eventsManager.setCursor(magnifierCursor); + vm._eventsManager->setCursorColor(128, 2); + vm._eventsManager->setCursor(magnifierCursor); } - vm._eventsManager._intPtr._hasPalette = true; + vm._eventsManager->_intPtr._hasPalette = true; vm._graphicsManager.flipPage(); - vm._eventsManager.sWaitFlip(); - } while (!vm.shouldQuit() && !vm._eventsManager._mouseClicked); + vm._eventsManager->sWaitFlip(); + } while (!vm.shouldQuit() && !vm._eventsManager->_mouseClicked); - if (!vm._eventsManager._leftClick || hotspotId == -1) { - if (vm._eventsManager._rightClick) + if (!vm._eventsManager->_leftClick || hotspotId == -1) { + if (vm._eventsManager->_rightClick) breakFlag = true; - Common::Point pt = vm._eventsManager.getMousePos(); - vm._eventsManager.getMouseInfo(); - vm._eventsManager.setMousePos(pt); + Common::Point pt = vm._eventsManager->getMousePos(); + vm._eventsManager->getMouseInfo(); + vm._eventsManager->setMousePos(pt); } else { voy._eventFlags |= EVTFLAG_RECORDING; - vm._eventsManager.hideCursor(); - vm._eventsManager.startCursorBlink(); + vm._eventsManager->hideCursor(); + vm._eventsManager->startCursorBlink(); if (hotspotId == 999) { _vm->flipPageAndWait(); @@ -1200,8 +1200,8 @@ void ThreadResource::doRoom() { vm._voy->addComputerEventStart(); - vm._eventsManager._mouseClicked = false; - vm._eventsManager.startCursorBlink(); + vm._eventsManager->_mouseClicked = false; + vm._eventsManager->startCursorBlink(); int totalChars = vm.doComputerText(9999); if (totalChars) @@ -1213,8 +1213,8 @@ void ThreadResource::doRoom() { } voy._eventFlags &= ~EVTFLAG_RECORDING; - if (!vm._eventsManager._mouseClicked) - vm._eventsManager.delayClick(18000); + if (!vm._eventsManager->_mouseClicked) + vm._eventsManager->delayClick(18000); // WORKAROUND: Skipped code from the original, that freed the group, // reloaded it, and reloaded the cursors @@ -1228,9 +1228,9 @@ void ThreadResource::doRoom() { vm._graphicsManager._backColors->startFade(); _vm->flipPageAndWait(); - while (!vm.shouldQuit() && (vm._eventsManager._fadeStatus & 1)) - vm._eventsManager.delay(1); - vm._eventsManager.hideCursor(); + while (!vm.shouldQuit() && (vm._eventsManager->_fadeStatus & 1)) + vm._eventsManager->delay(1); + vm._eventsManager->hideCursor(); while (!vm.shouldQuit() && voy._fadingAmount2 > 0) { if (voy._fadingAmount1 < 63) { @@ -1245,19 +1245,19 @@ void ThreadResource::doRoom() { voy._fadingAmount2 = 0; } - vm._eventsManager.delay(1); + vm._eventsManager->delay(1); } _vm->flipPageAndWait(); vm._graphicsManager.fadeUpICF1(); voy._eventFlags &= EVTFLAG_RECORDING; - vm._eventsManager.showCursor(); + vm._eventsManager->showCursor(); } } voy._eventFlags = EVTFLAG_TIME_DISABLED; - vm._eventsManager.incrementTime(1); + vm._eventsManager->incrementTime(1); voy._viewBounds = nullptr; voy._fadingType = 0; vm.makeViewFinderP(); @@ -1277,7 +1277,7 @@ void ThreadResource::doRoom() { vm._currentVocId = -1; } - vm._eventsManager.hideCursor(); + vm._eventsManager->hideCursor(); chooseSTAMPButton(0); } @@ -1293,8 +1293,8 @@ int ThreadResource::doInterface() { _vm->_voy->_eventFlags &= ~EVTFLAG_100; _vm->_playStampGroupId = -1; - _vm->_eventsManager._intPtr._flashStep = 1; - _vm->_eventsManager._intPtr._flashTimer = 0; + _vm->_eventsManager->_intPtr._flashStep = 1; + _vm->_eventsManager->_intPtr._flashTimer = 0; if (_vm->_voy->_RTVNum >= _vm->_voy->_RTVLimit || _vm->_voy->_RTVNum < 0) _vm->_voy->_RTVNum = _vm->_voy->_RTVLimit - 1; @@ -1310,7 +1310,7 @@ int ThreadResource::doInterface() { while (!_vm->shouldQuit() && _vm->_voy->_RTVNum < _vm->_voy->_RTVLimit) { _vm->flashTimeBar(); - _vm->_eventsManager.delayClick(1); + _vm->_eventsManager->delayClick(1); } _vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED; @@ -1320,7 +1320,7 @@ int ThreadResource::doInterface() { _vm->checkTransition(); _vm->makeViewFinder(); - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); _vm->initIFace(); Common::Array<RectEntry> *hotspots = &_vm->_bVoy->boltEntry( @@ -1330,10 +1330,10 @@ int ThreadResource::doInterface() { Common::String fname = _vm->_soundManager->getVOCFileName(_vm->_currentVocId); _vm->_soundManager->startVOCPlay(fname); - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); _vm->_graphicsManager.setColor(240, 220, 220, 220); - _vm->_eventsManager._intPtr._hasPalette = true; + _vm->_eventsManager->_intPtr._hasPalette = true; _vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; // Set the cusor @@ -1342,7 +1342,7 @@ int ThreadResource::doInterface() { PictureResource *listenCursor = _vm->_bVoy->boltEntry(0x114)._picResource; PictureResource *mangifyCursor = _vm->_bVoy->boltEntry(0x115)._picResource; - _vm->_eventsManager.setCursor(crosshairsCursor); + _vm->_eventsManager->setCursor(crosshairsCursor); // Main loop int regionIndex = 0; @@ -1352,7 +1352,7 @@ int ThreadResource::doInterface() { do { _vm->_voyeurArea = AREA_INTERFACE; _vm->doTimeBar(); - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); if (checkMansionScroll()) _vm->doScroll(_vm->_mansionViewPos); @@ -1364,7 +1364,7 @@ int ThreadResource::doInterface() { } // Calculate the mouse position within the entire mansion - pt = _vm->_eventsManager.getMousePos(); + pt = _vm->_eventsManager->getMousePos(); if (!mansionViewBounds.contains(pt)) pt = Common::Point(-1, -1); else @@ -1378,13 +1378,13 @@ int ThreadResource::doInterface() { for (int arrIndex = 0; arrIndex < 3; ++arrIndex) { if (_vm->_voy->_audioHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy->_RTVNum)) { // Set the ear cursor for an audio event - _vm->_eventsManager.setCursor(listenCursor); + _vm->_eventsManager->setCursor(listenCursor); regionIndex = hotspotIdx; } if (_vm->_voy->_evidenceHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy->_RTVNum)) { // Set the magnifier cursor for an evidence event - _vm->_eventsManager.setCursor(mangifyCursor); + _vm->_eventsManager->setCursor(mangifyCursor); regionIndex = hotspotIdx; } } @@ -1392,7 +1392,7 @@ int ThreadResource::doInterface() { for (int arrIndex = 0; arrIndex < 8; ++arrIndex) { if (_vm->_voy->_videoHotspotTimes.isInRange(arrIndex, hotspotIdx, _vm->_voy->_RTVNum)) { // Set the eye cursor for a video event - _vm->_eventsManager.setCursor(eyeCursor); + _vm->_eventsManager->setCursor(eyeCursor); regionIndex = hotspotIdx; } } @@ -1401,7 +1401,7 @@ int ThreadResource::doInterface() { if (regionIndex == -1) { // Reset back to the crosshairs cursor - _vm->_eventsManager.setCursor(crosshairsCursor); + _vm->_eventsManager->setCursor(crosshairsCursor); } // Regularly update the time display @@ -1427,18 +1427,18 @@ int ThreadResource::doInterface() { _vm->_voy->_RTANum = 0; _vm->flipPageAndWait(); - pt = _vm->_eventsManager.getMousePos(); + pt = _vm->_eventsManager->getMousePos(); if ((_vm->_voy->_RTVNum >= _vm->_voy->_RTVLimit) || ((_vm->_voy->_eventFlags & 0x80) && - _vm->_eventsManager._rightClick && (pt.x == 0))) { + _vm->_eventsManager->_rightClick && (pt.x == 0))) { // Time to transition to the next time period - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); if (_vm->_voy->_transitionId == 15) { regionIndex = 20; _vm->_voy->_transitionId = 17; _vm->_soundManager->stopVOCPlay(); _vm->checkTransition(); - _vm->_eventsManager._leftClick = true; + _vm->_eventsManager->_leftClick = true; } else { _vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED; @@ -1450,27 +1450,27 @@ int ThreadResource::doInterface() { _vm->initIFace(); hotspots = &_vm->_bVoy->boltEntry(_vm->_playStampGroupId + 1)._rectResource->_entries; - _vm->_eventsManager.getMouseInfo(); + _vm->_eventsManager->getMouseInfo(); _vm->_voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; - _vm->_eventsManager._intPtr._flashStep = 1; - _vm->_eventsManager._intPtr._flashTimer = 0; + _vm->_eventsManager->_intPtr._flashStep = 1; + _vm->_eventsManager->_intPtr._flashTimer = 0; } } - } while (!_vm->_eventsManager._rightClick && !_vm->shouldQuit() && - (!_vm->_eventsManager._leftClick || regionIndex == -1)); + } while (!_vm->_eventsManager->_rightClick && !_vm->shouldQuit() && + (!_vm->_eventsManager->_leftClick || regionIndex == -1)); - _vm->_eventsManager.hideCursor(); + _vm->_eventsManager->hideCursor(); _vm->_voy->_eventFlags |= EVTFLAG_TIME_DISABLED; _vm->_bVoy->freeBoltGroup(_vm->_playStampGroupId); if (_vm->_currentVocId != -1) _vm->_soundManager->stopVOCPlay(); - return !_vm->_eventsManager._rightClick ? regionIndex : -2; + return !_vm->_eventsManager->_rightClick ? regionIndex : -2; } bool ThreadResource::checkMansionScroll() { - Common::Point pt = _vm->_eventsManager.getMousePos() - + Common::Point pt = _vm->_eventsManager->getMousePos() - Common::Point(MANSION_VIEW_X, MANSION_VIEW_Y); Common::Point &viewPos = _vm->_mansionViewPos; bool result = false; @@ -1689,7 +1689,7 @@ void ThreadResource::doAptAnim(int mode) { pal->startFade(); _vm->flipPageAndWait(); - _vm->_eventsManager.delayClick(5); + _vm->_eventsManager->delayClick(5); } _vm->_bVoy->freeBoltGroup(id); diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 0f70a23cf2..a4dc27bd02 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -845,7 +845,7 @@ void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *des } if (cursorData) { - _vm->_eventsManager.setCursor(cursorData, width2, height1); + _vm->_eventsManager->setCursor(cursorData, width2, height1); delete[] cursorData; } } @@ -877,7 +877,7 @@ void GraphicsManager::fillPic(DisplayResource *display, byte onOff) { * Queues the given picture for display */ void GraphicsManager::sDisplayPic(PictureResource *pic) { - _vm->_eventsManager._intPtr._flipWait = true; + _vm->_eventsManager->_intPtr._flipWait = true; } void GraphicsManager::flipPage() { @@ -940,7 +940,7 @@ void GraphicsManager::clearPalette() { void GraphicsManager::setPalette(const byte *palette, int start, int count) { g_system->getPaletteManager()->setPalette(palette, start, count); - _vm->_eventsManager._gameData._hasPalette = false; + _vm->_eventsManager->_gameData._hasPalette = false; } void GraphicsManager::setPalette128(const byte *palette, int start, int count) { @@ -955,7 +955,7 @@ void GraphicsManager::resetPalette() { for (int i = 0; i < 256; ++i) setColor(i, 0, 0, 0); - _vm->_eventsManager._intPtr._hasPalette = true; + _vm->_eventsManager->_intPtr._hasPalette = true; } void GraphicsManager::setColor(int idx, byte r, byte g, byte b) { @@ -964,8 +964,8 @@ void GraphicsManager::setColor(int idx, byte r, byte g, byte b) { vgaP[1] = g; vgaP[2] = b; - _vm->_eventsManager._intPtr._palStartIndex = MIN(_vm->_eventsManager._intPtr._palStartIndex, idx); - _vm->_eventsManager._intPtr._palEndIndex = MAX(_vm->_eventsManager._intPtr._palEndIndex, idx); + _vm->_eventsManager->_intPtr._palStartIndex = MIN(_vm->_eventsManager->_intPtr._palStartIndex, idx); + _vm->_eventsManager->_intPtr._palEndIndex = MAX(_vm->_eventsManager->_intPtr._palEndIndex, idx); } void GraphicsManager::setOneColor(int idx, byte r, byte g, byte b) { @@ -984,7 +984,7 @@ void GraphicsManager::setColors(int start, int count, const byte *pal) { } } - _vm->_eventsManager._intPtr._hasPalette = true; + _vm->_eventsManager->_intPtr._hasPalette = true; } void GraphicsManager::screenReset() { @@ -1003,7 +1003,7 @@ void GraphicsManager::fadeDownICF1(int steps) { for (int idx = 0; idx < steps; ++idx) { _vm->_voy->_fadingAmount2 -= stepAmount; - _vm->_eventsManager.delay(1); + _vm->_eventsManager->delay(1); } } @@ -1016,7 +1016,7 @@ void GraphicsManager::fadeUpICF1(int steps) { for (int idx = 0; idx < steps; ++idx) { _vm->_voy->_fadingAmount2 += stepAmount; - _vm->_eventsManager.delay(1); + _vm->_eventsManager->delay(1); } } @@ -1025,14 +1025,14 @@ void GraphicsManager::fadeUpICF1(int steps) { void GraphicsManager::fadeDownICF(int steps) { if (steps > 0) { - _vm->_eventsManager.hideCursor(); + _vm->_eventsManager->hideCursor(); int stepAmount1 = _vm->_voy->_fadingAmount1 / steps; int stepAmount2 = _vm->_voy->_fadingAmount2 / steps; for (int idx = 0; idx < steps; ++idx) { _vm->_voy->_fadingAmount1 -= stepAmount1; _vm->_voy->_fadingAmount2 -= stepAmount2; - _vm->_eventsManager.delay(1); + _vm->_eventsManager->delay(1); } } diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index f6a192e699..5112445182 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -40,6 +40,7 @@ VoyeurEngine::VoyeurEngine(OSystem *syst, const VoyeurGameDescription *gameDesc) _defaultFontInfo(3, 0xff, 0xff, 0, 0, ALIGN_LEFT, 0, Common::Point(), 1, 1, Common::Point(1, 1), 1, 0, 0) { _debugger = nullptr; + _eventsManager = nullptr; _soundManager = nullptr; _voy = nullptr; _bVoy = NULL; @@ -71,6 +72,7 @@ VoyeurEngine::~VoyeurEngine() { delete _bVoy; delete _voy; delete _soundManager; + delete _eventsManager; delete _debugger; } @@ -98,10 +100,10 @@ int VoyeurEngine::getRandomNumber(int maxNumber) { } void VoyeurEngine::initializeManagers() { - _eventsManager.setVm(this); _filesManager.setVm(this); _graphicsManager.setVm(this); _debugger = new Debugger(this); + _eventsManager = new EventsManager(this); _soundManager = new SoundManager(this, _mixer); _voy = new SVoy(this); } @@ -127,18 +129,18 @@ void VoyeurEngine::globalInitBolt() { // Setup default flags _voy->_viewBounds = nullptr; - _eventsManager.addFadeInt(); + _eventsManager->addFadeInt(); } void VoyeurEngine::initBolt() { vInitInterrupts(); _graphicsManager.sInitGraphics(); - _eventsManager.vInitColor(); + _eventsManager->vInitColor(); initInput(); } void VoyeurEngine::vInitInterrupts() { - _eventsManager._intPtr._palette = &_graphicsManager._VGAColors[0]; + _eventsManager->_intPtr._palette = &_graphicsManager._VGAColors[0]; } void VoyeurEngine::initInput() { @@ -147,7 +149,7 @@ void VoyeurEngine::initInput() { bool VoyeurEngine::doHeadTitle() { // char dest[144]; - _eventsManager.startMainClockInt(); + _eventsManager->startMainClockInt(); if (_loadGameSlot == -1) { // Show starting screen @@ -167,20 +169,20 @@ bool VoyeurEngine::doHeadTitle() { } // Show the title screen - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); showTitleScreen(); if (shouldQuit()) return false; // Opening - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); doOpening(); if (shouldQuit()) return false; - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); doTransitionCard("Saturday Afternoon", "Player's Apartment"); - _eventsManager.delayClick(90); + _eventsManager->delayClick(90); if (_voy->_eventFlags & EVTFLAG_VICTIM_PRESET) { // Preset victim turned on, so add a default set of incriminating videos @@ -212,7 +214,7 @@ void VoyeurEngine::showConversionScreen() { cMap->startFade(); // Wait briefly - _eventsManager.delayClick(150); + _eventsManager->delayClick(150); if (shouldQuit()) return; @@ -252,22 +254,22 @@ bool VoyeurEngine::doLock() { _graphicsManager._backColors->startFade(); (*_graphicsManager._vPort)->_parent->_flags |= DISPFLAG_8; _graphicsManager.flipPage(); - _eventsManager.sWaitFlip(); + _eventsManager->sWaitFlip(); - while (!shouldQuit() && (_eventsManager._fadeStatus & 1)) - _eventsManager.delay(1); + while (!shouldQuit() && (_eventsManager->_fadeStatus & 1)) + _eventsManager->delay(1); - _eventsManager.setCursorColor(127, 0); + _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); // Set up the cursor - _eventsManager.setCursor(cursorPic); - _eventsManager.showCursor(); + _eventsManager->setCursor(cursorPic); + _eventsManager->showCursor(); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x708)._fontResource; _graphicsManager._fontPtr->_fontSaveBack = 0; @@ -303,7 +305,7 @@ bool VoyeurEngine::doLock() { do { // Scan through the list of key rects to check if a keypad key is highlighted key = -1; - Common::Point mousePos = _eventsManager.getMousePos() + + Common::Point mousePos = _eventsManager->getMousePos() + Common::Point(30, 20); for (int keyIndex = 0; keyIndex < keyCount; ++keyIndex) { @@ -317,12 +319,12 @@ bool VoyeurEngine::doLock() { } } - _eventsManager.setCursorColor(127, (key == -1) ? 0 : 1); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->setCursorColor(127, (key == -1) ? 0 : 1); + _eventsManager->_intPtr._hasPalette = true; - _eventsManager.delay(1); - } while (!shouldQuit() && !_eventsManager._mouseClicked); - _eventsManager._mouseClicked = false; + _eventsManager->delay(1); + } while (!shouldQuit() && !_eventsManager->_mouseClicked); + _eventsManager->_mouseClicked = false; } while (!shouldQuit() && key == -1); _soundManager->abortVOCMap(); @@ -331,7 +333,7 @@ bool VoyeurEngine::doLock() { while (_soundManager->getVOCStatus()) { if (shouldQuit()) break; - _eventsManager.delay(1); + _eventsManager->delay(1); } // Process the key @@ -384,7 +386,7 @@ bool VoyeurEngine::doLock() { _bVoy->freeBoltGroup(0x700); } - _eventsManager.hideCursor(); + _eventsManager->hideCursor(); delete[] buttonVoc; delete[] wrongVoc; @@ -406,7 +408,7 @@ void VoyeurEngine::showTitleScreen() { cMap->startFade(); // Wait briefly - _eventsManager.delayClick(200); + _eventsManager->delayClick(200); if (shouldQuit()) return; @@ -420,7 +422,7 @@ void VoyeurEngine::showTitleScreen() { return; _graphicsManager.screenReset(); - _eventsManager.delayClick(200); + _eventsManager->delayClick(200); // Voyeur title playRL2Video("a1100100.rl2"); @@ -451,7 +453,7 @@ void VoyeurEngine::doOpening() { _gameHour = 4; _gameMinute = 0; _audioVideoId = 1; - _eventsManager._videoDead = -1; + _eventsManager->_videoDead = -1; _voy->addVideoEventStart(); _voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; @@ -459,7 +461,7 @@ void VoyeurEngine::doOpening() { for (int i = 0; i < 256; ++i) _graphicsManager.setColor(i, 8, 8, 8); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; (*_graphicsManager._vPort)->setupViewPort(); flipPageAndWait(); @@ -467,7 +469,7 @@ void VoyeurEngine::doOpening() { decoder.loadFile("a2300100.rl2"); decoder.start(); - while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager._mouseClicked) { + while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked) { if (decoder.hasDirtyPalette()) { const byte *palette = decoder.getPalette(); _graphicsManager.setPalette(palette, 0, 256); @@ -502,12 +504,12 @@ void VoyeurEngine::doOpening() { } } - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); g_system->delayMillis(10); } if ((_voy->_RTVNum - _voy->_audioVisualStartTime) < 2) - _eventsManager.delay(60); + _eventsManager->delay(60); _voy->_eventFlags |= EVTFLAG_TIME_DISABLED; _voy->addVideoEventEnd(); @@ -521,7 +523,7 @@ void VoyeurEngine::playRL2Video(const Common::String &filename) { decoder.loadFile(filename); decoder.start(); - while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager._mouseClicked) { + while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked) { if (decoder.hasDirtyPalette()) { const byte *palette = decoder.getPalette(); _graphicsManager.setPalette(palette, 0, 256); @@ -534,7 +536,7 @@ void VoyeurEngine::playRL2Video(const Common::String &filename) { (byte *)_graphicsManager._screenSurface.getPixels()); } - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); g_system->delayMillis(10); } } @@ -551,8 +553,8 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { PictureResource *pic = NULL; if (videoId == 42) { - _eventsManager._videoDead = 0; - pic = _bVoy->boltEntry(0xE00 + _eventsManager._videoDead)._picResource; + _eventsManager->_videoDead = 0; + pic = _bVoy->boltEntry(0xE00 + _eventsManager->_videoDead)._picResource; } RL2Decoder decoder; @@ -562,10 +564,10 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { decoder.start(); int endFrame = decoder.getCurFrame() + totalFrames; - _eventsManager.getMouseInfo(); - _eventsManager.startCursorBlink(); + _eventsManager->getMouseInfo(); + _eventsManager->startCursorBlink(); - while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager._mouseClicked && + while (!shouldQuit() && !decoder.endOfVideo() && !_eventsManager->_mouseClicked && (decoder.getCurFrame() < endFrame)) { if (decoder.needsUpdate()) { const Graphics::Surface *frame = decoder.decodeNextFrame(); @@ -582,7 +584,7 @@ void VoyeurEngine::playAVideoDuration(int videoId, int duration) { _graphicsManager.setOneColor(128, 220, 20, 20); } - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); g_system->delayMillis(10); } @@ -616,11 +618,11 @@ void VoyeurEngine::playAudio(int audioId) { audioId + 159); _soundManager->startVOCPlay(filename); _voy->_eventFlags |= EVTFLAG_RECORDING; - _eventsManager.startCursorBlink(); + _eventsManager->startCursorBlink(); - while (!shouldQuit() && !_eventsManager._mouseClicked && + while (!shouldQuit() && !_eventsManager->_mouseClicked && _soundManager->getVOCStatus()) - _eventsManager.delayClick(1); + _eventsManager->delayClick(1); _voy->_eventFlags |= EVTFLAG_TIME_DISABLED; _soundManager->stopVOCPlay(); @@ -635,12 +637,12 @@ void VoyeurEngine::playAudio(int audioId) { void VoyeurEngine::doTransitionCard(const Common::String &time, const Common::String &location) { _graphicsManager.setColor(128, 16, 16, 16); _graphicsManager.setColor(224, 220, 220, 220); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; (*_graphicsManager._vPort)->setupViewPort(NULL); (*_graphicsManager._vPort)->fillPic(128); _graphicsManager.flipPage(); - _eventsManager.sWaitFlip(); + _eventsManager->sWaitFlip(); flipPageAndWait(); (*_graphicsManager._vPort)->fillPic(128); @@ -675,14 +677,14 @@ void VoyeurEngine::saveLastInplay() { void VoyeurEngine::flipPageAndWait() { (*_graphicsManager._vPort)->_flags |= DISPFLAG_8; _graphicsManager.flipPage(); - _eventsManager.sWaitFlip(); + _eventsManager->sWaitFlip(); } void VoyeurEngine::flipPageAndWaitForFade() { flipPageAndWait(); - while (!shouldQuit() && (_eventsManager._fadeStatus & 1)) - _eventsManager.delay(1); + while (!shouldQuit() && (_eventsManager->_fadeStatus & 1)) + _eventsManager->delay(1); } void VoyeurEngine::showEndingNews() { @@ -699,7 +701,7 @@ void VoyeurEngine::showEndingNews() { pal->startFade(); flipPageAndWaitForFade(); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); for (int idx = 1; idx < 4; ++idx) { if (idx == 3) { @@ -720,18 +722,18 @@ void VoyeurEngine::showEndingNews() { Common::String fname = Common::String::format("news%d.voc", idx); _soundManager->startVOCPlay(fname); - _eventsManager.getMouseInfo(); - while (!shouldQuit() && !_eventsManager._mouseClicked && + _eventsManager->getMouseInfo(); + while (!shouldQuit() && !_eventsManager->_mouseClicked && _soundManager->getVOCStatus()) { - _eventsManager.delay(1); - _eventsManager.getMouseInfo(); + _eventsManager->delay(1); + _eventsManager->getMouseInfo(); } _soundManager->stopVOCPlay(); if (idx == 3) - _eventsManager.delay(3); + _eventsManager->delay(3); - if (shouldQuit() || _eventsManager._mouseClicked) + if (shouldQuit() || _eventsManager->_mouseClicked) break; } @@ -913,7 +915,7 @@ void VoyeurSavegameHeader::write(Common::OutSaveFile *f, VoyeurEngine *vm, const f->writeSint16LE(td.tm_mday); f->writeSint16LE(td.tm_hour); f->writeSint16LE(td.tm_min); - f->writeUint32LE(vm->_eventsManager.getGameCounter()); + f->writeUint32LE(vm->_eventsManager->getGameCounter()); } } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur.h b/engines/voyeur/voyeur.h index e9946634cc..16999d85e9 100644 --- a/engines/voyeur/voyeur.h +++ b/engines/voyeur/voyeur.h @@ -158,7 +158,7 @@ protected: public: BoltFile *_bVoy; Debugger *_debugger; - EventsManager _eventsManager; + EventsManager *_eventsManager; FilesManager _filesManager; GraphicsManager _graphicsManager; SoundManager *_soundManager; diff --git a/engines/voyeur/voyeur_game.cpp b/engines/voyeur/voyeur_game.cpp index 6b1c1dcb36..be60c557b5 100644 --- a/engines/voyeur/voyeur_game.cpp +++ b/engines/voyeur/voyeur_game.cpp @@ -50,7 +50,7 @@ void VoyeurEngine::playStamp() { bool breakFlag = false; while (!breakFlag && !shouldQuit()) { _voyeurArea = AREA_NONE; - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); _playStampGroupId = _currentVocId = -1; _audioVideoId = -1; @@ -153,7 +153,7 @@ void VoyeurEngine::playStamp() { _graphicsManager._backColors = _bVoy->boltEntry(_playStampGroupId + 1)._cMapResource; buttonId = getChooseButton(); - if (_eventsManager._rightClick) + if (_eventsManager->_rightClick) // Aborted out of selecting a recipient buttonId = 4; @@ -201,7 +201,7 @@ void VoyeurEngine::playStamp() { flag = false; } else if (_mainThread->_stateFlags & 2) { - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); _mainThread->chooseSTAMPButton(0); flag = true; } else { @@ -241,10 +241,10 @@ void VoyeurEngine::doTailTitle() { decoder.start(); decoder.play(this); - if (!shouldQuit() && !_eventsManager._mouseClicked) { + if (!shouldQuit() && !_eventsManager->_mouseClicked) { doClosingCredits(); - if (!shouldQuit() && !_eventsManager._mouseClicked) { + if (!shouldQuit() && !_eventsManager->_mouseClicked) { _graphicsManager.screenReset(); PictureResource *pic = _bVoy->boltEntry(0x602)._picResource; @@ -253,7 +253,7 @@ void VoyeurEngine::doTailTitle() { (*_graphicsManager._vPort)->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); - _eventsManager.delayClick(300); + _eventsManager->delayClick(300); pic = _bVoy->boltEntry(0x604)._picResource; pal = _bVoy->boltEntry(0x605)._cMapResource; @@ -261,7 +261,7 @@ void VoyeurEngine::doTailTitle() { (*_graphicsManager._vPort)->setupViewPort(pic); pal->startFade(); flipPageAndWaitForFade(); - _eventsManager.delayClick(120); + _eventsManager->delayClick(120); _soundManager->stopVOCPlay(); } @@ -286,7 +286,7 @@ void VoyeurEngine::doClosingCredits() { (*_graphicsManager._vPort)->setupViewPort(NULL); _graphicsManager.setColor(1, 180, 180, 180); _graphicsManager.setColor(2, 200, 200, 200); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x402)._fontResource; _graphicsManager._fontPtr->_foreColor = 2; @@ -373,10 +373,10 @@ void VoyeurEngine::doClosingCredits() { if (flags & 0x20) { flipPageAndWait(); - _eventsManager.delayClick(READ_LE_UINT16(entry + 2) * 60); + _eventsManager->delayClick(READ_LE_UINT16(entry + 2) * 60); } - if (shouldQuit() || _eventsManager._mouseClicked) + if (shouldQuit() || _eventsManager->_mouseClicked) break; } @@ -389,7 +389,7 @@ void VoyeurEngine::doPiracy() { _graphicsManager.screenReset(); _graphicsManager.setColor(1, 0, 0, 0); _graphicsManager.setColor(2, 255, 255, 255); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; (*_graphicsManager._vPort)->setupViewPort(NULL); (*_graphicsManager._vPort)->fillPic(1); @@ -413,8 +413,8 @@ void VoyeurEngine::doPiracy() { } flipPageAndWait(); - _eventsManager.getMouseInfo(); - _eventsManager.delayClick(720); + _eventsManager->getMouseInfo(); + _eventsManager->delayClick(720); } void VoyeurEngine::reviewTape() { @@ -455,18 +455,18 @@ void VoyeurEngine::reviewTape() { _graphicsManager.setColor(10, 64, 132, 64); _graphicsManager.setColor(11, 100, 192, 100); _graphicsManager.setColor(12, 120, 248, 120); - _eventsManager.setCursorColor(128, 1); + _eventsManager->setCursorColor(128, 1); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; _graphicsManager._fontPtr->_curFont = _bVoy->boltEntry(0x909)._fontResource; _graphicsManager._fontPtr->_fontSaveBack = false; _graphicsManager._fontPtr->_fontFlags = 0; - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); if (newX == -1) { - _eventsManager.setMousePos(Common::Point(hotspots[1].left + 12, hotspots[1].top + 6)); + _eventsManager->setMousePos(Common::Point(hotspots[1].left + 12, hotspots[1].top + 6)); } else { - _eventsManager.setMousePos(Common::Point(newX, newY)); + _eventsManager->setMousePos(Common::Point(newX, newY)); } _currentVocId = 151; @@ -498,7 +498,7 @@ void VoyeurEngine::reviewTape() { _graphicsManager._fontPtr->_justifyWidth = 0; _graphicsManager._fontPtr->_justifyHeight = 0; - Common::String msg = _eventsManager.getEvidString(eventNum); + Common::String msg = _eventsManager->getEvidString(eventNum); _graphicsManager._backgroundPage->drawText(msg); yp += 15; @@ -513,13 +513,13 @@ void VoyeurEngine::reviewTape() { } _graphicsManager.sDrawPic(cursor, *_graphicsManager._vPort, - _eventsManager.getMousePos()); + _eventsManager->getMousePos()); flipPageAndWait(); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); foundIndex = -1; - Common::Point tempPos = _eventsManager.getMousePos() + Common::Point(14, 7); + Common::Point tempPos = _eventsManager->getMousePos() + Common::Point(14, 7); for (uint idx = 0; idx < hotspots.size(); ++idx) { if (hotspots[idx].contains(tempPos)) { // Found hotspot area @@ -528,18 +528,18 @@ void VoyeurEngine::reviewTape() { } } - pt = _eventsManager.getMousePos(); + pt = _eventsManager->getMousePos(); if (tempPos.x >= 68 && tempPos.x <= 277 && tempPos.y >= 31 && tempPos.y <= 154) { tempPos.y -= 2; foundIndex = (tempPos.y - 31) / 15; if ((tempPos.y - 31) % 15 >= 12 || (eventStart + foundIndex) >= _voy->_eventCount) { - _eventsManager.setCursorColor(128, 0); + _eventsManager->setCursorColor(128, 0); foundIndex = 999; - } else if (!_eventsManager._leftClick) { - _eventsManager.setCursorColor(128, 2); + } else if (!_eventsManager->_leftClick) { + _eventsManager->setCursorColor(128, 2); foundIndex = -1; } else { - _eventsManager.setCursorColor(128, 2); + _eventsManager->setCursorColor(128, 2); eventLine = foundIndex; flipPageAndWait(); @@ -560,7 +560,7 @@ void VoyeurEngine::reviewTape() { _graphicsManager._fontPtr->_justifyWidth = 0; _graphicsManager._fontPtr->_justifyHeight = 0; - Common::String msg = _eventsManager.getEvidString(eventNum); + Common::String msg = _eventsManager->getEvidString(eventNum); _graphicsManager._backgroundPage->drawText(msg); yp += 15; @@ -574,7 +574,7 @@ void VoyeurEngine::reviewTape() { (*_graphicsManager._vPort)->_lastPage, tempRect); flipPageAndWait(); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); foundIndex = -1; } } else if ((_voy->_eventFlags & EVTFLAG_40) && _voy->_viewBounds->left == pt.x && @@ -584,12 +584,12 @@ void VoyeurEngine::reviewTape() { _voy->_viewBounds->top == pt.y) { foundIndex = 998; } else { - _eventsManager.setCursorColor(128, (foundIndex == -1) ? 0 : 1); + _eventsManager->setCursorColor(128, (foundIndex == -1) ? 0 : 1); } - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; - if (_eventsManager._mouseClicked) { + if (_eventsManager->_mouseClicked) { switch (foundIndex) { case 2: if (eventStart > 0) { @@ -635,20 +635,20 @@ void VoyeurEngine::reviewTape() { --eventLine; } - pt = _eventsManager.getMousePos(); - if (_eventsManager._mouseClicked && _voy->_viewBounds->left == pt.x && - (_voy->_eventFlags & EVTFLAG_40) && _eventsManager._rightClick) { + pt = _eventsManager->getMousePos(); + if (_eventsManager->_mouseClicked && _voy->_viewBounds->left == pt.x && + (_voy->_eventFlags & EVTFLAG_40) && _eventsManager->_rightClick) { _controlPtr->_state->_victimIndex = (pt.y / 60) + 1; foundIndex = -1; - _eventsManager._rightClick = 0; + _eventsManager->_rightClick = 0; } - if (_eventsManager._rightClick) + if (_eventsManager->_rightClick) foundIndex = 0; - } while (!shouldQuit() && (!_eventsManager._mouseClicked || foundIndex == -1)); + } while (!shouldQuit() && (!_eventsManager->_mouseClicked || foundIndex == -1)); - newY = _eventsManager.getMousePos().y; + newY = _eventsManager->getMousePos().y; _voy->_fadingType = 0; _voy->_viewBounds = nullptr; (*_graphicsManager._vPort)->setupViewPort(NULL); @@ -683,8 +683,8 @@ void VoyeurEngine::reviewTape() { _graphicsManager._backColors->startFade(); flipPageAndWaitForFade(); - _eventsManager._intPtr._flashStep = 1; - _eventsManager._intPtr._flashTimer = 0; + _eventsManager->_intPtr._flashStep = 1; + _eventsManager->_intPtr._flashTimer = 0; _voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; // Play suond for the given duration @@ -692,11 +692,11 @@ void VoyeurEngine::reviewTape() { _soundManager->startVOCPlay(_audioVideoId + 159); uint32 secondsDuration = e._computerOff; - _eventsManager.getMouseInfo(); - while (!_eventsManager._mouseClicked && _soundManager->getVOCStatus() && + _eventsManager->getMouseInfo(); + while (!_eventsManager->_mouseClicked && _soundManager->getVOCStatus() && _soundManager->getVOCFrame() < secondsDuration) { - _eventsManager.getMouseInfo(); - _eventsManager.delay(10); + _eventsManager->getMouseInfo(); + _eventsManager->delay(10); } _voy->_eventFlags |= EVTFLAG_TIME_DISABLED; @@ -771,7 +771,7 @@ void VoyeurEngine::doGossip() { decoder2.loadFile("a2110100.rl2", true); decoder2.start(); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); decoder2.play(this); decoder2.close(); @@ -783,7 +783,7 @@ void VoyeurEngine::doTapePlaying() { if (!_bVoy->getBoltGroup(0xA00)) return; - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); _graphicsManager._backColors = _bVoy->boltEntry(0xA01)._cMapResource; _graphicsManager._backgroundPage = _bVoy->boltEntry(0xA00)._picResource; PictureResource *pic = _bVoy->boltEntry(0xA02)._picResource; @@ -797,8 +797,8 @@ void VoyeurEngine::doTapePlaying() { cycle->vStartCycle(); _soundManager->startVOCPlay("vcr.voc"); - while (!shouldQuit() && !_eventsManager._mouseClicked && _soundManager->getVOCStatus()) { - _eventsManager.delayClick(2); + while (!shouldQuit() && !_eventsManager->_mouseClicked && _soundManager->getVOCStatus()) { + _eventsManager->delayClick(2); } _soundManager->stopVOCPlay(); @@ -906,23 +906,23 @@ void VoyeurEngine::playAVideoEvent(int eventIndex) { VoyeurEvent &evt = _voy->_events[eventIndex]; _audioVideoId = evt._audioVideoId; _voy->_vocSecondsOffset = evt._computerOn; - _eventsManager._videoDead = evt._dead; + _eventsManager->_videoDead = evt._dead; _voy->_eventFlags &= ~EVTFLAG_TIME_DISABLED; playAVideoDuration(_audioVideoId, evt._computerOff); _voy->_eventFlags |= EVTFLAG_TIME_DISABLED; - if (_eventsManager._videoDead != -1) { + if (_eventsManager->_videoDead != -1) { _bVoy->freeBoltGroup(0xE00); - _eventsManager._videoDead = -1; + _eventsManager->_videoDead = -1; flipPageAndWait(); - _eventsManager._videoDead = -1; + _eventsManager->_videoDead = -1; } _audioVideoId = -1; - if (_eventsManager._videoDead != -1) { + if (_eventsManager->_videoDead != -1) { _bVoy->freeBoltGroup(0xE00); - _eventsManager._videoDead = -1; + _eventsManager->_videoDead = -1; flipPageAndWait(); } } @@ -946,9 +946,9 @@ int VoyeurEngine::getChooseButton() { if (_currentVocId != -1 && !_soundManager->getVOCStatus()) _soundManager->startVOCPlay(_currentVocId); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); selectedIndex = -1; - Common::Point pt = _eventsManager.getMousePos(); + Common::Point pt = _eventsManager->getMousePos(); for (uint idx = 0; idx < hotspots.size(); ++idx) { if (hotspots[idx].contains(pt)) { @@ -976,8 +976,8 @@ int VoyeurEngine::getChooseButton() { Common::Point(pt.x + 13, pt.y - 12)); flipPageAndWait(); - } while (!shouldQuit() && !_eventsManager._mouseClicked); - } while (!shouldQuit() && selectedIndex == -1 && !_eventsManager._rightClick); + } while (!shouldQuit() && !_eventsManager->_mouseClicked); + } while (!shouldQuit() && selectedIndex == -1 && !_eventsManager->_rightClick); return selectedIndex; } @@ -1028,7 +1028,7 @@ void VoyeurEngine::makeViewFinder() { _graphicsManager.setColor(243, 105, 105, 105); _graphicsManager.setColor(palOffset + 241, 219, 235, 235); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; } void VoyeurEngine::makeViewFinderP() { @@ -1071,7 +1071,7 @@ void VoyeurEngine::initIFace() { _voy->_viewBounds = _bVoy->boltEntry(_playStampGroupId)._rectResource; // Show the cursor using ScummVM functionality - _eventsManager.showCursor(); + _eventsManager->showCursor(); // Note: the original did two loops to preload members here, which is // redundant for ScummVM, since computers are faster these days, and @@ -1134,7 +1134,7 @@ void VoyeurEngine::checkTransition() { // Show a transition card with the day and time, and wait doTransitionCard(day, time); - _eventsManager.delayClick(180); + _eventsManager->delayClick(180); } _checkTransitionId = _voy->_transitionId; @@ -1207,7 +1207,7 @@ int VoyeurEngine::doComputerText(int maxLen) { char c = *msg++; if (c == '\0') { if (showEnd) { - _eventsManager.delay(90); + _eventsManager->delay(90); _graphicsManager._drawPtr->_pos = Common::Point(96, 54); _graphicsManager._drawPtr->_penColor = 254; (*_graphicsManager._vPort)->sFillBox(196, 124); @@ -1224,7 +1224,7 @@ int VoyeurEngine::doComputerText(int maxLen) { if (c == '^') { yp += 10; } else { - _eventsManager.delay(90); + _eventsManager->delay(90); _graphicsManager._drawPtr->_pos = Common::Point(96, 54); _graphicsManager._drawPtr->_penColor = 255; (*_graphicsManager._vPort)->sFillBox(196, 124); @@ -1239,14 +1239,14 @@ int VoyeurEngine::doComputerText(int maxLen) { _graphicsManager._fontPtr->_justifyWidth = 0; _graphicsManager._fontPtr->_justifyHeight = 0; (*_graphicsManager._vPort)->drawText(Common::String(c)); - _eventsManager.delay(4); + _eventsManager->delay(4); } flipPageAndWait(); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); ++totalChars; - } while (!shouldQuit() && !_eventsManager._mouseClicked && totalChars < maxLen); + } while (!shouldQuit() && !_eventsManager->_mouseClicked && totalChars < maxLen); _voy->_computerTimeMax = 0; } @@ -1287,7 +1287,7 @@ void VoyeurEngine::doTimeBar() { (*_graphicsManager._vPort)->sFillBox(6, fullHeight - 92); if (height > 0) { _graphicsManager.setColor(215, 238, 238, 238); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; _graphicsManager._drawPtr->_penColor = 215; _graphicsManager._drawPtr->_pos = Common::Point(39, fullHeight); @@ -1298,17 +1298,17 @@ void VoyeurEngine::doTimeBar() { void VoyeurEngine::flashTimeBar() { if (_voy->_RTVNum >= 0 && (_voy->_RTVLimit - _voy->_RTVNum) < 11 && - (_eventsManager._intPtr._flashTimer >= (_flashTimeVal + 15) || - _eventsManager._intPtr._flashTimer < _flashTimeVal)) { + (_eventsManager->_intPtr._flashTimer >= (_flashTimeVal + 15) || + _eventsManager->_intPtr._flashTimer < _flashTimeVal)) { // Within camera low power range - _flashTimeVal = _eventsManager._intPtr._flashTimer; + _flashTimeVal = _eventsManager->_intPtr._flashTimer; if (_flashTimeFlag) _graphicsManager.setColor(240, 220, 20, 20); else _graphicsManager.setColor(240, 220, 220, 220); - _eventsManager._intPtr._hasPalette = true; + _eventsManager->_intPtr._hasPalette = true; _flashTimeFlag = !_flashTimeFlag; } } @@ -1334,7 +1334,7 @@ void VoyeurEngine::checkPhoneCall() { } void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); flipPageAndWait(); if (_currentVocId != -1) { @@ -1351,8 +1351,8 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { CMapResource *pal = _bVoy->boltEntry(_voy->_boltGroupId2 + evidId * 2 + 1)._cMapResource; pal->startFade(); - while (!shouldQuit() && (_eventsManager._fadeStatus & 1)) - _eventsManager.delay(1); + while (!shouldQuit() && (_eventsManager->_fadeStatus & 1)) + _eventsManager->delay(1); _bVoy->freeBoltMember(_voy->_boltGroupId2 + evidId * 2 + 1); Common::Array<RectEntry> &hotspots = _bVoy->boltEntry(_playStampGroupId + 4)._rectResource->_entries; @@ -1368,17 +1368,17 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { } flipPageAndWait(); - _eventsManager.stopEvidDim(); + _eventsManager->stopEvidDim(); if (eventId == 999) _voy->addEvidEventStart(evidId); - _eventsManager.getMouseInfo(); + _eventsManager->getMouseInfo(); int arrIndex = 0; int evidIdx = evidId; - while (!shouldQuit() && !_eventsManager._rightClick) { + while (!shouldQuit() && !_eventsManager->_rightClick) { _voyeurArea = AREA_EVIDENCE; if (_currentVocId != -1 && !_soundManager->getVOCStatus()) { @@ -1388,8 +1388,8 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { _soundManager->startVOCPlay(_currentVocId); } - _eventsManager.delayClick(600); - if (_eventsManager._rightClick) + _eventsManager->delayClick(600); + if (_eventsManager->_rightClick) break; if (count == 0 || evidIdx >= eventId) continue; @@ -1399,11 +1399,11 @@ void VoyeurEngine::doEvidDisplay(int evidId, int eventId) { Common::Point((384 - pic->_bounds.width()) / 2, (240 - pic->_bounds.height()) / 2)); _voy->_evCmPtrs[arrIndex]->startFade(); - while (!shouldQuit() && (_eventsManager._fadeStatus & 1)) - _eventsManager.delay(1); + while (!shouldQuit() && (_eventsManager->_fadeStatus & 1)) + _eventsManager->delay(1); flipPageAndWait(); - _eventsManager.delay(6); + _eventsManager->delay(6); ++evidIdx; ++arrIndex; |