diff options
author | Paul Gilbert | 2014-01-18 23:47:04 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-01-18 23:47:04 -0500 |
commit | 00873d3124bb2011dda6bfc177ad38585ca9cebf (patch) | |
tree | e785c91f318bb9d744a3b3dfe240cd9ee483b9a1 /engines | |
parent | 7f236696c960493469669ac0c02cab324ad2dd64 (diff) | |
download | scummvm-rg350-00873d3124bb2011dda6bfc177ad38585ca9cebf.tar.gz scummvm-rg350-00873d3124bb2011dda6bfc177ad38585ca9cebf.tar.bz2 scummvm-rg350-00873d3124bb2011dda6bfc177ad38585ca9cebf.zip |
VOYEUR: Fix for phone message playing every time apartment was shown
Diffstat (limited to 'engines')
-rw-r--r-- | engines/voyeur/files.h | 5 | ||||
-rw-r--r-- | engines/voyeur/files_threads.cpp | 22 | ||||
-rw-r--r-- | engines/voyeur/voyeur.cpp | 2 |
3 files changed, 16 insertions, 13 deletions
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 6cc747d9a1..0b98a34447 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -486,6 +486,9 @@ public: static void init(); private: + VoyeurEngine *_vm; + Common::Point _aptPos; +private: bool getStateInfo(); byte *getDataOffset(); void getButtonsText(); @@ -523,8 +526,6 @@ private: */ bool checkMansionScroll(); public: - VoyeurEngine *_vm; - int _threadId; int _controlIndex; int _field4, _field6; diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index 850e6dfa06..58ce373b75 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -41,6 +41,7 @@ ThreadResource::ThreadResource(BoltFilesState &state, const byte *src): _vm(state._vm) { _flags = src[8]; _ctlPtr = nullptr; + _aptPos = Common::Point(-1, -1); } void ThreadResource::initThreadStruct(int idx, int id) { @@ -1023,27 +1024,27 @@ bool ThreadResource::cardPerform2(const byte *pSrc, int cardCmdId) { int ThreadResource::doApt() { loadTheApt(); - Common::Point aptPos(-1, -1); _vm->_currentVocId = 151; _vm->_voy._viewBounds = _vm->_bVoy->boltEntry(_vm->_playStampGroupId)._rectResource; Common::Array<Common::Rect> &hotspots = _vm->_bVoy->boltEntry( _vm->_playStampGroupId + 1)._rectResource->_entries; _vm->_eventsManager.getMouseInfo(); - if (aptPos.x == -1) { - aptPos.x = hotspots[2].left; - aptPos.y = hotspots[2].top; + // Very first time apartment is shown, start the phone message + if (_aptPos.x == -1) { + _aptPos.x = hotspots[2].left; + _aptPos.y = hotspots[2].top; _vm->_currentVocId = 153; } if (_vm->_voy._field470 == 16) { hotspots[0].left = 999; hotspots[3].left = 999; - aptPos.x = hotspots[4].left + 28; - aptPos.y = hotspots[4].top + 28; + _aptPos.x = hotspots[4].left + 28; + _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; @@ -1112,8 +1113,8 @@ int ThreadResource::doApt() { } while (!_vm->shouldQuit() && (!_vm->_eventsManager._leftClick || hotspotId == -1)); pt = _vm->_eventsManager.getMousePos(); - aptPos.x = pt.x; - aptPos.y = pt.y; + _aptPos.x = pt.x; + _aptPos.y = pt.y; switch (hotspotId) { case 0: @@ -1770,7 +1771,8 @@ void ThreadResource::doAptAnim(int mode) { } void ThreadResource::synchronize(Common::Serializer &s) { - warning("TODO: ThreadResource::synchronize"); + s.syncAsSint16LE(_aptPos.x); + s.syncAsSint16LE(_aptPos.y); } } // End of namespace Voyeur diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index b4e8f94d22..889b6fdeaa 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -682,7 +682,7 @@ Common::Error VoyeurEngine::loadGameState(int slot) { void VoyeurEngine::loadGame(int slot) { // Open up the save file - Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(g_vm->generateSaveName(slot)); + Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(generateSaveName(slot)); if (!saveFile) return; |