[Scummvm-git-logs] scummvm master -> b34e784c8a6f76f034ebfa62d1c95c809e5414b4

dreammaster dreammaster at scummvm.org
Mon Oct 31 00:25:53 CET 2016


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
b34e784c8a TITANIC: Renamings of mouse methods


Commit: b34e784c8a6f76f034ebfa62d1c95c809e5414b4
    https://github.com/scummvm/scummvm/commit/b34e784c8a6f76f034ebfa62d1c95c809e5414b4
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2016-10-30T19:25:46-04:00

Commit Message:
TITANIC: Renamings of mouse methods

Changed paths:
    engines/titanic/core/game_object.cpp
    engines/titanic/core/game_object.h
    engines/titanic/npcs/doorbot.cpp
    engines/titanic/support/mouse_cursor.cpp
    engines/titanic/support/mouse_cursor.h



diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 76a6274..3ca917b 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 b50278c..706f842 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 247a820..096b433 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 8a9b6b6..efb78a8 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 41508fd..39042a5 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





More information about the Scummvm-git-logs mailing list