From cb500d147efa0c890d30f6be7aff286d5909b315 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Wed, 21 Sep 2011 21:09:58 -0400 Subject: PEGASUS: Clamp the dirty rect to the screen size --- engines/pegasus/graphics.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines') 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(640, _dirtyRect.right); + _dirtyRect.bottom = MIN(480, _dirtyRect.bottom); } void GraphicsManager::addDisplayElement(DisplayElement *newElement) { -- cgit v1.2.3