diff options
author | Strangerke | 2013-04-10 11:57:48 +0200 |
---|---|---|
committer | Strangerke | 2013-04-10 11:57:48 +0200 |
commit | 5ae15d1e108a22736637664112c38bfaa1018316 (patch) | |
tree | 69b22063cb44c901ed5ae4062458388497c4e984 /engines/hopkins | |
parent | 55938b39755f2bac9fa180aa3f646fa8041b059c (diff) | |
download | scummvm-rg350-5ae15d1e108a22736637664112c38bfaa1018316.tar.gz scummvm-rg350-5ae15d1e108a22736637664112c38bfaa1018316.tar.bz2 scummvm-rg350-5ae15d1e108a22736637664112c38bfaa1018316.zip |
HOPKINS: Make the use of _mouseCursorId less verbose
Diffstat (limited to 'engines/hopkins')
-rw-r--r-- | engines/hopkins/dialogs.cpp | 17 | ||||
-rw-r--r-- | engines/hopkins/events.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/events.h | 2 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 6 |
4 files changed, 15 insertions, 12 deletions
diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp index 8eec73e5d0..f589e7396d 100644 --- a/engines/hopkins/dialogs.cpp +++ b/engines/hopkins/dialogs.cpp @@ -418,15 +418,17 @@ void DialogsManager::showInventory() { newInventoryItem = _vm->_linesMan->checkInventoryHotspots(mousePosX, mousePosY); if (newInventoryItem != oldInventoryItem) _vm->_objectsMan->initBorder(newInventoryItem); - if (_vm->_events->_mouseCursorId != 1 && _vm->_events->_mouseCursorId != 2 && _vm->_events->_mouseCursorId != 3 && _vm->_events->_mouseCursorId != 16) { + int cursorId = _vm->_events->_mouseCursorId; + if (cursorId != 1 && cursorId != 2 && cursorId != 3 && cursorId != 16) { if (mouseButton == 2) { _vm->_objectsMan->nextObjectIcon(newInventoryItem); - if (_vm->_events->_mouseCursorId != 23) - _vm->_events->changeMouseCursor(_vm->_events->_mouseCursorId); + if (cursorId != 23) + _vm->_events->changeMouseCursor(cursorId); } } + cursorId = _vm->_events->_mouseCursorId; if (mouseButton == 1) { - if (_vm->_events->_mouseCursorId == 1 || _vm->_events->_mouseCursorId == 2 || _vm->_events->_mouseCursorId == 3 || _vm->_events->_mouseCursorId == 16 || !_vm->_events->_mouseCursorId) + if (cursorId == 1 || cursorId == 2 || cursorId == 3 || cursorId == 16 || !cursorId) break; _vm->_objectsMan->takeInventoryObject(_vm->_globals->_inventory[newInventoryItem]); if (_vm->_events->_mouseCursorId == 8) @@ -478,11 +480,12 @@ void DialogsManager::showInventory() { _inventWin1 = _vm->_globals->freeMemory(_inventWin1); _inventBuf2 = _vm->_globals->freeMemory(_inventBuf2); - if (_vm->_events->_mouseCursorId == 1) + int cursorId = _vm->_events->_mouseCursorId; + if (cursorId == 1) showOptionsDialog(); - else if (_vm->_events->_mouseCursorId == 3) + else if (cursorId == 3) showLoadGame(); - else if (_vm->_events->_mouseCursorId == 2) + else if (cursorId == 2) showSaveGame(); _vm->_events->_mouseCursorId = 4; diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index b76fd6a6f4..6e2dc369c5 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -183,7 +183,7 @@ void EventsManager::mouseOn() { /** * Change Mouse Cursor */ -void EventsManager::changeMouseCursor(int id) { +void EventsManager::changeMouseCursor(const int id) { int cursorId = id; if (_mouseCursorId == 23) diff --git a/engines/hopkins/events.h b/engines/hopkins/events.h index 265cf53aae..1c3b3b1c28 100644 --- a/engines/hopkins/events.h +++ b/engines/hopkins/events.h @@ -75,7 +75,7 @@ public: void initMouseData(); void delay(int totalMilli); - void changeMouseCursor(int id); + void changeMouseCursor(const int id); void refreshEvents(); int waitKeyPress(); int getMouseX(); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index e9cc7c0c63..62f2f3883d 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -2522,11 +2522,11 @@ void ObjectsManager::initBorder(int zoneIdx) { * Get next icon for an object in the inventory */ void ObjectsManager::nextObjectIcon(int idx) { - if (_vm->_events->_mouseCursorId == 0 || _vm->_events->_mouseCursorId == 2 || - _vm->_events->_mouseCursorId == 3 || _vm->_events->_mouseCursorId == 16) + int cursorId = _vm->_events->_mouseCursorId; + if (cursorId == 0 || cursorId == 2 || cursorId == 3 || cursorId == 16) return; - int nextCursorId = _vm->_events->_mouseCursorId + 1; + int nextCursorId = cursorId + 1; if (nextCursorId > 25) nextCursorId = 6; |