diff options
author | Strangerke | 2013-08-11 11:39:47 +0200 |
---|---|---|
committer | Strangerke | 2013-08-11 11:40:16 +0200 |
commit | b749c2115b66a20fa6457a82eb1edf6f872fd6a5 (patch) | |
tree | 62691eb4b9b156dab5e0729a7d7bcbfe6e9de483 /engines/mortevielle | |
parent | 13ddf33e78109d7f1c8433a250bee66872a787fc (diff) | |
download | scummvm-rg350-b749c2115b66a20fa6457a82eb1edf6f872fd6a5.tar.gz scummvm-rg350-b749c2115b66a20fa6457a82eb1edf6f872fd6a5.tar.bz2 scummvm-rg350-b749c2115b66a20fa6457a82eb1edf6f872fd6a5.zip |
MORTEVIELLE: Move the end of "sentence" to the main loop in order to fix the display
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/sound.cpp | 5 | ||||
-rw-r--r-- | engines/mortevielle/sound.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/speech.cpp | 8 | ||||
-rw-r--r-- | engines/mortevielle/speech.h | 2 | ||||
-rw-r--r-- | engines/mortevielle/utils.cpp | 3 |
5 files changed, 14 insertions, 6 deletions
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp index a3ac56c27b..b3edead6f2 100644 --- a/engines/mortevielle/sound.cpp +++ b/engines/mortevielle/sound.cpp @@ -238,6 +238,11 @@ void SoundManager::litph(tablint &t, int typ, int tempo) { if (_vm->_speechManager._typlec == 0) return; + if (!_vm->_speechManager._buildingSentence) { + if (!_mixer->isSoundHandleActive(_soundHandle)) + _mixer->stopHandle(_speakerHandle); + _vm->_speechManager._buildingSentence = true; + } int freq = tempo * 10 * 25.2; int i = 0; while (i < _vm->_speechManager._ptr_oct) { diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h index dccae0eaab..101a62b348 100644 --- a/engines/mortevielle/sound.h +++ b/engines/mortevielle/sound.h @@ -103,6 +103,8 @@ private: public: Audio::Mixer *_mixer; Audio::QueuingAudioStream *_audioStream; + Audio::SoundHandle _soundHandle; + SoundManager(Audio::Mixer *mixer); ~SoundManager(); diff --git a/engines/mortevielle/speech.cpp b/engines/mortevielle/speech.cpp index 4940c93754..499f852b55 100644 --- a/engines/mortevielle/speech.cpp +++ b/engines/mortevielle/speech.cpp @@ -70,6 +70,7 @@ SpeechManager::SpeechManager() { _queue[i]._rep = 0; } _noise5Buf = nullptr; + _buildingSentence = false; } SpeechManager::~SpeechManager() { @@ -553,13 +554,10 @@ void SpeechManager::startSpeech(int rep, int ht, int typ) { handlePhoneme(); _vm->_soundManager.litph(_tbi, typ, tempo); + _vm->_speechManager._buildingSentence = false; if (typ != 0) { - Audio::SoundHandle soundHandle; _vm->_soundManager._audioStream->finish(); - _vm->_soundManager._mixer->playStream(Audio::Mixer::kSFXSoundType, &soundHandle, _vm->_soundManager._audioStream); - while (_vm->_soundManager._mixer->isSoundHandleActive(soundHandle) && !_vm->keyPressed() && !_vm->_mouseClick && !_vm->shouldQuit()) - ; - _vm->_soundManager._mixer->stopHandle(soundHandle); + _vm->_soundManager._mixer->playStream(Audio::Mixer::kSFXSoundType, &_vm->_soundManager._soundHandle, _vm->_soundManager._audioStream); _vm->_soundManager._audioStream = nullptr; } diff --git a/engines/mortevielle/speech.h b/engines/mortevielle/speech.h index 0117a61931..aa231c3536 100644 --- a/engines/mortevielle/speech.h +++ b/engines/mortevielle/speech.h @@ -58,7 +58,6 @@ private: int _phonemeNumb; SpeechQueue _queue[3]; - public: int _typlec; int _ptr_oct; @@ -67,6 +66,7 @@ public: int _mlec; byte *_noise5Buf; int _noise5Size; + bool _buildingSentence; SpeechManager(); ~SpeechManager(); diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp index 603dc6eae4..db1861c146 100644 --- a/engines/mortevielle/utils.cpp +++ b/engines/mortevielle/utils.cpp @@ -276,6 +276,9 @@ void MortevielleEngine::handleAction() { if (shouldQuit()) return; ++temps; + if (!_soundManager._mixer->isSoundHandleActive(_soundManager._soundHandle) || keyPressed() || _mouseClick) { + _soundManager._mixer->stopHandle(_soundManager._soundHandle); + } } while (!((_menu._menuSelected) || (temps > lim) || (funct) || (_anyone))); _inMainGameLoop = false; |