aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorStrangerke2013-08-13 07:53:42 +0200
committerStrangerke2013-08-13 07:54:08 +0200
commit3e75c5acc10259fb3cfbef4d275acbaf92cde1c0 (patch)
tree527662807cdbafff70445d8e18304fb008d751d2 /engines
parent7c58e9a6d57aa88590b0929110a617c6fe84a4fe (diff)
downloadscummvm-rg350-3e75c5acc10259fb3cfbef4d275acbaf92cde1c0.tar.gz
scummvm-rg350-3e75c5acc10259fb3cfbef4d275acbaf92cde1c0.tar.bz2
scummvm-rg350-3e75c5acc10259fb3cfbef4d275acbaf92cde1c0.zip
MORTEVIELLE: Wait for the end of sound in some more places
Diffstat (limited to 'engines')
-rw-r--r--engines/mortevielle/actions.cpp11
-rw-r--r--engines/mortevielle/sound.cpp9
-rw-r--r--engines/mortevielle/sound.h1
-rw-r--r--engines/mortevielle/utils.cpp3
4 files changed, 15 insertions, 9 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp
index f7cc239997..233f252c79 100644
--- a/engines/mortevielle/actions.cpp
+++ b/engines/mortevielle/actions.cpp
@@ -633,6 +633,7 @@ void MortevielleEngine::fctOpen() {
}
_openObjects[i] = _num;
displayAnimFrame(1, _num);
+ _soundManager.waitSpeech();
}
int tmpPlace = _coreVar._currPlace;
if (_coreVar._currPlace == CRYPT)
@@ -1147,10 +1148,7 @@ void MortevielleEngine::fctEnter() {
int randVal = (getRandomNumber(0, 10)) - 5;
_soundManager.startSpeech(7, randVal, 1);
displayAnimFrame(1, 1);
- while (_mixer->isSoundHandleActive(_soundManager._soundHandle) && !keyPressed() && !_mouseClick && !shouldQuit())
- ;
- // In case the handle is still active, stop it.
- _mixer->stopHandle(_soundManager._soundHandle);
+ _soundManager.waitSpeech();
int charIndex = convertBitIndexToCharacterIndex(z);
++_coreVar._faithScore;
@@ -1172,10 +1170,7 @@ void MortevielleEngine::fctEnter() {
int randVal = (getRandomNumber(0, 10)) - 5;
_soundManager.startSpeech(7, randVal, 1);
displayAnimFrame(1, 1);
- while (_mixer->isSoundHandleActive(_soundManager._soundHandle) && !keyPressed() && !_mouseClick && !shouldQuit())
- ;
- // In case the handle is still active, stop it.
- _mixer->stopHandle(_soundManager._soundHandle);
+ _soundManager.waitSpeech();
_coreVar._currPlace = _roomDoorId;
prepareDisplayText();
diff --git a/engines/mortevielle/sound.cpp b/engines/mortevielle/sound.cpp
index 30dc4ce79f..9fff106b61 100644
--- a/engines/mortevielle/sound.cpp
+++ b/engines/mortevielle/sound.cpp
@@ -784,4 +784,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
diff --git a/engines/mortevielle/sound.h b/engines/mortevielle/sound.h
index 1e4a4cd54c..cc0567fd98 100644
--- a/engines/mortevielle/sound.h
+++ b/engines/mortevielle/sound.h
@@ -98,6 +98,7 @@ public:
void loadAmbiantSounds();
void loadNoise();
void startSpeech(int rep, int ht, int typ);
+ void waitSpeech();
};
} // End of namespace Mortevielle
diff --git a/engines/mortevielle/utils.cpp b/engines/mortevielle/utils.cpp
index 80f19277df..eac4546fff 100644
--- a/engines/mortevielle/utils.cpp
+++ b/engines/mortevielle/utils.cpp
@@ -2385,6 +2385,7 @@ void MortevielleEngine::prepareRoom() {
displayTextInVerbBar(getEngineString(S_HEAR_NOISE));
int rand = (getRandomNumber(0, 4)) - 2;
_soundManager.startSpeech(1, rand, 1);
+ _soundManager.waitSpeech();
clearVerbBar();
}
}
@@ -2511,7 +2512,7 @@ void MortevielleEngine::initCaveOrCellar() {
displayTextInVerbBar(getEngineString(S_SOMEONE_ENTERS));
int rand = (getRandomNumber(0, 4)) - 2;
_soundManager.startSpeech(2, rand, 1);
-
+ _soundManager.waitSpeech();
// The original was doing here a useless loop.
// It has been removed