diff options
author | Bastien Bouclet | 2017-07-09 18:33:24 +0200 |
---|---|---|
committer | Bastien Bouclet | 2017-07-22 20:38:56 +0200 |
commit | 8f0fa86fbc88e324bdc5c8f4034056104a51003b (patch) | |
tree | d545a09f3951928f10b6e5cb82a00e29f935a7b4 /engines/mohawk/myst.cpp | |
parent | 3dd4da0c37e5c853e837b5b4af3ebff1536432f8 (diff) | |
download | scummvm-rg350-8f0fa86fbc88e324bdc5c8f4034056104a51003b.tar.gz scummvm-rg350-8f0fa86fbc88e324bdc5c8f4034056104a51003b.tar.bz2 scummvm-rg350-8f0fa86fbc88e324bdc5c8f4034056104a51003b.zip |
MOHAWK: Myst: Change blocking sounds to use the main loop
Diffstat (limited to 'engines/mohawk/myst.cpp')
-rw-r--r-- | engines/mohawk/myst.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp index f965756fca..3237c949f3 100644 --- a/engines/mohawk/myst.cpp +++ b/engines/mohawk/myst.cpp @@ -268,6 +268,14 @@ void MohawkEngine_Myst::waitUntilMovieEnds(const VideoEntryPtr &video) { _video->removeEntry(video); } +void MohawkEngine_Myst::playSoundBlocking(uint16 id, byte volume) { + _sound->playSound(id, volume); + + while (_sound->isPlaying() && !shouldQuit()) { + doFrame(); + } +} + Common::Error MohawkEngine_Myst::run() { MohawkEngine::run(); @@ -478,7 +486,7 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS _sound->stopBackgroundMyst(); _video->stopVideos(); if (linkSrcSound) - _sound->playSoundBlocking(linkSrcSound); + playSoundBlocking(linkSrcSound); // Delete the previous stack and move the current stack to the previous one // There's probably a better way to do this, but the script classes shouldn't @@ -588,7 +596,7 @@ void MohawkEngine_Myst::changeToStack(uint16 stack, uint16 card, uint16 linkSrcS changeToCard(card, kTransitionCopy); if (linkDstSound) - _sound->playSoundBlocking(linkDstSound); + playSoundBlocking(linkDstSound); } uint16 MohawkEngine_Myst::getCardBackgroundId() { |