diff options
author | Paul Gilbert | 2014-01-05 14:15:53 -0500 |
---|---|---|
committer | Paul Gilbert | 2014-01-05 14:15:53 -0500 |
commit | 7c256c491a71feb3dd608e0351072939cb7ac796 (patch) | |
tree | 3b0b26e201c1ea0ceca400dca4f911176e189c27 /engines/voyeur | |
parent | 99dc594cb9391fefe4650610c531df44563bf20c (diff) | |
download | scummvm-rg350-7c256c491a71feb3dd608e0351072939cb7ac796.tar.gz scummvm-rg350-7c256c491a71feb3dd608e0351072939cb7ac796.tar.bz2 scummvm-rg350-7c256c491a71feb3dd608e0351072939cb7ac796.zip |
VOYEUR: Refactored doAptPosX/Y into a local variable
Diffstat (limited to 'engines/voyeur')
-rw-r--r-- | engines/voyeur/files.h | 2 | ||||
-rw-r--r-- | engines/voyeur/files_threads.cpp | 21 |
2 files changed, 9 insertions, 14 deletions
diff --git a/engines/voyeur/files.h b/engines/voyeur/files.h index 17f5ccc125..69bbb78d14 100644 --- a/engines/voyeur/files.h +++ b/engines/voyeur/files.h @@ -445,8 +445,6 @@ public: static CMapResource *_cmd14Pal; static void initUseCount(); static void unloadAllStacks(VoyeurEngine *vm); - static int _doAptPosX; - static int _doAptPosY; static void init(); private: diff --git a/engines/voyeur/files_threads.cpp b/engines/voyeur/files_threads.cpp index 48eee998d5..637b8ff65a 100644 --- a/engines/voyeur/files_threads.cpp +++ b/engines/voyeur/files_threads.cpp @@ -31,16 +31,12 @@ int ThreadResource::_stampFlags; int ThreadResource::_useCount[8]; byte *ThreadResource::_threadDataPtr; CMapResource *ThreadResource::_cmd14Pal; -int ThreadResource::_doAptPosX; -int ThreadResource::_doAptPosY; void ThreadResource::init() { _stampFlags = 0; Common::fill(&_useCount[0], &_useCount[8], 0); _threadDataPtr = nullptr; _cmd14Pal = nullptr; - _doAptPosX = -1; - _doAptPosY = -1; } ThreadResource::ThreadResource(BoltFilesState &state, const byte *src): @@ -1029,26 +1025,27 @@ bool ThreadResource::cardPerform2(const byte *pSrc, int cardCmdId) { int ThreadResource::doApt() { loadTheApt(); + Common::Point aptPos(-1, -1); _vm->_playStamp2 = 151; _vm->_voy._viewBounds = _vm->_bVoy->boltEntry(_vm->_playStamp1)._rectResource; Common::Array<Common::Rect> &hotspots = _vm->_bVoy->boltEntry( _vm->_playStamp1 + 1)._rectResource->_entries; _vm->_eventsManager.getMouseInfo(); - if (_doAptPosX == -1) { - _doAptPosX = hotspots[2].left; - _doAptPosY = hotspots[2].top; + if (aptPos.x == -1) { + aptPos.x = hotspots[2].left; + aptPos.y = hotspots[2].top; _vm->_playStamp2 = 153; } if (_vm->_voy._field470 == 16) { hotspots[0].left = 999; hotspots[3].left = 999; - _doAptPosX = hotspots[4].left + 28; - _doAptPosY = hotspots[4].top + 28; + aptPos.x = hotspots[4].left + 28; + aptPos.y = hotspots[4].top + 28; } - _vm->_eventsManager.setMousePos(Common::Point(_doAptPosX, _doAptPosY)); + _vm->_eventsManager.setMousePos(Common::Point(aptPos.x, aptPos.y)); _vm->_soundManager.startVOCPlay(_vm->_soundManager.getVOCFileName(_vm->_playStamp2)); _vm->_playStamp2 = 151; @@ -1107,8 +1104,8 @@ int ThreadResource::doApt() { } while (!_vm->shouldQuit() && (!_vm->_eventsManager._leftClick || hotspotId == -1)); pt = _vm->_eventsManager.getMousePos(); - _doAptPosX = pt.x; - _doAptPosY = pt.y; + aptPos.x = pt.x; + aptPos.y = pt.y; switch (hotspotId) { case 0: |