From 65861bb914a3174a2922ba8f9c6435db0cc70f35 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Wed, 29 Nov 2017 22:43:52 +0100 Subject: SCI: Change workaround for PalVary / Animate race condition The new approach is to delay kAnimate briefly (with an 68ms timeout) while there is a zero-tick PalVary running, so that it has time to trigger. The previous workaround would immediately process a zero-tick PalVaryInit/PalVaryReverse. This caused problems in QfG3 (bug #10304) where it interfered with PalVaryPause. The previous workaround could also be modified to handle pause/resume, but this new approach should be closer to SSCI's behaviour, which used a timer for a zero-tick PalVary too. This fixes bug #10304, and keeps #5298 fixed too. --- engines/sci/graphics/animate.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/sci/graphics/animate.cpp') diff --git a/engines/sci/graphics/animate.cpp b/engines/sci/graphics/animate.cpp index 317e98feab..8875162394 100644 --- a/engines/sci/graphics/animate.cpp +++ b/engines/sci/graphics/animate.cpp @@ -650,6 +650,11 @@ void GfxAnimate::animateShowPic() { } void GfxAnimate::kernelAnimate(reg_t listReference, bool cycle, int argc, reg_t *argv) { + // If necessary, delay this kAnimate for a running PalVary. + // See delayForPalVaryWorkaround() for details. + if (_screen->_picNotValid) + _palette->delayForPalVaryWorkaround(); + byte old_picNotValid = _screen->_picNotValid; if (getSciVersion() >= SCI_VERSION_1_1) -- cgit v1.2.3