diff options
author | Eugene Sandulenko | 2017-08-29 09:25:37 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-08-29 09:33:44 +0200 |
commit | d0082982d52a98674cafca08a0822375c37a3d83 (patch) | |
tree | aeeb1ea1567d2704cf8d808db01fc5107b9b0ffd /engines/wage | |
parent | 1ec8d86593487a07bd9766bc86283de5df03b301 (diff) | |
download | scummvm-rg350-d0082982d52a98674cafca08a0822375c37a3d83.tar.gz scummvm-rg350-d0082982d52a98674cafca08a0822375c37a3d83.tar.bz2 scummvm-rg350-d0082982d52a98674cafca08a0822375c37a3d83.zip |
WAGE: Make sound blocking
Diffstat (limited to 'engines/wage')
-rw-r--r-- | engines/wage/sound.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/engines/wage/sound.cpp b/engines/wage/sound.cpp index fd6adaea19..36490695e1 100644 --- a/engines/wage/sound.cpp +++ b/engines/wage/sound.cpp @@ -49,6 +49,7 @@ #include "audio/mixer.h" #include "audio/decoders/raw.h" #include "common/stream.h" +#include "common/system.h" #include "wage/wage.h" #include "wage/entities.h" @@ -93,6 +94,24 @@ void WageEngine::playSound(Common::String soundName) { _mixer->playStream(Audio::Mixer::kPlainSoundType, &s->_handle, stream, -1, Audio::Mixer::kMaxChannelVolume, 0, DisposeAfterUse::NO); + + while (_mixer->isSoundHandleActive(s->_handle) && !_shouldQuit) { + Common::Event event; + + _eventMan->pollEvent(event); + + switch (event.type) { + case Common::EVENT_QUIT: + if (saveDialog()) + _shouldQuit = true; + break; + default: + break; + } + + _system->updateScreen(); + _system->delayMillis(10); + } } void WageEngine::updateSoundTimerForScene(Scene *scene, bool firstTime) { |