[Scummvm-cvs-logs] CVS: scummvm/sword2/driver animation.cpp,1.21.2.5,1.21.2.6 animation.h,1.18.2.2,1.18.2.3

Nicolas Bacca arisme at users.sourceforge.net
Thu Mar 4 11:19:02 CET 2004


Update of /cvsroot/scummvm/scummvm/sword2/driver
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16444/sword2/driver

Modified Files:
      Tag: branch-0-6-0
	animation.cpp animation.h 
Log Message:
Apply patch #907359 : Broken Sword videos improved frameskip

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.cpp,v
retrieving revision 1.21.2.5
retrieving revision 1.21.2.6
diff -u -d -r1.21.2.5 -r1.21.2.6
--- animation.cpp	1 Mar 2004 04:03:31 -0000	1.21.2.5
+++ animation.cpp	4 Mar 2004 18:56:39 -0000	1.21.2.6
@@ -140,6 +140,7 @@
 
 	info = mpeg2_info(decoder);
 	framenum = 0;
+	frameskipped = 0;
 	ticks = _vm->_system->get_msecs();
 
 	// Play audio
@@ -368,8 +369,11 @@
 
 #ifdef BACKEND_8BIT
 				if (checkPaletteSwitch() || (bgSoundStream == NULL) ||
-					((_vm->_mixer->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1)) {
-
+					((_vm->_mixer->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1) || frameskipped > 10) {
+					if (frameskipped > 10) {
+						warning("force frame %i redraw", framenum);
+						frameskipped = 0;
+					}
 					_vm->_graphics->plotYUV(lut, sequence_i->width, sequence_i->height, info->display_fbuf->buf);
 
 					if (bgSoundStream) {
@@ -382,16 +386,21 @@
 
 					_vm->_graphics->setNeedFullRedraw();
 
-				} else
+				} else {
 					warning("dropped frame %i", framenum);
+					frameskipped++;
+				}
 
 				buildLookup(palnum + 1, lutcalcnum);
 
 #else
 
 				if ((bgSoundStream == NULL) ||
-					((_vm->_mixer->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1)) {
-
+					((_vm->_mixer->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1) || frameskipped > 10) {
+					if (frameskipped > 10) {
+						warning("force frame %i redraw", framenum);
+						frameskipped = 0;
+					}
 					plotYUV(lookup, sequence_i->width, sequence_i->height, info->display_fbuf->buf);
 
 					if (bgSoundStream) {
@@ -402,8 +411,10 @@
 						_vm->sleepUntil(ticks);
 					}
 
-				} else
+				} else {
 					warning("dropped frame %i", framenum);
+					frameskipped++;
+				}
 
 #endif
 

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/driver/animation.h,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -d -r1.18.2.2 -r1.18.2.3
--- animation.h	1 Mar 2004 04:03:31 -0000	1.18.2.2
+++ animation.h	4 Mar 2004 18:56:39 -0000	1.18.2.3
@@ -71,6 +71,7 @@
 	Sword2Engine *_vm;
 
 	uint framenum;
+	uint frameskipped;
 	int ticks;
 
 #ifdef USE_MPEG2





More information about the Scummvm-git-logs mailing list