diff options
author | Paul Gilbert | 2016-10-26 19:11:35 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-10-26 19:11:35 -0400 |
commit | 21562fba08a92a342911949bae7ff9ed9ee5d123 (patch) | |
tree | ae19719ddaab3b4c11c6ba4d3e38647ccf408d5d /engines/titanic/support | |
parent | 2fe167afc355de7e9d4e11595597ac8fb4b94636 (diff) | |
download | scummvm-rg350-21562fba08a92a342911949bae7ff9ed9ee5d123.tar.gz scummvm-rg350-21562fba08a92a342911949bae7ff9ed9ee5d123.tar.bz2 scummvm-rg350-21562fba08a92a342911949bae7ff9ed9ee5d123.zip |
TITANIC: Add yet another mouse hiding counter the game uses
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/mouse_cursor.cpp | 8 | ||||
-rw-r--r-- | engines/titanic/support/mouse_cursor.h | 1 | ||||
-rw-r--r-- | engines/titanic/support/screen_manager.cpp | 1 |
3 files changed, 7 insertions, 3 deletions
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp index e1022c7f08..8a9b6b6656 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), - _cursorSuppressed(false), _setCursorCount(0), _fieldE4(0), _fieldE8(0) { + _hiddenCount(0), _cursorSuppressed(false), _setCursorCount(0), _fieldE4(0), _fieldE8(0) { loadCursorImages(); setCursor(CURSOR_ARROW); CursorMan.showMouse(true); @@ -88,11 +88,15 @@ void CMouseCursor::loadCursorImages() { } void CMouseCursor::show() { - CursorMan.showMouse(!_cursorSuppressed); + assert(_hiddenCount > 0); + + if (--_hiddenCount == 0) + CursorMan.showMouse(!_cursorSuppressed); } void CMouseCursor::hide() { CursorMan.showMouse(false); + ++_hiddenCount; } void CMouseCursor::incHideCounter() { diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h index 8960c54f8a..41508fdaf4 100644 --- a/engines/titanic/support/mouse_cursor.h +++ b/engines/titanic/support/mouse_cursor.h @@ -67,6 +67,7 @@ private: CursorEntry _cursors[NUM_CURSORS]; uint _setCursorCount; int _hideCounter; + int _hiddenCount; bool _cursorSuppressed; int _fieldE4; int _fieldE8; diff --git a/engines/titanic/support/screen_manager.cpp b/engines/titanic/support/screen_manager.cpp index a688cf0f60..2a675394b5 100644 --- a/engines/titanic/support/screen_manager.cpp +++ b/engines/titanic/support/screen_manager.cpp @@ -330,7 +330,6 @@ void OSScreenManager::loadCursors() { delete _mouseCursor; } _mouseCursor = new CMouseCursor(this); - showCursor(); if (!_textCursor) { _textCursor = new CTextCursor(this); |