From dd13fdfe1740ac847f7dfb4a332d3f5948b1a782 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Thu, 12 Jan 2017 12:41:27 -0600 Subject: 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. --- engines/sci/graphics/frameout.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/sci/graphics/frameout.cpp') diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 749403093f..464b28a2ba 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; } -- cgit v1.2.3