diff options
author | Paul Gilbert | 2015-03-25 08:16:59 -0400 |
---|---|---|
committer | Paul Gilbert | 2015-03-25 08:16:59 -0400 |
commit | fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899 (patch) | |
tree | d8c35479d3cd0421be57172b8e3edc8b2667bcd1 /engines/sherlock/screen.cpp | |
parent | 03a969bd0f696f9a7fa0dc56c47c2b05d28a5a47 (diff) | |
download | scummvm-rg350-fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899.tar.gz scummvm-rg350-fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899.tar.bz2 scummvm-rg350-fc7f8024beb4e3a0ee2b6def649ca1a3e91fa899.zip |
SHERLOCK: Fixes to scene loading
Diffstat (limited to 'engines/sherlock/screen.cpp')
-rw-r--r-- | engines/sherlock/screen.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/engines/sherlock/screen.cpp b/engines/sherlock/screen.cpp index e0eab428a8..7c222f3e24 100644 --- a/engines/sherlock/screen.cpp +++ b/engines/sherlock/screen.cpp @@ -246,11 +246,13 @@ void Screen::verticalTransition() { * Copies a section of the second back buffer into the main back buffer */ void Screen::restoreBackground(const Common::Rect &r) { - Common::Rect tempRect = r; - tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT)); + if (r.width() > 0 && r.height() > 0) { + Common::Rect tempRect = r; + tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCENE_HEIGHT)); - if (tempRect.isValidRect()) - _backBuffer.blitFrom(_backBuffer2, Common::Point(tempRect.left, tempRect.top), tempRect); + if (tempRect.isValidRect()) + _backBuffer.blitFrom(_backBuffer2, Common::Point(tempRect.left, tempRect.top), tempRect); + } } /** @@ -264,11 +266,13 @@ void Screen::slamArea(int16 xp, int16 yp, int16 w, int16 h) { * Copies a given area to the screen */ void Screen::slamRect(const Common::Rect &r) { - Common::Rect tempRect = r; - tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT)); + if (r.width() && r.height() > 0) { + Common::Rect tempRect = r; + tempRect.clip(Common::Rect(0, 0, SHERLOCK_SCREEN_WIDTH, SHERLOCK_SCREEN_HEIGHT)); - if (tempRect.isValidRect()) - blitFrom(_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect); + if (tempRect.isValidRect()) + blitFrom(_backBuffer, Common::Point(tempRect.left, tempRect.top), tempRect); + } } /** |