aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorJames Brown2004-01-18 12:07:21 +0000
committerJames Brown2004-01-18 12:07:21 +0000
commit5a4c5e1485938afc854d3bc30fecde3094ffd507 (patch)
tree600d966664fe46a1f45fd7b8670b8dd761b40935 /sword2
parent6b377e6587b2f9954bb701065515f343ba570667 (diff)
downloadscummvm-rg350-5a4c5e1485938afc854d3bc30fecde3094ffd507.tar.gz
scummvm-rg350-5a4c5e1485938afc854d3bc30fecde3094ffd507.tar.bz2
scummvm-rg350-5a4c5e1485938afc854d3bc30fecde3094ffd507.zip
Don't allow overlapping voice in cutscenes. Fixes crash in carib cutscene.
svn-id: r12474
Diffstat (limited to 'sword2')
-rw-r--r--sword2/driver/animation.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp
index d36db9275a..e22f82e2db 100644
--- a/sword2/driver/animation.cpp
+++ b/sword2/driver/animation.cpp
@@ -401,6 +401,7 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *mu
PlayingSoundHandle handle;
bool skipCutscene = false, textVisible = false;
uint32 flags = SoundMixer::FLAG_16BITS;
+ bool startNextText = false;
uint8 oldPal[1024];
memcpy(oldPal, _vm->_graphics->_palCopy, 1024);
@@ -426,10 +427,16 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *mu
if (frameCounter == text[textCounter]->startFrame) {
openTextObject(text[textCounter]);
textVisible = true;
- if (text[textCounter]->speech) {
- _vm->_mixer->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, flags);
+
+ if (text[textCounter]->speech) {
+ startNextText = true;
}
- }
+ }
+
+ if (startNextText && !handle.isActive()) {
+ _vm->_mixer->playRaw(&handle, text[textCounter]->speech, text[textCounter]->speechBufferSize, 22050, flags);
+ startNextText = false;
+ }
if (frameCounter == text[textCounter]->endFrame) {
closeTextObject(text[textCounter]);
@@ -474,6 +481,7 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *mu
_vm->_graphics->clearScene();
_vm->_graphics->setNeedFullRedraw();
+/*
// HACK: Remove the instructions created above
Common::Rect r;
@@ -482,6 +490,7 @@ int32 MoviePlayer::play(const char *filename, MovieTextObject *text[], uint8 *mu
r.right = _vm->_graphics->_screenWide;
r.bottom = MENUDEEP;
_vm->_graphics->updateRect(&r);
+*/
// FIXME: For now, only play the lead-out music for cutscenes
// that have subtitles.