diff options
author | Paul Gilbert | 2017-01-21 21:16:39 -0500 |
---|---|---|
committer | Paul Gilbert | 2017-01-21 21:16:39 -0500 |
commit | 7c2265659aa69aed7aceecc76d660bef3d830b99 (patch) | |
tree | 132eea44dce16176f2bf941d0c96ab26f1a27997 /engines/titanic/support | |
parent | ddc08c8fa25245445910c386cdb2bca38314a756 (diff) | |
download | scummvm-rg350-7c2265659aa69aed7aceecc76d660bef3d830b99.tar.gz scummvm-rg350-7c2265659aa69aed7aceecc76d660bef3d830b99.tar.bz2 scummvm-rg350-7c2265659aa69aed7aceecc76d660bef3d830b99.zip |
TITANIC: Fix display of busy cursor across entire TV throw cutscene
Diffstat (limited to 'engines/titanic/support')
-rw-r--r-- | engines/titanic/support/mouse_cursor.cpp | 36 | ||||
-rw-r--r-- | engines/titanic/support/mouse_cursor.h | 22 |
2 files changed, 20 insertions, 38 deletions
diff --git a/engines/titanic/support/mouse_cursor.cpp b/engines/titanic/support/mouse_cursor.cpp index 86623da044..eb58296502 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), _inputEnabled(true), _fieldE8(0) { + _busyCount(0), _cursorSuppressed(false), _setCursorCount(0), _inputEnabled(true), _fieldE8(0) { loadCursorImages(); setCursor(CURSOR_ARROW); CursorMan.showMouse(true); @@ -87,45 +87,45 @@ void CMouseCursor::loadCursorImages() { } } -void CMouseCursor::show() { - assert(_hiddenCount > 0); - - if (--_hiddenCount == 0) - CursorMan.showMouse(!_cursorSuppressed); +void CMouseCursor::incBusyCount() { + if (_busyCount == 0) + setCursor(CURSOR_HOURGLASS); + ++_busyCount; } -void CMouseCursor::hide() { - CursorMan.showMouse(false); - ++_hiddenCount; +void CMouseCursor::decBusyCount() { + assert(_busyCount > 0); + if (--_busyCount == 0) + setCursor(CURSOR_ARROW); } void CMouseCursor::incHideCounter() { if (_hideCounter++ == 0) - hide(); + CursorMan.showMouse(false); } void CMouseCursor::decHideCounter() { --_hideCounter; assert(_hideCounter >= 0); if (_hideCounter == 0) - show(); + CursorMan.showMouse(true); } void CMouseCursor::suppressCursor() { _cursorSuppressed = true; - hide(); + CursorMan.showMouse(false); } void CMouseCursor::unsuppressCursor() { _cursorSuppressed = false; if (_hideCounter == 0) - show(); + CursorMan.showMouse(true); } void CMouseCursor::setCursor(CursorId cursorId) { ++_setCursorCount; - if (cursorId != _cursorId) { + if (cursorId != _cursorId && _busyCount == 0) { // The original cursors supported partial alpha when rendering the cursor. // Since we're using the ScummVM CursorMan, we can't do that, so we need // to build up a surface of the cursor with even partially transparent @@ -192,14 +192,6 @@ void CMouseCursor::enableControl() { CScreenManager::_screenManagerPtr->_inputHandler->decLockCount(); } -void CMouseCursor::setBusy() { - setCursor(CURSOR_HOURGLASS); -} - -void CMouseCursor::clearBusy() { - setCursor(CURSOR_ARROW); -} - void CMouseCursor::setPosition(const Point &pt, double duration) { _moveStartPos = g_vm->_events->getMousePos(); _moveDestPos = pt; diff --git a/engines/titanic/support/mouse_cursor.h b/engines/titanic/support/mouse_cursor.h index cd5e49fb90..325e31de96 100644 --- a/engines/titanic/support/mouse_cursor.h +++ b/engines/titanic/support/mouse_cursor.h @@ -67,7 +67,7 @@ private: CursorEntry _cursors[NUM_CURSORS]; uint _setCursorCount; int _hideCounter; - int _hiddenCount; + int _busyCount; bool _cursorSuppressed; int _fieldE8; Common::Point _moveStartPos; @@ -85,14 +85,15 @@ public: ~CMouseCursor(); /** - * Make the mouse cursor visible + * Increment the busy count for the cursor, showing an hourglass */ - void show(); + void incBusyCount(); /** - * Hide the mouse cursor + * Decrements the busy count, resetting back to an arrow cursor + * when the count reaches zero */ - void hide(); + void decBusyCount(); /** * Decrements the hide counter, and shows the mouse if @@ -143,17 +144,6 @@ public: void enableControl(); /** - * Shows the busy cursor - */ - void setBusy(); - - /** - * Resets the cursor back to normal - */ - void clearBusy(); - - - /** * Move the mouse to a new position */ void setPosition(const Point &pt, double duration); |