aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/access/access.cpp6
-rw-r--r--engines/access/sound.cpp4
-rw-r--r--engines/access/sound.h1
3 files changed, 9 insertions, 2 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 67255ff5ea..080a8ef975 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -227,7 +227,8 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
_sound->playSound(0);
_scripts->cmdFreeSound();
- _events->pollEvents();
+ while(_sound->isSFXPlaying() && !shouldQuit())
+ _events->pollEvents();
if (_events->isKeyMousePressed()) {
_sndSubFile += soundsLeft;
@@ -258,7 +259,8 @@ void AccessEngine::speakText(ASurface *s, const Common::String &msg) {
_sound->playSound(0);
_scripts->cmdFreeSound();
- _events->pollEvents();
+ while(_sound->isSFXPlaying() && !shouldQuit())
+ _events->pollEvents();
if (_events->_leftButton) {
_events->debounceLeft();
diff --git a/engines/access/sound.cpp b/engines/access/sound.cpp
index 82199a8286..cfc8b7a64c 100644
--- a/engines/access/sound.cpp
+++ b/engines/access/sound.cpp
@@ -162,6 +162,10 @@ void SoundManager::checkSoundQueue() {
DisposeAfterUse::YES);
}
+bool SoundManager::isSFXPlaying() {
+ return _mixer->isSoundHandleActive(_effectsHandle);
+}
+
void SoundManager::loadSounds(Common::Array<RoomInfo::SoundIdent> &sounds) {
debugC(1, kDebugSound, "loadSounds");
diff --git a/engines/access/sound.h b/engines/access/sound.h
index c276648477..3646c2cc16 100644
--- a/engines/access/sound.h
+++ b/engines/access/sound.h
@@ -66,6 +66,7 @@ public:
void playSound(int soundIndex);
void checkSoundQueue();
+ bool isSFXPlaying();
Resource *loadSound(int fileNum, int subfile);
void loadSounds(Common::Array<RoomInfo::SoundIdent> &sounds);