aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2016-02-22 09:57:24 +0100
committerBastien Bouclet2016-02-22 09:57:24 +0100
commitbecbe41527eeb293fb23b7b1be7224f12d4af893 (patch)
tree98688558d767f62865af42fbf4dfafa2ca4530b4
parente54568b889e53056f716a2999cb755147b77fefe (diff)
downloadscummvm-rg350-becbe41527eeb293fb23b7b1be7224f12d4af893.tar.gz
scummvm-rg350-becbe41527eeb293fb23b7b1be7224f12d4af893.tar.bz2
scummvm-rg350-becbe41527eeb293fb23b7b1be7224f12d4af893.zip
MOHAWK: Continue to poll the events when playing blocking sounds
-rw-r--r--engines/mohawk/sound.cpp21
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) {