[Scummvm-cvs-logs] CVS: scummvm/sword1 animation.cpp,1.16,1.17 animation.h,1.7,1.8

Nicolas Bacca arisme at users.sourceforge.net
Thu Mar 4 11:16:08 CET 2004


Update of /cvsroot/scummvm/scummvm/sword1
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15879/sword1

Modified Files:
	animation.cpp animation.h 
Log Message:
Apply patch #907359 : Broken Sword videos improved frameskip

Index: animation.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/animation.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- animation.cpp	1 Mar 2004 04:05:10 -0000	1.16
+++ animation.cpp	4 Mar 2004 18:54:34 -0000	1.17
@@ -134,6 +134,7 @@
 
 	info = mpeg2_info(decoder);
 	framenum = 0;
+	frameskipped = 0;
 	ticks = _sys->get_msecs();
 
 	/* Play audio - TODO: Sync with video?*/
@@ -313,7 +314,11 @@
 
 #ifdef BACKEND_8BIT
 				if (checkPaletteSwitch() || (bgSoundStream == NULL) ||
-                                    ((_snd->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1)) {
+                                    ((_snd->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1) || frameskipped > 10) {
+					if (frameskipped > 10) {
+						warning("force frame %i redraw", framenum);
+						frameskipped = 0;
+					}
 					_scr->plotYUV(lut, sequence_i->width, sequence_i->height, info->display_fbuf->buf);
 
 					if (bgSoundStream) {
@@ -325,14 +330,20 @@
 							_sys->delay_msecs(10);
 					}
 
-				} else
+				} else {
 					warning("dropped frame %i", framenum);
+					frameskipped++;
+				}
 
 				buildLookup(palnum + 1, lutcalcnum);
 
 #else
 
-				if ((bgSoundStream == NULL) || ((_snd->getChannelElapsedTime(bgSound) * 12) / 1000 < framenum + 1)) {
+				if ((bgSoundStream == NULL) || ((_snd->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) {
@@ -344,8 +355,10 @@
 							_sys->delay_msecs(10);
 					}
 
-				} else
+				} else {
 					warning("dropped frame %i", framenum);
+					frameskipped++;
+				}
 
 #endif
 

Index: animation.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword1/animation.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- animation.h	1 Mar 2004 04:05:10 -0000	1.7
+++ animation.h	4 Mar 2004 18:54:34 -0000	1.8
@@ -77,6 +77,7 @@
 	OSystem *_sys;
 
 	uint framenum;
+	uint frameskipped;
 	uint32 ticks;
 
 #ifdef USE_MPEG2





More information about the Scummvm-git-logs mailing list