Skip to content

Commit

Permalink
TITANIC: Renamings of mouse methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Oct 30, 2016
1 parent 5348f4f commit b34e784
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 17 deletions.
8 changes: 4 additions & 4 deletions engines/titanic/core/game_object.cpp
Expand Up @@ -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) {
Expand Down
11 changes: 9 additions & 2 deletions engines/titanic/core/game_object.h
Expand Up @@ -165,8 +165,15 @@ class CGameObject : public CNamedItem {
*/
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
Expand Down
6 changes: 3 additions & 3 deletions engines/titanic/npcs/doorbot.cpp
Expand Up @@ -287,7 +287,7 @@ bool CDoorbot::TimerMsg(CTimerMsg *msg) {

case 5:
lockInputHandler();
mouseLockE4();
mouseDisableControl();
_field114 = true;
startTalking(this, 221485);
break;
Expand All @@ -301,7 +301,7 @@ bool CDoorbot::TimerMsg(CTimerMsg *msg) {
case 7:
CMouseButtonDownMsg::generate();
startTalking(this, 221486);
mouseUnlockE4();
mouseEnableControl();
unlockInputHandler();
_field114 = false;
disableMouse();
Expand Down Expand Up @@ -490,7 +490,7 @@ bool CDoorbot::TrueTalkNotifySpeechEndedMsg(CTrueTalkNotifySpeechEndedMsg *msg)
}

case 10568:
mouseLockE4();
mouseDisableControl();
mouseSetPosition(Point(600, 250), 2500);
_timerId = addTimer(6, 2500, 0);
break;
Expand Down
10 changes: 5 additions & 5 deletions engines/titanic/support/mouse_cursor.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
}
Expand Down
13 changes: 10 additions & 3 deletions engines/titanic/support/mouse_cursor.h
Expand Up @@ -69,7 +69,7 @@ class CMouseCursor {
int _hideCounter;
int _hiddenCount;
bool _cursorSuppressed;
int _fieldE4;
bool _inputEnabled;
int _fieldE8;

/**
Expand Down Expand Up @@ -128,8 +128,15 @@ class CMouseCursor {
*/
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
Expand Down

0 comments on commit b34e784

Please sign in to comment.