From 6eab0dcc6ef053ed70eeee3145e891dba7e5749d Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 3 Nov 2008 19:51:34 +0000 Subject: Preliminary support for loading via GMM for KYRA engine. svn-id: r34885 --- engines/kyra/sound_adlib.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/kyra/sound_adlib.cpp') 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)); -- cgit v1.2.3