From 096e870b7bc15710a6650635cfea1b774303220b Mon Sep 17 00:00:00 2001 From: Peter Kohaut Date: Sun, 24 Feb 2019 19:45:03 +0100 Subject: BLADERUNNER: Fixed quick video playback in few occasions Overlays were played too quickly after using KIA. After outtakes finished, scene videos were playing too quickly. When ScummVM was not updating game and it was not paused (eg window drag) scene videos were played too quickly. --- engines/bladerunner/vqa_player.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'engines') diff --git a/engines/bladerunner/vqa_player.cpp b/engines/bladerunner/vqa_player.cpp index 9a1c89a5bc..040bb5817c 100644 --- a/engines/bladerunner/vqa_player.cpp +++ b/engines/bladerunner/vqa_player.cpp @@ -132,12 +132,14 @@ int VQAPlayer::update(bool forceDraw, bool advanceFrame, bool useTime, Graphics: } } if (useTime) { - if (_frameNextTime == 0) { + _frameNextTime += 60000 / 15; + + // In some cases (as overlay paused by kia or game window is moved) new time might be still in the past. + // This can cause rapid playback of video where every refresh renders different frame of the video. + // Can be avoided by setting next time to the future. + if (_frameNextTime < now) { _frameNextTime = now + 60000 / 15; } - else { - _frameNextTime += 60000 / 15; - } } _frameNext++; result = _frame; -- cgit v1.2.3