aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2017-08-05 14:01:11 +0200
committerBastien Bouclet2017-08-05 14:01:11 +0200
commit51a342b9ecc4282837f974a7bf06374a4de2680e (patch)
treec6853617717360ffaf18bb303f2794cf8c332f0f /engines
parente5869ecdc93a6b5cf9f9954419be6d5a14cd1ac5 (diff)
downloadscummvm-rg350-51a342b9ecc4282837f974a7bf06374a4de2680e.tar.gz
scummvm-rg350-51a342b9ecc4282837f974a7bf06374a4de2680e.tar.bz2
scummvm-rg350-51a342b9ecc4282837f974a7bf06374a4de2680e.zip
MOHAWK: Riven: Make sure to update the cursor when entering a card
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/riven.cpp2
-rw-r--r--engines/mohawk/riven_stack.cpp10
-rw-r--r--engines/mohawk/riven_stack.h8
3 files changed, 19 insertions, 1 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 59a41f5258..4d4f54c240 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -412,7 +412,7 @@ void MohawkEngine_Riven::changeToCard(uint16 dest) {
_card->enter(true);
// Now we need to redraw the cursor if necessary and handle mouse over scripts
- _stack->onMouseMove(_stack->getMousePosition());
+ _stack->queueMouseCursorRefresh();
// Finally, install any hardcoded timer
_stack->installCardTimer();
diff --git a/engines/mohawk/riven_stack.cpp b/engines/mohawk/riven_stack.cpp
index 2e1fd69082..847a98f5ab 100644
--- a/engines/mohawk/riven_stack.cpp
+++ b/engines/mohawk/riven_stack.cpp
@@ -40,6 +40,7 @@ RivenStack::RivenStack(MohawkEngine_Riven *vm, uint16 id) :
_vm(vm),
_id(id),
_mouseIsDown(false),
+ _shouldRefreshMouseCursor(false),
_keyPressed(Common::KEYCODE_INVALID) {
removeTimer();
@@ -275,6 +276,10 @@ void RivenStack::mouseForceUp() {
_mouseIsDown = false;
}
+void RivenStack::queueMouseCursorRefresh() {
+ _shouldRefreshMouseCursor = true;
+}
+
void RivenStack::onFrame() {
if (!_vm->getCard() || _vm->_scriptMan->hasQueuedScripts()) {
return;
@@ -284,6 +289,11 @@ void RivenStack::onFrame() {
_vm->_gfx->updateEffects();
+ if (_shouldRefreshMouseCursor) {
+ _vm->getCard()->onMouseMove(getMousePosition());
+ _shouldRefreshMouseCursor = false;
+ }
+
RivenScriptPtr script(new RivenScript());
if (_mouseIsDown) {
script += _vm->getCard()->onMouseDragUpdate();
diff --git a/engines/mohawk/riven_stack.h b/engines/mohawk/riven_stack.h
index 429169b960..740dff8adc 100644
--- a/engines/mohawk/riven_stack.h
+++ b/engines/mohawk/riven_stack.h
@@ -129,6 +129,13 @@ public:
/** Handle a mouse move event */
void onMouseMove(const Common::Point &mouse);
+ /**
+ * The mouse cursor needs to be refreshed on the next interactive frame
+ *
+ * Even if the mouse didn't move.
+ */
+ void queueMouseCursorRefresh();
+
/** Frame update handler */
void onFrame();
@@ -208,6 +215,7 @@ private:
bool _mouseIsDown;
Common::Point _mousePosition;
Common::Point _mouseDragStartPosition;
+ bool _shouldRefreshMouseCursor;
// Timer
Common::SharedPtr<TimerProc> _timerProc;