From 724385eb5e3154628a5e1655471d7cf4d67b7a70 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sat, 22 Oct 2016 12:41:39 -0500 Subject: SCI32: Fix slow SCI2.1mid transitions SSCI transitions code sends a large number of small show rects to the graphics manager, one at a time, for each division of a transition. Each time a rect is submitted, a call to showBits is made. This design was used when transitions for SCI32 were first implemented in ScummVM, and it worked OK because the hardware surface was updated by EventManager::getSciEvent, not showBits, so the large number of calls to showBits from the transitions code did not adversely affect engine performance. Later in SCI32 engine development, hardware surface updates were changed to occur in showBits so that the hardware surface would be updated at frame-out time, instead of at input-in time. This change meant that now the large number of calls to showBits from transitions became very expensive, and the engine would stall constantly refreshing the entire hardware surface. To fix this problem, the transitions code now (1) maximises the size of rects coming from transitions, when possible, and (2) only calls showBits when all the rects from one frame of a transition have been calculated and added to the show rects list. Additionally, there were some arithmetic errors in the implementation of pixel dissolve that have been corrected in this changeset. Fixes Trac#9614. --- engines/sci/graphics/frameout.cpp | 8 -------- 1 file changed, 8 deletions(-) (limited to 'engines/sci/graphics/frameout.cpp') diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 843fe5ed86..bf43c8b63b 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -1272,14 +1272,6 @@ void GfxFrameout::throttle() { } } -void GfxFrameout::showRect(const Common::Rect &rect) { - if (!rect.isEmpty()) { - _showList.clear(); - _showList.add(rect); - showBits(); - } -} - void GfxFrameout::shakeScreen(int16 numShakes, const ShakeDirection direction) { if (direction & kShakeHorizontal) { // Used by QFG4 room 750 -- cgit v1.2.3