diff options
author | Matthew Hoops | 2010-09-08 20:50:56 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-09-08 20:50:56 +0000 |
commit | 0cba4f030691f83e487ddcc688214feef9a8b65e (patch) | |
tree | 040f822b9c29f6d43d9a96e39296fd9764056dcd /engines/mohawk/riven_scripts.cpp | |
parent | 47ad577a785aaeef7856aca883b367e9b681c4b7 (diff) | |
download | scummvm-rg350-0cba4f030691f83e487ddcc688214feef9a8b65e.tar.gz scummvm-rg350-0cba4f030691f83e487ddcc688214feef9a8b65e.tar.bz2 scummvm-rg350-0cba4f030691f83e487ddcc688214feef9a8b65e.zip |
MOHAWK: Implement blocking sound in Riven
Sounds that set the third argument of the playSound opcode to 1 (wherever they may be) will now block. The volume parameter of playSound is also now honored. Merge the Myst sound blocking code with this too.
svn-id: r52643
Diffstat (limited to 'engines/mohawk/riven_scripts.cpp')
-rw-r--r-- | engines/mohawk/riven_scripts.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engines/mohawk/riven_scripts.cpp b/engines/mohawk/riven_scripts.cpp index 151df9f147..30d1d727eb 100644 --- a/engines/mohawk/riven_scripts.cpp +++ b/engines/mohawk/riven_scripts.cpp @@ -346,9 +346,14 @@ void RivenScript::playScriptSLST(uint16 op, uint16 argc, uint16 *argv) { _vm->_activatedSLST = true; } -// Command 4: play local tWAV resource (twav_id, volume, u1) +// Command 4: play local tWAV resource (twav_id, volume, block) void RivenScript::playSound(uint16 op, uint16 argc, uint16 *argv) { - _vm->_sound->playSound(argv[0]); + byte volume = Sound::convertRivenVolume(argv[1]); + + if (argv[2] == 1) + _vm->_sound->playSoundBlocking(argv[0], volume); + else + _vm->_sound->playSound(argv[0], volume); } // Command 7: set variable value (variable, value) @@ -572,7 +577,8 @@ void RivenScript::activateFLST(uint16 op, uint16 argc, uint16 *argv) { for (uint16 i = 0; i < recordCount; i++) { uint16 index = flst->readUint16BE(); uint16 sfxeID = flst->readUint16BE(); - if(flst->readUint16BE() != 0) + + if (flst->readUint16BE() != 0) warning("FLST u0 non-zero"); if (index == argv[0]) { |