From 9e1fa63575347e109cb713275b4d733f27a0fe6e Mon Sep 17 00:00:00 2001 From: Nicolas Bacca Date: Thu, 4 Mar 2004 18:54:35 +0000 Subject: Apply patch #907359 : Broken Sword videos improved frameskip svn-id: r13180 --- sword2/driver/animation.cpp | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'sword2/driver/animation.cpp') diff --git a/sword2/driver/animation.cpp b/sword2/driver/animation.cpp index 14accf6604..211c6b5fdb 100644 --- a/sword2/driver/animation.cpp +++ b/sword2/driver/animation.cpp @@ -142,6 +142,7 @@ bool AnimationState::init(const char *name) { info = mpeg2_info(decoder); framenum = 0; + frameskipped = 0; ticks = _vm->_system->get_msecs(); // Play audio @@ -358,8 +359,11 @@ bool AnimationState::decodeFrame() { #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) { @@ -372,16 +376,21 @@ bool AnimationState::decodeFrame() { _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) { @@ -392,8 +401,10 @@ bool AnimationState::decodeFrame() { _vm->sleepUntil(ticks); } - } else + } else { warning("dropped frame %i", framenum); + frameskipped++; + } #endif -- cgit v1.2.3