mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-05 17:57:14 +00:00
MORTEVIELLE: Move the end of "sentence" to the main loop in order to fix the display
This commit is contained in:
parent
13ddf33e78
commit
b749c2115b
@ -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) {
|
||||
|
@ -103,6 +103,8 @@ private:
|
||||
public:
|
||||
Audio::Mixer *_mixer;
|
||||
Audio::QueuingAudioStream *_audioStream;
|
||||
Audio::SoundHandle _soundHandle;
|
||||
|
||||
|
||||
SoundManager(Audio::Mixer *mixer);
|
||||
~SoundManager();
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user