diff options
author | Colin Snover | 2016-08-27 21:11:18 -0500 |
---|---|---|
committer | Colin Snover | 2016-09-29 19:39:16 -0500 |
commit | 209fe0f92afea74e170d97c9ff0f697242fcac36 (patch) | |
tree | 3ccb8fd6cd9d62727de09fbc09c810e7458c658e | |
parent | 560af833007cd3583ceae51b58cf015390ad14ce (diff) | |
download | scummvm-rg350-209fe0f92afea74e170d97c9ff0f697242fcac36.tar.gz scummvm-rg350-209fe0f92afea74e170d97c9ff0f697242fcac36.tar.bz2 scummvm-rg350-209fe0f92afea74e170d97c9ff0f697242fcac36.zip |
SCI32: Fix incorrect use of speedThrottler in Video32
The sleep values for video playback are the amount of time until
the next frame needs to be displayed, whereas speedThrottler is
used to ensure that a given amount of time always elapses between
two triggered speedThrottler calls.
-rw-r--r-- | engines/sci/graphics/video32.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp index ab32a11f81..dbbe32eac6 100644 --- a/engines/sci/graphics/video32.cpp +++ b/engines/sci/graphics/video32.cpp @@ -86,9 +86,8 @@ void SEQPlayer::play(const Common::String &fileName, const int16 numTicks, const _decoder->start(); while (!g_engine->shouldQuit() && !_decoder->endOfVideo()) { + g_sci->sleep(_decoder->getTimeToNextFrame()); renderFrame(); - g_sci->getEngineState()->speedThrottler(_decoder->getTimeToNextFrame()); - g_sci->getEngineState()->_throttleTrigger = true; } _segMan->freeBitmap(_screenItem->_celInfo.bitmap); @@ -311,9 +310,8 @@ AVIPlayer::IOStatus AVIPlayer::play(const int16 from, const int16 to, const int1 void AVIPlayer::renderVideo() const { _decoder->start(); while (!g_engine->shouldQuit() && !_decoder->endOfVideo()) { - g_sci->getEngineState()->speedThrottler(_decoder->getTimeToNextFrame()); - g_sci->getEngineState()->_throttleTrigger = true; - if (_decoder->needsUpdate()) { + g_sci->sleep(_decoder->getTimeToNextFrame()); + while (_decoder->needsUpdate()) { renderFrame(); } } @@ -457,9 +455,8 @@ AVIPlayer::EventFlags AVIPlayer::playUntilEvent(EventFlags flags) { break; } - g_sci->getEngineState()->speedThrottler(_decoder->getTimeToNextFrame()); - g_sci->getEngineState()->_throttleTrigger = true; - if (_decoder->needsUpdate()) { + g_sci->sleep(_decoder->getTimeToNextFrame()); + while (_decoder->needsUpdate()) { renderFrame(); } |