diff options
author | Colin Snover | 2016-07-26 19:56:12 -0500 |
---|---|---|
committer | Colin Snover | 2016-08-01 10:37:14 -0500 |
commit | 4e31c9aaf4aa36b6fea039d1779317e6a943e68b (patch) | |
tree | 320e073a08533838bf61dd51620f79b5da9fccf0 | |
parent | 0f535e79f59c24545f40d52cf0cf25a3818cfffd (diff) | |
download | scummvm-rg350-4e31c9aaf4aa36b6fea039d1779317e6a943e68b.tar.gz scummvm-rg350-4e31c9aaf4aa36b6fea039d1779317e6a943e68b.tar.bz2 scummvm-rg350-4e31c9aaf4aa36b6fea039d1779317e6a943e68b.zip |
SCI32: Don't crash on zero-dimension show rects
In the original engine this would have simply resulted in no draw,
but ScummVM is more strict about it. It is not 100% clear whether
these are normal and should be allowed or not, so for the moment
we'll emit a warning whenever a zero-dimension show rect is seen.
For now they only seem to be generated by plane transitions, and
these zero-dimension screen items cannot simply be omitted because
the 2.1early transitions code requires a fixed number of screen
items per step.
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index 7ea159f45d..1decfa03a9 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -1143,6 +1143,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? + if (rounded.width() == 0 || rounded.height() == 0) { + warning("Zero-dimension show rectangle ignored"); + continue; + } + g_system->copyRectToScreen(sourceBuffer, _currentBuffer.screenWidth, rounded.left, rounded.top, rounded.width(), rounded.height()); } |