aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/plane32.h
diff options
context:
space:
mode:
authorColin Snover2016-05-25 13:59:09 -0500
committerColin Snover2016-05-25 19:16:11 -0500
commit719160d4948ccd22d283d5b458cb15622db473f7 (patch)
treec9e13a604a7c1da9f3de9c4a9e6153f8881a6364 /engines/sci/graphics/plane32.h
parentc4e8ffc821af321bedecd58d8f25dbe96e5b31ad (diff)
downloadscummvm-rg350-719160d4948ccd22d283d5b458cb15622db473f7.tar.gz
scummvm-rg350-719160d4948ccd22d283d5b458cb15622db473f7.tar.bz2
scummvm-rg350-719160d4948ccd22d283d5b458cb15622db473f7.zip
SCI32: Fix assertion failures in LSL6 hires caused by bad rects
LSL6 hires sends rectangles to kernel calls that have negative dimensions. SSCI did not care about this and would simply accept these invalid rects, so we do the same, at least for now.
Diffstat (limited to 'engines/sci/graphics/plane32.h')
-rw-r--r--engines/sci/graphics/plane32.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h
index 770a6fa445..53749f86f4 100644
--- a/engines/sci/graphics/plane32.h
+++ b/engines/sci/graphics/plane32.h
@@ -275,7 +275,11 @@ public:
* given screen rect.
*/
inline void clipScreenRect(const Common::Rect &screenRect) {
- if (_screenRect.intersects(screenRect)) {
+ // LSL6 hires creates planes 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.isValidRect() && _screenRect.intersects(screenRect)) {
_screenRect.clip(screenRect);
} else {
_screenRect.left = 0;