[Scummvm-git-logs] scummvm master -> ba50f88a3c60e5ad90aa830739a271ee2ba844f0
csnover
csnover at users.noreply.github.com
Thu Jan 12 20:17:16 CET 2017
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
54e94c572a SCI32: Add workarounds, transitions, fixes for PQ4CD
dd13fdfe17 SCI32: "Fix" renderer for PQ4CD
92f185c83c SCI32: Add Hoyle5 to the list of game versions
ba50f88a3c SCI32: Fix crash trying to clip invalid rects generated by transitions
Commit: 54e94c572aeb58e160537e2145c0fff44e862be3
https://github.com/scummvm/scummvm/commit/54e94c572aeb58e160537e2145c0fff44e862be3
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-12T13:14:03-06:00
Commit Message:
SCI32: Add workarounds, transitions, fixes for PQ4CD
Changed paths:
engines/sci/engine/kernel_tables.h
engines/sci/engine/workarounds.cpp
engines/sci/engine/workarounds.h
engines/sci/graphics/paint32.cpp
engines/sci/graphics/transitions32.cpp
engines/sci/graphics/transitions32.h
diff --git a/engines/sci/engine/kernel_tables.h b/engines/sci/engine/kernel_tables.h
index c611af4..ac4987e 100644
--- a/engines/sci/engine/kernel_tables.h
+++ b/engines/sci/engine/kernel_tables.h
@@ -287,7 +287,7 @@ static const SciKernelMapSubEntry kPalVary_subops[] = {
{ SIG_SCI32, 6, MAP_CALL(PalVaryPauseResume), "i", NULL },
{ SIG_SCI32, 7, MAP_CALL(PalVarySetTarget), "i", NULL },
{ SIG_SCI32, 8, MAP_CALL(PalVarySetStart), "i", NULL },
- { SIG_SCI32, 9, MAP_CALL(PalVaryMergeStart), "i", NULL },
+ { SIG_SCI32, 9, MAP_CALL(PalVaryMergeStart), "i", kPalVaryMergeStart_workarounds },
#endif
SCI_SUBOPENTRY_TERMINATOR
};
@@ -512,7 +512,7 @@ static const SciKernelMapSubEntry kArray_subops[] = {
{ SIG_SCI32, 2, MAP_CALL(ArrayGetElement), "ri", NULL },
{ SIG_SCI32, 3, MAP_CALL(ArraySetElements), "ri(.*)", kArraySetElements_workarounds },
{ SIG_SCI32, 4, MAP_CALL(ArrayFree), "[0r]", NULL },
- { SIG_SCI32, 5, MAP_CALL(ArrayFill), "riii", NULL },
+ { SIG_SCI32, 5, MAP_CALL(ArrayFill), "riii", kArrayFill_workarounds },
{ SIG_SCI32, 6, MAP_CALL(ArrayCopy), "ririi", NULL },
// there is no subop 7
{ SIG_SCI32, 8, MAP_CALL(ArrayDuplicate), "r", NULL },
@@ -531,7 +531,7 @@ static const SciKernelMapSubEntry kString_subops[] = {
{ SIG_THRU_SCI21MID, 2, MAP_CALL(StringGetChar), "ri", NULL },
{ SIG_THRU_SCI21MID, 3, MAP_CALL(ArraySetElements), "ri(i*)", kArraySetElements_workarounds },
{ SIG_THRU_SCI21MID, 4, MAP_CALL(StringFree), "[0r]", NULL },
- { SIG_THRU_SCI21MID, 5, MAP_CALL(ArrayFill), "rii", NULL },
+ { SIG_THRU_SCI21MID, 5, MAP_CALL(ArrayFill), "rii", kArrayFill_workarounds },
{ SIG_THRU_SCI21MID, 6, MAP_CALL(ArrayCopy), "ririi", NULL },
{ SIG_SCI32, 7, MAP_CALL(StringCompare), "rr(i)", NULL },
@@ -860,7 +860,7 @@ static SciKernelMapEntry s_kernelMap[] = {
{ MAP_CALL(DeletePlane), SIG_EVERYWHERE, "o", NULL, NULL },
{ MAP_CALL(DeleteScreenItem), SIG_EVERYWHERE, "o", NULL, NULL },
{ "DisposeTextBitmap", kBitmapDestroy, SIG_SCI2, SIGFOR_ALL, "[r!]", NULL, NULL },
- { MAP_CALL(FrameOut), SIG_EVERYWHERE, "(i)", NULL, NULL },
+ { MAP_CALL(FrameOut), SIG_EVERYWHERE, "(i)", NULL, kFrameOut_workarounds },
{ MAP_CALL(GetHighPlanePri), SIG_EVERYWHERE, "", NULL, NULL },
{ MAP_CALL(InPolygon), SIG_EVERYWHERE, "iio", NULL, NULL },
{ MAP_CALL(IsHiRes), SIG_EVERYWHERE, "", NULL, NULL },
diff --git a/engines/sci/engine/workarounds.cpp b/engines/sci/engine/workarounds.cpp
index 1201b9f..560a383 100644
--- a/engines/sci/engine/workarounds.cpp
+++ b/engines/sci/engine/workarounds.cpp
@@ -352,6 +352,8 @@ const SciWorkaroundEntry uninitializedReadWorkarounds[] = {
{ GID_PEPPER, -1, 894, 0, "Package", "doVerb", NULL, 3, { WORKAROUND_FAKE, 0 } }, // using the hand on the book in the inventory - bug #5154
{ GID_PEPPER, 150, 928, 0, "Narrator", "startText", NULL, 0, { WORKAROUND_FAKE, 0 } }, // happens during the non-interactive demo of Pepper
{ GID_PQ4, -1, 25, 0, "iconToggle", "select", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when toggling the icon bar to auto-hide or not
+ { GID_PQ4, 275, 64964, -1, "DPath", "init", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when Sherry walks out of the morgue on day 3
+ { GID_PQ4, 240, 64964, -1, "DPath", "init", NULL, 1, { WORKAROUND_FAKE, 0 } }, // when encountering Sherry and the reporter outside the morgue at the end of day 3
{ GID_PQSWAT, -1, 64950, 0, NULL, "handleEvent", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Using any menus in-game
{ GID_PQSWAT, -1, 73, 0, "theLashInterface", "transmit", NULL, 0, { WORKAROUND_FAKE, 0 } }, // Clicking the transmit button in LASH
{ GID_PQSWAT, 2990, 2990, 0, "talkToSchienbly", "changeState", NULL, 1, { WORKAROUND_FAKE, 0 } }, // When the video of Schienbly talking for the first time ends
@@ -428,6 +430,12 @@ const SciWorkaroundEntry kArraySetElements_workarounds[] = {
};
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kArrayFill_workarounds[] = {
+ { GID_PQ4, 540, 64918, 0, "Str", "callKernel", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when clicking on Hate Crimes in the computer on day 2
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kCelHigh_workarounds[] = {
{ GID_KQ5, -1, 255, 0, "deathIcon", "setSize", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // english floppy: when getting beaten up in the inn and probably more, called with 2nd parameter as object - bug #5049
{ GID_PQ2, -1, 255, 0, "DIcon", "setSize", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when showing picture within windows, called with 2nd/3rd parameters as objects
@@ -593,6 +601,17 @@ const SciWorkaroundEntry kFindKey_workarounds[] = {
SCI_WORKAROUNDENTRY_TERMINATOR
};
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kFrameOut_workarounds[] = {
+ { GID_PQ4, 360, 360, 0, "copCarInset", "init", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When clicking hand on the impounded police car on day 3
+ { GID_PQ4, 360, 360, 0, "copCarInset", "dispose", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the impounded police car on day 3
+ { GID_PQ4, 275, 275, 0, "checkSherry", "changeState", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When encountering Sherry and Sam in the morgue on day 3
+ { GID_PQ4, 725, 725, 0, "fridgeInset", "init", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When opening the refrigerator at the end of day 4
+ { GID_PQ4, 725, 725, 0, "fridgeInset", "dispose", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the refrigerator at the end of day 4
+ { GID_PQ4, 735, 735, 0, "medInset", "dispose", NULL, 0, { WORKAROUND_STILLCALL, 1 } }, // When exiting the medicine cabinet at the end of day 4
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kGraphDrawLine_workarounds[] = {
{ GID_ISLANDBRAIN, 300, 300, 0, "dudeViewer", "show", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // when looking at the gene explanation chart, gets called with 1 extra parameter
@@ -725,6 +744,12 @@ const SciWorkaroundEntry kPalVarySetPercent_workarounds[] = {
};
// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
+const SciWorkaroundEntry kPalVaryMergeStart_workarounds[] = {
+ { GID_PQ4, 170, 170, 0, "getHit", "changeState", NULL, 0, { WORKAROUND_STILLCALL, 0 } }, // Three extra parameters passed during the gunfight at the end of day 1
+ SCI_WORKAROUNDENTRY_TERMINATOR
+};
+
+// gameID, room,script,lvl, object-name, method-name, local-call-signature, index, workaround
const SciWorkaroundEntry kPlatform32_workarounds[] = {
{ GID_HOYLE5, -1, 0, 0, "hoyle4", "newRoom", NULL, 0, { WORKAROUND_FAKE, 1 } }, // at the start of the game, incorrectly uses SCI16 calling convention for kPlatform
SCI_WORKAROUNDENTRY_TERMINATOR
diff --git a/engines/sci/engine/workarounds.h b/engines/sci/engine/workarounds.h
index 86b4ee2..cb928fa 100644
--- a/engines/sci/engine/workarounds.h
+++ b/engines/sci/engine/workarounds.h
@@ -72,6 +72,7 @@ extern const SciWorkaroundEntry kDoSoundPlay_workarounds[];
extern const SciWorkaroundEntry kDoSoundFade_workarounds[];
extern const SciWorkaroundEntry kFileIOOpen_workarounds[];
extern const SciWorkaroundEntry kFindKey_workarounds[];
+extern const SciWorkaroundEntry kFrameOut_workarounds[];
extern const SciWorkaroundEntry kDeleteKey_workarounds[];
extern const SciWorkaroundEntry kGetAngle_workarounds[];
extern const SciWorkaroundEntry kGraphDrawLine_workarounds[];
@@ -87,6 +88,7 @@ extern const SciWorkaroundEntry kMemory_workarounds[];
extern const SciWorkaroundEntry kMoveCursor_workarounds[];
extern const SciWorkaroundEntry kNewWindow_workarounds[];
extern const SciWorkaroundEntry kPalVarySetPercent_workarounds[];
+extern const SciWorkaroundEntry kPalVaryMergeStart_workarounds[];
extern const SciWorkaroundEntry kPlatform32_workarounds[];
extern const SciWorkaroundEntry kRandom_workarounds[];
extern const SciWorkaroundEntry kReadNumber_workarounds[];
@@ -94,6 +96,7 @@ extern const SciWorkaroundEntry kResCheck_workarounds[];
extern const SciWorkaroundEntry kPaletteUnsetFlag_workarounds[];
extern const SciWorkaroundEntry kSetCursor_workarounds[];
extern const SciWorkaroundEntry kArraySetElements_workarounds[];
+extern const SciWorkaroundEntry kArrayFill_workarounds[];
extern const SciWorkaroundEntry kSetPort_workarounds[];
extern const SciWorkaroundEntry kStrAt_workarounds[];
extern const SciWorkaroundEntry kStrCpy_workarounds[];
diff --git a/engines/sci/graphics/paint32.cpp b/engines/sci/graphics/paint32.cpp
index bf7c736..8a63365 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 a1ae352..bc2825b 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 0c828a2..685012f 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.
*/
Commit: dd13fdfe1740ac847f7dfb4a332d3f5948b1a782
https://github.com/scummvm/scummvm/commit/dd13fdfe1740ac847f7dfb4a332d3f5948b1a782
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-12T13:14:10-06:00
Commit Message:
SCI32: "Fix" renderer for PQ4CD
PQ4CD and several other games contain a hack in two renderer
methods to avoid rendering invalid screen items with zero or
negative-dimension target rects. This prevents PQ4CD from
crashing during the fifth phase of target practice.
Changed paths:
engines/sci/engine/features.h
engines/sci/graphics/celobj32.cpp
engines/sci/graphics/frameout.cpp
diff --git a/engines/sci/engine/features.h b/engines/sci/engine/features.h
index ee978be..8f84bba 100644
--- a/engines/sci/engine/features.h
+++ b/engines/sci/engine/features.h
@@ -132,6 +132,19 @@ public:
inline bool usesAlternateSelectors() const {
return g_sci->getGameId() == GID_PHANTASMAGORIA2;
}
+
+ inline bool hasEmptyScaleDrawHack() const {
+ // Yes: KQ7 (all), PQ4CD, QFG4CD, SQ6, Phant1
+ // No: All SCI2, all SCI3, GK2, LSL6hires, PQ:SWAT, Torin
+ // Unknown: Hoyle5, MGDX, Shivers
+ const SciGameId &gid = g_sci->getGameId();
+ return getSciVersion() > SCI_VERSION_2 &&
+ getSciVersion() < SCI_VERSION_2_1_LATE &&
+ gid != GID_LSL6HIRES &&
+ gid != GID_GK2 &&
+ gid != GID_PQSWAT &&
+ gid != GID_TORIN;
+ }
#endif
/**
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index fe0fbf7..8540b63 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -176,6 +176,10 @@ struct SCALER_Scale {
// so just always make the reader decompress an entire
// line of source data when scaling
_reader(celObj, celObj._width) {
+#ifndef NDEBUG
+ assert(_minX <= _maxX);
+#endif
+
// In order for scaling ratios to apply equally across objects that
// start at different positions on the screen (like the cels of a
// picture), the pixels that are read from the source bitmap must all
@@ -773,6 +777,14 @@ void CelObj::drawUncompHzFlipNoMDNoSkip(Buffer &target, const Common::Rect &targ
}
void CelObj::scaleDrawNoMD(Buffer &target, const Ratio &scaleX, const Ratio &scaleY, const Common::Rect &targetRect, const Common::Point &scaledPosition) const {
+ // In SSCI the checks are > because their rects are BR-inclusive;
+ // our checks are >= because our rects are BR-exclusive
+ if (g_sci->_features->hasEmptyScaleDrawHack() &&
+ (targetRect.left >= targetRect.right ||
+ targetRect.top >= targetRect.bottom)) {
+ return;
+ }
+
if (_drawMirrored)
render<MAPPER_NoMD, SCALER_Scale<true, READER_Compressed> >(target, targetRect, scaledPosition, scaleX, scaleY);
else
@@ -780,6 +792,14 @@ void CelObj::scaleDrawNoMD(Buffer &target, const Ratio &scaleX, const Ratio &sca
}
void CelObj::scaleDrawUncompNoMD(Buffer &target, const Ratio &scaleX, const Ratio &scaleY, const Common::Rect &targetRect, const Common::Point &scaledPosition) const {
+ // In SSCI the checks are > because their rects are BR-inclusive;
+ // our checks are >= because our rects are BR-exclusive
+ if (g_sci->_features->hasEmptyScaleDrawHack() &&
+ (targetRect.left >= targetRect.right ||
+ targetRect.top >= targetRect.bottom)) {
+ return;
+ }
+
if (_drawMirrored) {
render<MAPPER_NoMD, SCALER_Scale<true, READER_Uncompressed> >(target, targetRect, scaledPosition, scaleX, scaleY);
} else {
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index 7494030..464b28a 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -1168,10 +1168,13 @@ void GfxFrameout::showBits() {
byte *sourceBuffer = (byte *)_currentBuffer.getPixels() + rounded.top * _currentBuffer.screenWidth + rounded.left;
- // TODO: Sometimes transition screen items generate zero-dimension
- // show rectangles. Is this a bug?
+ // Sometimes screen items (especially from SCI2.1early transitions, like
+ // in the asteroids minigame in PQ4) generate zero-dimension show
+ // rectangles. In SSCI, zero-dimension rectangles are OK (they just
+ // result in no copy), but OSystem::copyRectToScreen will assert on
+ // them, so we need to check for zero-dimensions rectangles and ignore
+ // them explicitly
if (rounded.width() == 0 || rounded.height() == 0) {
- warning("Zero-dimension show rectangle ignored");
continue;
}
Commit: 92f185c83c71c789b1a0c0fb734f85635aa7d8c6
https://github.com/scummvm/scummvm/commit/92f185c83c71c789b1a0c0fb734f85635aa7d8c6
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-12T13:14:25-06:00
Commit Message:
SCI32: Add Hoyle5 to the list of game versions
Changed paths:
engines/sci/sci.h
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index a36ae00..b3ec325 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -226,7 +226,7 @@ enum SciVersion {
SCI_VERSION_1_1, // Dr. Brain 2, EcoQuest 1 CD, EcoQuest 2, KQ6, QFG3, SQ4CD, XMAS 1992 and many more
SCI_VERSION_2, // GK1, PQ4 floppy, QFG4 floppy
SCI_VERSION_2_1_EARLY, // GK2 demo, KQ7 1.4/1.51, LSL6 hires, PQ4CD, QFG4CD
- SCI_VERSION_2_1_MIDDLE, // GK2, KQ7 2.00b, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, Shivers 1, SQ6, Torin
+ SCI_VERSION_2_1_MIDDLE, // GK2, Hoyle 5, KQ7 2.00b, MUMG Deluxe, Phantasmagoria 1, PQ:SWAT, Shivers 1, SQ6, Torin
SCI_VERSION_2_1_LATE, // demos of LSL7, Lighthouse, RAMA
SCI_VERSION_3 // LSL7, Lighthouse, RAMA, Phantasmagoria 2
};
Commit: ba50f88a3c60e5ad90aa830739a271ee2ba844f0
https://github.com/scummvm/scummvm/commit/ba50f88a3c60e5ad90aa830739a271ee2ba844f0
Author: Colin Snover (github.com at zetafleet.com)
Date: 2017-01-12T13:16:53-06:00
Commit Message:
SCI32: Fix crash trying to clip invalid rects generated by transitions
In PQ4CD, when leaving the shooting range through the front door,
some transition screen items will be generated that have invalid
dimensions. SSCI simply clips these rectangles to zero.
Changed paths:
engines/sci/graphics/screen_item32.cpp
diff --git a/engines/sci/graphics/screen_item32.cpp b/engines/sci/graphics/screen_item32.cpp
index f7239c3..4757770 100644
--- a/engines/sci/graphics/screen_item32.cpp
+++ b/engines/sci/graphics/screen_item32.cpp
@@ -455,7 +455,11 @@ void ScreenItem::calcRects(const Plane &plane) {
_screenRect = _screenItemRect;
- if (_screenRect.intersects(plane._screenRect)) {
+ // PQ4CD creates screen items with invalid rects; SSCI does not care
+ // about this, but `Common::Rect::clip` does, so we need to check
+ // whether or not the rect is actually valid before clipping and only
+ // clip valid rects
+ if (_screenRect.intersects(plane._screenRect) && _screenRect.isValidRect()) {
_screenRect.clip(plane._screenRect);
} else {
_screenRect.right = 0;
More information about the Scummvm-git-logs
mailing list