diff options
-rw-r--r-- | sword1/animation.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/sword1/animation.cpp b/sword1/animation.cpp index 9c0661ee2d..4f3fa9df69 100644 --- a/sword1/animation.cpp +++ b/sword1/animation.cpp @@ -307,6 +307,16 @@ bool AnimationState::decodeFrame() { * dropping frames if we run behind and delaying if we are too fast */ + /* FIXME: We shouldn't use delay_msecs() here. + * We should use something like the delay() + * function in SwordEngine, so that events are + * handled properly. For now, at least call the + * backend's event handler so that redraw + * events are processed. + */ + + OSystem::Event event; + #ifdef BACKEND_8BIT if (checkPaletteSwitch() || (bgSoundStream == NULL) || (bgSoundStream->getSamplesPlayed()*12/bgSoundStream->getRate()) < (framenum+3)){ @@ -320,8 +330,7 @@ bool AnimationState::decodeFrame() { while (_sys->get_msecs() < ticks) _sys->delay_msecs(10); } - - + _sys->poll_event(&event); } else warning("dropped frame %i", framenum); @@ -341,6 +350,7 @@ bool AnimationState::decodeFrame() { while (_sys->get_msecs() < ticks) _sys->delay_msecs(10); } + _sys->poll_event(&event); } else warning("dropped frame %i", framenum); |