diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/mohawk/sound.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp index 74796c3eda..a2c08d4a92 100644 --- a/engines/mohawk/sound.cpp +++ b/engines/mohawk/sound.cpp @@ -21,6 +21,7 @@ */ #include "common/debug.h" +#include "common/events.h" #include "common/system.h" #include "common/util.h" #include "common/textconsole.h" @@ -163,8 +164,26 @@ Audio::SoundHandle *Sound::replaceSoundMyst(uint16 id, byte volume, bool loop) { void Sound::playSoundBlocking(uint16 id, byte volume) { Audio::SoundHandle *handle = playSound(id, volume); - while (_vm->_mixer->isSoundHandleActive(*handle)) + while (_vm->_mixer->isSoundHandleActive(*handle) && !_vm->shouldQuit()) { + Common::Event event; + while (_vm->_system->getEventManager()->pollEvent(event)) { + switch (event.type) { + case Common::EVENT_KEYDOWN: + switch (event.kbd.keycode) { + case Common::KEYCODE_SPACE: + _vm->pauseGame(); + break; + default: + break; + } + default: + break; + } + } + + // Cut down on CPU usage _vm->_system->delayMillis(10); + } } void Sound::playMidi(uint16 id) { |