aboutsummaryrefslogtreecommitdiff
path: root/engines/mortevielle/sound.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mortevielle/sound.cpp')
-rw-r--r--engines/mortevielle/sound.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 30dc4ce79f..b670246726 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -258,7 +258,7 @@ void SoundManager::litph(tablint &t, int typ, int tempo) {
} else if (idx == 46) {
if (!_audioStream)
_audioStream = Audio::makeQueuingAudioStream(freq, false);
- for (int i = 0; i < 10; i++)
+ for (int j = 0; j < 10; j++)
_audioStream->queueBuffer(emptyBuf, 19, DisposeAfterUse::NO, Audio::FLAG_UNSIGNED);
} else {
warning("Other code: %d - %d %d", idx, _troctBuf[i], _troctBuf[i + 1]);
@@ -741,6 +741,10 @@ void SoundManager::startSpeech(int rep, int ht, int typ) {
uint16 savph[501];
int tempo;
+ // Hack to avoid a crash in the ending version. To be removed when the speech are implemented
+ if ((rep == 141) && (typ == 0))
+ return;
+
if (_vm->_soundOff)
return;
@@ -784,4 +788,13 @@ void SoundManager::startSpeech(int rep, int ht, int typ) {
_vm->setPal(_vm->_numpal);
}
+void SoundManager::waitSpeech() {
+ while (_mixer->isSoundHandleActive(_soundHandle) && !_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit())
+ ;
+ // In case the handle is still active, stop it.
+ _mixer->stopHandle(_soundHandle);
+
+ if (!_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit())
+ g_system->delayMillis(600);
+}
} // End of namespace Mortevielle