diff options
author | Matthew Hoops | 2010-02-16 23:15:57 +0000 |
---|---|---|
committer | Matthew Hoops | 2010-02-16 23:15:57 +0000 |
commit | be9a0946b4fac97be41d93366a9b28f9ed7e709b (patch) | |
tree | 1c74f2499753b07d58e491e02f9356f2fc949a04 /engines/mohawk/riven_external.cpp | |
parent | 5e24974ad5ba3031867a92b7936b0b3bb112f9d5 (diff) | |
download | scummvm-rg350-be9a0946b4fac97be41d93366a9b28f9ed7e709b.tar.gz scummvm-rg350-be9a0946b4fac97be41d93366a9b28f9ed7e709b.tar.bz2 scummvm-rg350-be9a0946b4fac97be41d93366a9b28f9ed7e709b.zip |
Implement xgwatch so you can now find out the combination to free Catherine.
svn-id: r48073
Diffstat (limited to 'engines/mohawk/riven_external.cpp')
-rw-r--r-- | engines/mohawk/riven_external.cpp | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/engines/mohawk/riven_external.cpp b/engines/mohawk/riven_external.cpp index 964fda5ba3..ba9e802e49 100644 --- a/engines/mohawk/riven_external.cpp +++ b/engines/mohawk/riven_external.cpp @@ -1193,19 +1193,50 @@ void RivenExternal::xogehnbooknextpage(uint16 argc, uint16 *argv) { _vm->_gfx->updateScreen(); } +static uint16 getComboDigit(uint32 correctCombo, uint32 digit) { + static const uint32 powers[] = { 100000, 10000, 1000, 100, 10, 1 }; + return (correctCombo % powers[digit]) / powers[digit + 1]; +} + void RivenExternal::xgwatch(uint16 argc, uint16 *argv) { - // TODO: Plays the prison combo on the watch + // Hide the cursor + _vm->_gfx->changeCursor(kRivenHideCursor); + + uint32 *prisonCombo = _vm->matchVarToString("pcorrectorder"); + uint32 soundTime = _vm->_system->getMillis() - 500; // Start the first sound instantly + byte curSound = 0; + + while (!_vm->shouldQuit()) { + // Play the next sound every half second + if (_vm->_system->getMillis() - soundTime >= 500) { + if (curSound == 5) // Break out after the last sound is done + break; + + _vm->_sound->playSound(getComboDigit(*prisonCombo, curSound) + 13); + curSound++; + soundTime = _vm->_system->getMillis(); + } + + // Poll events just to check for quitting + Common::Event event; + while (_vm->_system->getEventManager()->pollEvent(event)) {} + + // Cut down on CPU usage + _vm->_system->delayMillis(10); + } + + // Now play the video for the watch + _vm->_video->activateMLST(1, _vm->getCurCard()); + _vm->_video->playMovieBlocking(1); + + // And, finally, refresh + _vm->changeToCard(); } // ------------------------------------------------------------------------------------ // pspit (Prison Island) external commands // ------------------------------------------------------------------------------------ -static uint16 getComboDigit(uint32 correctCombo, uint32 digitsCorrect) { - static const uint32 powers[] = { 100000, 10000, 1000, 100, 10, 1 }; - return (correctCombo % powers[digitsCorrect]) / powers[digitsCorrect + 1]; -} - void RivenExternal::xpisland990_elevcombo(uint16 argc, uint16 *argv) { // Play button sound based on argv[0] _vm->_sound->playSound(argv[0] + 5, false); |