aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/riven.cpp18
-rw-r--r--engines/mohawk/riven.h1
-rw-r--r--engines/mohawk/riven_card.cpp4
-rw-r--r--engines/mohawk/riven_scripts.cpp2
-rw-r--r--engines/mohawk/riven_stacks/jspit.cpp4
5 files changed, 12 insertions, 17 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index b6692d0fd4..0fb62bd064 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -389,7 +389,7 @@ void MohawkEngine_Riven::changeToCard(uint16 dest) {
_gfx->clearCache();
if (!(getFeatures() & GF_DEMO)) {
- for (byte i = 0; i < 13; i++)
+ for (byte i = 0; i < ARRAYSIZE(rivenSpecialChange); i++)
if (_stack->getId() == rivenSpecialChange[i].startStack && dest == _stack->getCardStackId(
rivenSpecialChange[i].startCardRMAP)) {
changeToStack(rivenSpecialChange[i].targetStack);
@@ -397,26 +397,18 @@ void MohawkEngine_Riven::changeToCard(uint16 dest) {
}
}
+ // Clear any timer still floating around
+ _stack->removeTimer();
+
if (_card) {
_card->leave();
delete _card;
}
_card = new RivenCard(this, dest);
-
- refreshCard(); // Handles hotspots and scripts
-}
-
-void MohawkEngine_Riven::refreshCard() {
- // Clear any timer still floating around
- _stack->removeTimer();
-
_card->enter(true);
- if (_showHotspots)
- _card->drawHotspotRects();
-
// Now we need to redraw the cursor if necessary and handle mouse over scripts
- _stack->onMouseMove(_eventMan->getMousePos());
+ _stack->onMouseMove(_stack->getMousePosition());
// Finally, install any hardcoded timer
_stack->installCardTimer();
diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h
index 89bef70c52..c9fb4914c5 100644
--- a/engines/mohawk/riven.h
+++ b/engines/mohawk/riven.h
@@ -124,7 +124,6 @@ public:
RivenStack *constructStackById(uint16 id);
void changeToCard(uint16 dest);
void changeToStack(uint16);
- void refreshCard();
RivenCard *getCard() const { return _card; }
RivenStack *getStack() const { return _stack; }
diff --git a/engines/mohawk/riven_card.cpp b/engines/mohawk/riven_card.cpp
index 495f58a170..1d08cf51ac 100644
--- a/engines/mohawk/riven_card.cpp
+++ b/engines/mohawk/riven_card.cpp
@@ -79,6 +79,10 @@ void RivenCard::enter(bool unkMovies) {
initializeZipMode();
_vm->_gfx->applyScreenUpdate(true);
+ if (_vm->_showHotspots) {
+ drawHotspotRects();
+ }
+
runScript(kCardEnterScript);
}
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index e2e51d06c9..c99d8bd294 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -489,7 +489,7 @@ void RivenSimpleCommand::transition(uint16 op, uint16 argc, uint16 *argv) {
// Command 19: reload card
void RivenSimpleCommand::refreshCard(uint16 op, uint16 argc, uint16 *argv) {
- _vm->refreshCard();
+ _vm->getCard()->enter(false);
}
// Command 20: begin screen update
diff --git a/engines/mohawk/riven_stacks/jspit.cpp b/engines/mohawk/riven_stacks/jspit.cpp
index cd3b4baf51..eded3c588a 100644
--- a/engines/mohawk/riven_stacks/jspit.cpp
+++ b/engines/mohawk/riven_stacks/jspit.cpp
@@ -518,7 +518,7 @@ void JSpit::xjlagoon800_alert(uint16 argc, uint16 *argv) {
RivenVideo *leaving2 = _vm->_video->openSlot(6);
leaving2->playBlocking();
sunners = 2;
- _vm->refreshCard();
+ _vm->getCard()->enter(false);
}
}
@@ -536,7 +536,7 @@ void JSpit::xjlagoon1500_alert(uint16 argc, uint16 *argv) {
RivenVideo *leavingVideo = _vm->_video->openSlot(2);
leavingVideo->playBlocking();
sunners = 2;
- _vm->refreshCard();
+ _vm->getCard()->enter(false);
}
}