aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra/sound_adlib.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2008-11-03 19:51:34 +0000
committerJohannes Schickel2008-11-03 19:51:34 +0000
commit6eab0dcc6ef053ed70eeee3145e891dba7e5749d (patch)
tree70ff6041dfa897a249539d88a28d676e2996a95a /engines/kyra/sound_adlib.cpp
parentf3f3c69f6306a5f783826045fab0efe288f49058 (diff)
downloadscummvm-rg350-6eab0dcc6ef053ed70eeee3145e891dba7e5749d.tar.gz
scummvm-rg350-6eab0dcc6ef053ed70eeee3145e891dba7e5749d.tar.bz2
scummvm-rg350-6eab0dcc6ef053ed70eeee3145e891dba7e5749d.zip
Preliminary support for loading via GMM for KYRA engine.
svn-id: r34885
Diffstat (limited to 'engines/kyra/sound_adlib.cpp')
-rw-r--r--engines/kyra/sound_adlib.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/engines/kyra/sound_adlib.cpp b/engines/kyra/sound_adlib.cpp
index 62551d2b09..32b09ecd2d 100644
--- a/engines/kyra/sound_adlib.cpp
+++ b/engines/kyra/sound_adlib.cpp
@@ -2303,11 +2303,23 @@ void SoundAdlibPC::play(uint8 track) {
if ((soundId == 0xFFFF && _v2) || (soundId == 0xFF && !_v2) || !_soundDataPtr)
return;
+ // HACK: Since we might call this when the engines is paused (on game load via GMM)
+ // we must unpause the engine here, so this will work properly
+
+ int pauseCount = 0;
+ while (_vm->isPaused()) {
+ ++pauseCount;
+ _vm->pauseEngine(false);
+ }
+
while ((_driver->callback(16, 0) & 8)) {
// We call the system delay and not the game delay to avoid concurrency issues.
_vm->_system->delayMillis(10);
}
+ while (pauseCount--)
+ _vm->pauseEngine(true);
+
if (_sfxPlayingSound != -1) {
// Restore the sounds's normal values.
_driver->callback(10, _sfxPlayingSound, int(1), int(_sfxPriority));