aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorMatthew Hoops2011-01-24 02:43:07 +0000
committerMatthew Hoops2011-01-24 02:43:07 +0000
commitd6a4ff36392b14afea6da749c2b2f4f14906ed64 (patch)
tree54d075fc0136f071442fdf10c9f026fc54f27003 /engines/mohawk
parent0f07082a78355b8607bf04dd4e1ba42e14fc636f (diff)
downloadscummvm-rg350-d6a4ff36392b14afea6da749c2b2f4f14906ed64.tar.gz
scummvm-rg350-d6a4ff36392b14afea6da749c2b2f4f14906ed64.tar.bz2
scummvm-rg350-d6a4ff36392b14afea6da749c2b2f4f14906ed64.zip
MOHAWK: Recheck the current hotspot if a script has changed the enabled hotspots in Riven
svn-id: r55493
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/riven.cpp8
-rw-r--r--engines/mohawk/riven.h3
-rw-r--r--engines/mohawk/riven_external.cpp6
-rw-r--r--engines/mohawk/riven_scripts.cpp9
4 files changed, 19 insertions, 7 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 00d0e5255f..935ab4b45f 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -376,8 +376,7 @@ void MohawkEngine_Riven::refreshCard() {
}
// Now we need to redraw the cursor if necessary and handle mouse over scripts
- _curHotspot = -1;
- checkHotspotChange();
+ updateCurrentHotspot();
}
void MohawkEngine_Riven::loadCard(uint16 id) {
@@ -496,6 +495,11 @@ void MohawkEngine_Riven::checkHotspotChange() {
}
}
+void MohawkEngine_Riven::updateCurrentHotspot() {
+ _curHotspot = -1;
+ checkHotspotChange();
+}
+
Common::String MohawkEngine_Riven::getHotspotName(uint16 hotspot) {
assert(hotspot < _hotspotCount);
diff --git a/engines/mohawk/riven.h b/engines/mohawk/riven.h
index 16acf9419c..60a31736d7 100644
--- a/engines/mohawk/riven.h
+++ b/engines/mohawk/riven.h
@@ -146,6 +146,7 @@ private:
void checkInventoryClick();
bool _showHotspots;
void updateZipMode();
+ void checkHotspotChange();
// Variables
uint32 *_vars;
@@ -177,7 +178,7 @@ public:
void runHotspotScript(uint16 hotspot, uint16 scriptType);
int32 getCurHotspot() const { return _curHotspot; }
Common::String getHotspotName(uint16 hotspot);
- void checkHotspotChange();
+ void updateCurrentHotspot();
// Variable functions
void initVars();
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp
index c806c93130..98abfaae8e 100644
--- a/engines/mohawk/riven_external.cpp
+++ b/engines/mohawk/riven_external.cpp
@@ -1796,8 +1796,7 @@ void RivenExternal::xschool280_playwhark(uint16 argc, uint16 *argv) {
_vm->_hotspots[3].enabled = !_vm->_hotspots[3].enabled;
// Update the cursor
- _vm->_curHotspot = -1;
- _vm->checkHotspotChange();
+ _vm->updateCurrentHotspot();
}
void RivenExternal::xjatboundary(uint16 argc, uint16 *argv) {
@@ -2460,8 +2459,7 @@ void RivenExternal::xtakeit(uint16 argc, uint16 *argv) {
// Check the new hotspots and refresh everything
*marble = 0;
setMarbleHotspots();
- _vm->_curHotspot = -1;
- _vm->checkHotspotChange();
+ _vm->updateCurrentHotspot();
_vm->_gfx->updateScreen();
}
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index fcdae70ce5..5d459354e9 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -380,6 +380,9 @@ void RivenScript::enableHotspot(uint16 op, uint16 argc, uint16 *argv) {
_vm->_hotspots[i].enabled = true;
}
}
+
+ // Recheck our current hotspot because it may have now changed
+ _vm->updateCurrentHotspot();
}
// Command 10: disable hotspot (blst_id)
@@ -390,6 +393,9 @@ void RivenScript::disableHotspot(uint16 op, uint16 argc, uint16 *argv) {
_vm->_hotspots[i].enabled = false;
}
}
+
+ // Recheck our current hotspot because it may have now changed
+ _vm->updateCurrentHotspot();
}
// Command 12: stop sounds (flags)
@@ -589,6 +595,9 @@ void RivenScript::activateBLST(uint16 op, uint16 argc, uint16 *argv) {
}
delete blst;
+
+ // Recheck our current hotspot because it may have now changed
+ _vm->updateCurrentHotspot();
}
// Command 44: activate FLST record (information on which SFXE resource this card should use)