aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2011-09-21 21:09:58 -0400
committerMatthew Hoops2011-09-21 21:09:58 -0400
commitcb500d147efa0c890d30f6be7aff286d5909b315 (patch)
tree73dcb99a87295c53710aed6546b4a745e6e5d090 /engines
parent97072b5d4b6f789ee7bc8b7eb570fd93e0d14e82 (diff)
downloadscummvm-rg350-cb500d147efa0c890d30f6be7aff286d5909b315.tar.gz
scummvm-rg350-cb500d147efa0c890d30f6be7aff286d5909b315.tar.bz2
scummvm-rg350-cb500d147efa0c890d30f6be7aff286d5909b315.zip
PEGASUS: Clamp the dirty rect to the screen size
Diffstat (limited to 'engines')
-rw-r--r--engines/pegasus/graphics.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/pegasus/graphics.cpp b/engines/pegasus/graphics.cpp
index 9431293aa1..2891f216d5 100644
--- a/engines/pegasus/graphics.cpp
+++ b/engines/pegasus/graphics.cpp
@@ -197,6 +197,10 @@ void GraphicsManager::invalRect(const Common::Rect &rect) {
// Expand our dirty rect to include rect
_dirtyRect.extend(rect);
}
+
+ // Sanity check: clip our rect to the screen
+ _dirtyRect.right = MIN<int>(640, _dirtyRect.right);
+ _dirtyRect.bottom = MIN<int>(480, _dirtyRect.bottom);
}
void GraphicsManager::addDisplayElement(DisplayElement *newElement) {