aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/support/mouse_cursor.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-01-21 21:16:39 -0500
committerPaul Gilbert2017-01-21 21:16:39 -0500
commit7c2265659aa69aed7aceecc76d660bef3d830b99 (patch)
tree132eea44dce16176f2bf941d0c96ab26f1a27997 /engines/titanic/support/mouse_cursor.cpp
parentddc08c8fa25245445910c386cdb2bca38314a756 (diff)
downloadscummvm-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/mouse_cursor.cpp')
-rw-r--r--engines/titanic/support/mouse_cursor.cpp36
1 files changed, 14 insertions, 22 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;