aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven_scripts.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-01-23 07:02:49 +0000
committerMatthew Hoops2011-01-23 07:02:49 +0000
commit191d85f174128c36890f7616689084ac343a5bfc (patch)
treef33736be4dc2a021ed42840de52b70196918f73e /engines/mohawk/riven_scripts.cpp
parent27d9ee3de1b175f68384d4bae74d2edc0614ebcc (diff)
downloadscummvm-rg350-191d85f174128c36890f7616689084ac343a5bfc.tar.gz
scummvm-rg350-191d85f174128c36890f7616689084ac343a5bfc.tar.bz2
scummvm-rg350-191d85f174128c36890f7616689084ac343a5bfc.zip
MOHAWK: Implement Riven's stopSound() and fadeAmbientSounds() opcodes
svn-id: r55460
Diffstat (limited to 'engines/mohawk/riven_scripts.cpp')
-rw-r--r--engines/mohawk/riven_scripts.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp
index 7decf4d2df..fcdae70ce5 100644
--- a/engines/mohawk/riven_scripts.cpp
+++ b/engines/mohawk/riven_scripts.cpp
@@ -394,14 +394,21 @@ void RivenScript::disableHotspot(uint16 op, uint16 argc, uint16 *argv) {
// Command 12: stop sounds (flags)
void RivenScript::stopSound(uint16 op, uint16 argc, uint16 *argv) {
+ // WORKAROUND: The Play Riven/Visit Riven/Start New Game buttons
+ // in the main menu call this function to stop ambient sounds
+ // after the change stack call to Temple Island. However, this
+ // would cause all ambient sounds not to play. An alternative
+ // fix would be to stop all scripts on a stack change, but this
+ // does fine for now.
+ if (_vm->getCurStack() == tspit && (_vm->getCurCardRMAP() == 0x6e9a || _vm->getCurCardRMAP() == 0xfeeb))
+ return;
+
// The argument is a bitflag for the setting.
// bit 0 is normal sound stopping (unused)
// bit 1 is ambient sound stopping
// Having no flags set means clear all
-
- // TODO: Enable this once empty SLST entries are properly handled
- //if (argv[0] & 2 || argv[0] == 0)
- // _vm->_sound->stopAllSLST();
+ if (argv[0] & 2 || argv[0] == 0)
+ _vm->_sound->stopAllSLST();
if (argv[0] & 1)
warning("Unhandled stopSound() flag");
@@ -521,7 +528,8 @@ void RivenScript::unk_36(uint16 op, uint16 argc, uint16 *argv) {
// Command 37: fade ambient sounds
void RivenScript::fadeAmbientSounds(uint16 op, uint16 argc, uint16 *argv) {
- warning("STUB: fadeAmbientSounds()");
+ // Similar to stopSound(), but does fading
+ _vm->_sound->stopAllSLST(true);
}
// Command 38: Play a movie with extra parameters (movie id, delay high, delay low, record type, record id)