diff options
author | Colin Snover | 2017-01-12 10:55:13 -0600 |
---|---|---|
committer | Colin Snover | 2017-01-12 13:14:03 -0600 |
commit | 54e94c572aeb58e160537e2145c0fff44e862be3 (patch) | |
tree | 94cd9c1ddc9d0da233bfaf9b86f02a61c8483bb1 /engines/sci/graphics | |
parent | d5f0d1fdb26caea8d734371a539be9ed5764a899 (diff) | |
download | scummvm-rg350-54e94c572aeb58e160537e2145c0fff44e862be3.tar.gz scummvm-rg350-54e94c572aeb58e160537e2145c0fff44e862be3.tar.bz2 scummvm-rg350-54e94c572aeb58e160537e2145c0fff44e862be3.zip |
SCI32: Add workarounds, transitions, fixes for PQ4CD
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/paint32.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/transitions32.cpp | 61 | ||||
-rw-r--r-- | engines/sci/graphics/transitions32.h | 6 |
3 files changed, 63 insertions, 10 deletions
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp index bf7c73623e..8a63365f03 100644 --- a/engines/sci/graphics/paint32.cpp +++ b/engines/sci/graphics/paint32.cpp @@ -121,7 +121,7 @@ void GfxPaint32::plotter(int x, int y, int color, void *data) { reg_t GfxPaint32::makeLineBitmap(const Common::Point &startPoint, const Common::Point &endPoint, const int16 priority, const uint8 color, const LineStyle style, uint16 pattern, uint8 thickness, Common::Rect &outRect) { const uint8 skipColor = color != kDefaultSkipColor ? kDefaultSkipColor : 0; - // Line thickness is expected to be 2 * thickness + 1 + // Line thickness is expected to be 2n + 1 thickness = (MAX<uint8>(1, thickness) - 1) | 1; const uint8 halfThickness = thickness >> 1; @@ -130,8 +130,8 @@ reg_t GfxPaint32::makeLineBitmap(const Common::Point &startPoint, const Common:: outRect.left = MIN<int16>(startPoint.x, endPoint.x); outRect.top = MIN<int16>(startPoint.y, endPoint.y); - outRect.right = MAX<int16>(startPoint.x, endPoint.x) + 1 + 1; // rect lower edge + thickness offset - outRect.bottom = MAX<int16>(startPoint.y, endPoint.y) + 1 + 1; // rect lower edge + thickness offset + outRect.right = MAX<int16>(startPoint.x, endPoint.x) + 1; + outRect.bottom = MAX<int16>(startPoint.y, endPoint.y) + 1; outRect.grow(halfThickness); outRect.clip(Common::Rect(scriptWidth, scriptHeight)); diff --git a/engines/sci/graphics/transitions32.cpp b/engines/sci/graphics/transitions32.cpp index a1ae352b6c..bc2825ba77 100644 --- a/engines/sci/graphics/transitions32.cpp +++ b/engines/sci/graphics/transitions32.cpp @@ -319,16 +319,20 @@ void GfxTransitions32::kernelSetShowStyle(const uint16 argc, const reg_t planeOb if (createNewEntry) { if (getSciVersion() <= SCI_VERSION_2_1_EARLY) { switch (entry->type) { + case kShowStyleWipeLeft: + case kShowStyleWipeRight: + configure21EarlyHorizontalWipe(*entry, priority); + break; case kShowStyleIrisOut: case kShowStyleIrisIn: configure21EarlyIris(*entry, priority); - break; + break; case kShowStyleDissolve: configure21EarlyDissolve(*entry, priority, plane->_gameRect); - break; + break; default: // do nothing - break; + break; } } @@ -377,6 +381,8 @@ ShowStyleList::iterator GfxTransitions32::deleteShowStyle(const ShowStyleList::i g_sci->_gfxFrameout->deleteScreenItem(*showStyle->bitmapScreenItem); } break; + case kShowStyleWipeLeft: + case kShowStyleWipeRight: case kShowStyleIrisOut: case kShowStyleIrisIn: if (getSciVersion() <= SCI_VERSION_2_1_EARLY) { @@ -406,6 +412,33 @@ ShowStyleList::iterator GfxTransitions32::deleteShowStyle(const ShowStyleList::i return _showStyles.erase(showStyle); } +void GfxTransitions32::configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle, const int16 priority) { + showStyle.numEdges = 1; + const int divisions = showStyle.divisions; + showStyle.screenItems.reserve(divisions); + + CelInfo32 celInfo; + celInfo.type = kCelTypeColor; + celInfo.color = showStyle.color; + + for (int i = 0; i < divisions; ++i) { + Common::Rect rect; + rect.left = showStyle.width * i / divisions; + rect.top = 0; + rect.right = showStyle.width * (i + 1) / divisions; + rect.bottom = showStyle.height; + showStyle.screenItems.push_back(new ScreenItem(showStyle.plane, celInfo, rect)); + showStyle.screenItems.back()->_priority = priority; + showStyle.screenItems.back()->_fixedPriority = true; + } + + if (showStyle.fadeUp) { + for (int i = 0; i < divisions; ++i) { + g_sci->_gfxFrameout->addScreenItem(*showStyle.screenItems[i]); + } + } +} + void GfxTransitions32::configure21EarlyIris(PlaneShowStyle &showStyle, const int16 priority) { showStyle.numEdges = 4; const int numScreenItems = showStyle.numEdges * showStyle.divisions; @@ -506,13 +539,23 @@ bool GfxTransitions32::processShowStyle(PlaneShowStyle &showStyle, uint32 now) { case kShowStyleHShutterIn: case kShowStyleVShutterOut: case kShowStyleVShutterIn: - case kShowStyleWipeLeft: - case kShowStyleWipeRight: case kShowStyleWipeUp: case kShowStyleWipeDown: case kShowStyleDissolveNoMorph: case kShowStyleMorph: return processMorph(showStyle); + case kShowStyleWipeLeft: + if (getSciVersion() > SCI_VERSION_2_1_EARLY) { + return processMorph(showStyle); + } else { + return processWipe(-1, showStyle); + } + case kShowStyleWipeRight: + if (getSciVersion() > SCI_VERSION_2_1_EARLY) { + return processMorph(showStyle); + } else { + return processWipe(1, showStyle); + } case kShowStyleDissolve: if (getSciVersion() > SCI_VERSION_2_1_EARLY) { return processMorph(showStyle); @@ -608,11 +651,15 @@ void GfxTransitions32::processVShutterIn(PlaneShowStyle &showStyle) { } void GfxTransitions32::processWipeLeft(PlaneShowStyle &showStyle) { - error("WipeLeft 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("WipeLeft is not known to be used by any SCI2.1mid+ game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!"); + } } void GfxTransitions32::processWipeRight(PlaneShowStyle &showStyle) { - error("WipeRight 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("WipeRight is not known to be used by any SCI2.1mid+ game. Please submit a bug report with details about the game you were playing and what you were doing that triggered this error. Thanks!"); + } } void GfxTransitions32::processWipeUp(PlaneShowStyle &showStyle) { diff --git a/engines/sci/graphics/transitions32.h b/engines/sci/graphics/transitions32.h index 0c828a20f7..685012fada 100644 --- a/engines/sci/graphics/transitions32.h +++ b/engines/sci/graphics/transitions32.h @@ -331,6 +331,12 @@ private: ShowStyleList::iterator deleteShowStyle(const ShowStyleList::iterator &showStyle); /** + * Initializes the given PlaneShowStyle for a + * horizontal wipe effect for SCI2 to 2.1early. + */ + void configure21EarlyHorizontalWipe(PlaneShowStyle &showStyle, const int16 priority); + + /** * Initializes the given PlaneShowStyle for an * iris effect for SCI2 to 2.1early. */ |