[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.cpp,1.9,1.10

James Brown ender at users.sourceforge.net
Sun Jan 18 04:08:09 CET 2004


Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1:/tmp/cvs-serv12114/sword2/driver

Modified Files:
	animation.cpp 
Log Message:
Don't allow overlapping voice in cutscenes. Fixes crash in carib cutscene.


Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- animation.cpp	18 Jan 2004 05:52:04 -0000	1.9
+++ animation.cpp	18 Jan 2004 12:07:21 -0000	1.10
@@ -401,6 +401,7 @@
 	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 @@
 			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 @@
 	_vm->_graphics->clearScene();
 	_vm->_graphics->setNeedFullRedraw();
 
+/*
 	// HACK: Remove the instructions created above
 	Common::Rect r;
 
@@ -482,6 +490,7 @@
 	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.





More information about the Scummvm-git-logs mailing list