diff options
-rw-r--r-- | engines/mads/action.cpp | 4 | ||||
-rw-r--r-- | engines/mads/events.cpp | 7 | ||||
-rw-r--r-- | engines/mads/events.h | 2 | ||||
-rw-r--r-- | engines/mads/scene.cpp | 2 | ||||
-rw-r--r-- | engines/mads/screen.cpp | 16 |
5 files changed, 15 insertions, 16 deletions
diff --git a/engines/mads/action.cpp b/engines/mads/action.cpp index ccfd13be1d..e227d7c700 100644 --- a/engines/mads/action.cpp +++ b/engines/mads/action.cpp @@ -366,7 +366,7 @@ void MADSAction::checkActionAtMousePos() { scene._lookFlag = true; } - if (_vm->_events->_anyStroke && _vm->_events->_mouseButtons) { + if (_vm->_events->_rightMousePressed && _vm->_events->_mouseButtons) { switch (userInterface._category) { case CAT_COMMAND: case CAT_INV_VOCAB: @@ -507,7 +507,7 @@ void MADSAction::leftClick() { } } - if (abortFlag || (_vm->_events->_anyStroke && (userInterface._category == CAT_COMMAND || + if (abortFlag || (_vm->_events->_rightMousePressed && (userInterface._category == CAT_COMMAND || userInterface._category == CAT_INV_VOCAB))) return; diff --git a/engines/mads/events.cpp b/engines/mads/events.cpp index 244ae727e3..ecc7a528fd 100644 --- a/engines/mads/events.cpp +++ b/engines/mads/events.cpp @@ -46,7 +46,7 @@ EventsManager::EventsManager(MADSEngine *vm) { _vD4 = 0; _mouseMoved = false; _vD8 = 0; - _anyStroke = false; + _rightMousePressed = false; } EventsManager::~EventsManager() { @@ -129,21 +129,20 @@ void EventsManager::pollEvents() { case Common::EVENT_RBUTTONDOWN: _mouseClicked = true; _mouseButtons = 1; + _rightMousePressed = event.type == Common::EVENT_RBUTTONDOWN; _mouseMoved = true; - //_anyStroke = true; return; case Common::EVENT_LBUTTONUP: case Common::EVENT_RBUTTONUP: _mouseClicked = false; _mouseReleased = true; _mouseMoved = true; - //_anyStroke = true; + _rightMousePressed = false; return; case Common::EVENT_MOUSEMOVE: _mousePos = event.mouse; _currentPos = event.mouse; _mouseMoved = true; - //_anyStroke = true; break; default: break; diff --git a/engines/mads/events.h b/engines/mads/events.h index 8537605d4c..3b5820a6df 100644 --- a/engines/mads/events.h +++ b/engines/mads/events.h @@ -58,7 +58,7 @@ public: bool _mouseClicked; bool _mouseReleased; byte _mouseButtons; - bool _anyStroke; + bool _rightMousePressed; bool _keyPressed; int _vCC; int _vD2; diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp index 02877aac9c..2d95f86636 100644 --- a/engines/mads/scene.cpp +++ b/engines/mads/scene.cpp @@ -523,7 +523,7 @@ void Scene::updateCursor() { Player &player = _vm->_game->_player; CursorType cursorId = CURSOR_ARROW; - if (_action._interAwaiting == 1 && !_vm->_events->_anyStroke && + if (_action._interAwaiting == 1 && !_vm->_events->_rightMousePressed && _vm->_game->_screenObjects._category == CAT_HOTSPOT) { int idx = _vm->_game->_screenObjects._selectedObject - _userInterface._categoryIndexes[CAT_HOTSPOT - 1]; diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp index 44f0907040..f03f89122f 100644 --- a/engines/mads/screen.cpp +++ b/engines/mads/screen.cpp @@ -286,7 +286,7 @@ void ScreenObjects::check(bool scanFlag) { UserInterface &userInterface = scene._userInterface; if (!_vm->_events->_mouseButtons || _inputMode != kInputBuildingSentences) - _vm->_events->_anyStroke = false; + _vm->_events->_rightMousePressed = false; if ((_vm->_events->_mouseMoved || _vm->_game->_scene._userInterface._scrollerY || _v8332A || _v8333C) && scanFlag) { @@ -473,13 +473,13 @@ void ScreenObjects::elementHighlighted() { indexEnd = 9; varA = 5; topIndex = 0; - idxP = !_vm->_events->_anyStroke ? &userInterface._highlightedCommandIndex : + idxP = !_vm->_events->_rightMousePressed ? &userInterface._highlightedCommandIndex : &userInterface._selectedActionIndex; - if (_vm->_events->_anyStroke && userInterface._selectedItemVocabIdx >= 0) + if (_vm->_events->_rightMousePressed && userInterface._selectedItemVocabIdx >= 0) userInterface.updateSelection(CAT_INV_VOCAB, -1, &userInterface._selectedItemVocabIdx); - var4 = _released && !_vm->_events->_anyStroke ? 1 : 0; + var4 = _released && !_vm->_events->_rightMousePressed ? 1 : 0; break; case CAT_INV_LIST: @@ -505,12 +505,12 @@ void ScreenObjects::elementHighlighted() { varA = 0; topIndex = 0; - idxP = _vm->_events->_anyStroke ? &userInterface._selectedItemVocabIdx : &userInterface._highlightedActionIndex; + idxP = _vm->_events->_rightMousePressed ? &userInterface._selectedItemVocabIdx : &userInterface._highlightedActionIndex; - if (_vm->_events->_anyStroke && userInterface._selectedActionIndex >= 0) + if (_vm->_events->_rightMousePressed && userInterface._selectedActionIndex >= 0) userInterface.updateSelection(CAT_COMMAND, -1, &userInterface._selectedActionIndex); - var4 = _released && !_vm->_events->_anyStroke ? 1 : 0; + var4 = _released && !_vm->_events->_rightMousePressed ? 1 : 0; break; case CAT_INV_ANIM: @@ -605,7 +605,7 @@ void ScreenObjects::elementHighlighted() { newIndex = -1; } - if (_released && !_vm->_events->_anyStroke && + if (_released && !_vm->_events->_rightMousePressed && (_vm->_events->_mouseReleased || !_vm->_easyMouse)) newIndex = -1; |