From b34e784c8a6f76f034ebfa62d1c95c809e5414b4 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 30 Oct 2016 19:25:46 -0400 Subject: TITANIC: Renamings of mouse methods --- engines/titanic/core/game_object.cpp | 8 ++++---- engines/titanic/core/game_object.h | 11 +++++++++-- engines/titanic/npcs/doorbot.cpp | 6 +++--- engines/titanic/support/mouse_cursor.cpp | 10 +++++----- engines/titanic/support/mouse_cursor.h | 13 ++++++++++--- 5 files changed, 31 insertions(+), 17 deletions(-) (limited to 'engines') diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp index 76a6274160..3ca917b3a1 100644 --- a/engines/titanic/core/game_object.cpp +++ b/engines/titanic/core/game_object.cpp @@ -1165,12 +1165,12 @@ void CGameObject::enableMouse() { showMouse(); } -void CGameObject::mouseLockE4() { - CScreenManager::_screenManagerPtr->_mouseCursor->lockE4(); +void CGameObject::mouseDisableControl() { + CScreenManager::_screenManagerPtr->_mouseCursor->disableControl(); } -void CGameObject::mouseUnlockE4() { - CScreenManager::_screenManagerPtr->_mouseCursor->unlockE4(); +void CGameObject::mouseEnableControl() { + CScreenManager::_screenManagerPtr->_mouseCursor->enableControl(); } void CGameObject::mouseSetPosition(const Point &pt, double rate) { diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h index b50278cf21..706f842252 100644 --- a/engines/titanic/core/game_object.h +++ b/engines/titanic/core/game_object.h @@ -165,8 +165,15 @@ protected: */ void enableMouse(); - void mouseLockE4(); - void mouseUnlockE4(); + /** + * Disables user control of the mouse + */ + void mouseDisableControl(); + + /** + * Re-enables user control of the mouse + */ + void mouseEnableControl(); /** * Sets the mouse to a new position diff --git a/engines/titanic/npcs/doorbot.cpp b/engines/titanic/npcs/doorbot.cpp index 247a8201b3..096b433873 100644 --- a/engines/titanic/npcs/doorbot.cpp +++ b/engines/titanic/npcs/doorbot.cpp @@ -287,7 +287,7 @@ bool CDoorbot::TimerMsg(CTimerMsg *msg) { case 5: lockInputHandler(); - mouseLockE4(); + mouseDisableControl(); _field114 = true; startTalking(this, 221485); break; @@ -301,7 +301,7 @@ bool CDoorbot::TimerMsg(CTimerMsg *msg) { case 7: CMouseButtonDownMsg::generate(); startTalking(this, 221486); - mouseUnlockE4(); + mouseEnableControl(); unlockInputHandler(); _field114 = false; disableMouse(); @@ -490,7 +490,7 @@ bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg) } case 10568: - mouseLockE4(); + mouseDisableControl(); mouseSetPosition(Point(600, 250), 2500); _timerId = addTimer(6, 2500, 0); break; diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp index 8a9b6b6656..efb78a8a0a 100644 --- a/engines/titanic/support/mouse_cursor.cpp +++ b/engines/titanic/support/mouse_cursor.cpp @@ -55,7 +55,7 @@ CMouseCursor::CursorEntry::~CursorEntry() { CMouseCursor::CMouseCursor(CScreenManager *screenManager) : _screenManager(screenManager), _cursorId(CURSOR_HOURGLASS), _hideCounter(0), - _hiddenCount(0), _cursorSuppressed(false), _setCursorCount(0), _fieldE4(0), _fieldE8(0) { + _hiddenCount(0), _cursorSuppressed(false), _setCursorCount(0), _inputEnabled(true), _fieldE8(0) { loadCursorImages(); setCursor(CURSOR_ARROW); CursorMan.showMouse(true); @@ -162,13 +162,13 @@ void CMouseCursor::update() { // No implementation needed } -void CMouseCursor::lockE4() { - _fieldE4 = 0; +void CMouseCursor::disableControl() { + _inputEnabled = false; CScreenManager::_screenManagerPtr->_inputHandler->incLockCount(); } -void CMouseCursor::unlockE4() { - _fieldE4 = 1; +void CMouseCursor::enableControl() { + _inputEnabled = true; _fieldE8 = 0; CScreenManager::_screenManagerPtr->_inputHandler->decLockCount(); } diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h index 41508fdaf4..39042a5ba1 100644 --- a/engines/titanic/support/mouse_cursor.h +++ b/engines/titanic/support/mouse_cursor.h @@ -69,7 +69,7 @@ private: int _hideCounter; int _hiddenCount; bool _cursorSuppressed; - int _fieldE4; + bool _inputEnabled; int _fieldE8; /** @@ -128,8 +128,15 @@ public: */ uint getChangeCount() const { return _setCursorCount; } - void lockE4(); - void unlockE4(); + /** + * Disables user control of the mouse + */ + void disableControl(); + + /** + * Re-enables user control of the mouse + */ + void enableControl(); /** * Sets the mouse to a new position -- cgit v1.2.3