diff options
author | Colin Snover | 2016-10-21 21:03:32 -0500 |
---|---|---|
committer | Colin Snover | 2016-10-21 21:04:01 -0500 |
commit | 90c2f77686978b09f758f8c0bbc39258fc691d58 (patch) | |
tree | d790c6901d26d261a115f1e6eb2bd825808aaebe | |
parent | 41d1e0a415c7c5647f2f05e7025c68cbf84a8b91 (diff) | |
download | scummvm-rg350-90c2f77686978b09f758f8c0bbc39258fc691d58.tar.gz scummvm-rg350-90c2f77686978b09f758f8c0bbc39258fc691d58.tar.bz2 scummvm-rg350-90c2f77686978b09f758f8c0bbc39258fc691d58.zip |
SCI32: Implement HShutterIn for SCI2.1mid+
Fixes Trac#9584.
-rw-r--r-- | engines/sci/graphics/transitions32.cpp | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp index ee230f50a8..330b9bedbf 100644 --- a/engines/sci/graphics/transitions32.cpp +++ b/engines/sci/graphics/transitions32.cpp @@ -389,6 +389,7 @@ ShowStyleList::iterator GfxTransitions32::deleteShowStyle(const ShowStyleList::i break; case kShowStyleNone: case kShowStyleMorph: + case kShowStyleHShutterIn: // do nothing break; default: @@ -546,7 +547,48 @@ void GfxTransitions32::processHShutterOut(PlaneShowStyle &showStyle) { } void GfxTransitions32::processHShutterIn(PlaneShowStyle &showStyle) { - error("HShutterIn is not known to be used by any game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!"); + if (getSciVersion() <= SCI_VERSION_2_1_EARLY) { + error("HShutterIn is not known to be used by any SCI2.1early- game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!"); + } + + Plane* plane = g_sci->_gfxFrameout->getVisiblePlanes().findByObject(showStyle.plane); + const Common::Rect &screenRect = plane->_screenRect; + Common::Rect rect; + + const int divisions = showStyle.divisions; + const int width = screenRect.width(); + const int divisionWidth = width / divisions - 1; + + if (width % divisions) { + rect.left = (divisionWidth + 1) * divisions + screenRect.left; + rect.top = screenRect.top; + rect.right = (divisionWidth + 1) * divisions + (width % divisions) + screenRect.left; + rect.bottom = screenRect.bottom; + g_sci->_gfxFrameout->showRect(rect); + } + + throttle(); + + for (int i = 0; i < width / (2 * divisions); ++i) { + // Left side + rect.left = i * divisions + screenRect.left; + rect.top = screenRect.top; + rect.right = i * divisions + divisions + screenRect.left; + rect.bottom = screenRect.bottom; + g_sci->_gfxFrameout->showRect(rect); + + // Right side + rect.left = (divisionWidth - i) * divisions + screenRect.left; + rect.top = screenRect.top; + rect.right = (divisionWidth - i) * divisions + divisions + screenRect.left; + rect.bottom = screenRect.bottom; + g_sci->_gfxFrameout->showRect(rect); + + throttle(); + } + + g_sci->_gfxFrameout->showRect(screenRect); + throttle(); } void GfxTransitions32::processVShutterOut(PlaneShowStyle &showStyle) { |