aboutsummaryrefslogtreecommitdiff
path: root/engines/tsage/graphics.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/tsage/graphics.cpp')
-rw-r--r--engines/tsage/graphics.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp
index af6e6f9b13..dc73408b0e 100644
--- a/engines/tsage/graphics.cpp
+++ b/engines/tsage/graphics.cpp
@@ -294,8 +294,11 @@ void GfxSurface::addDirtyRect(const Rect &r) {
r2.translate(_bounds.left, _bounds.top);
// Add to the dirty rect list
- _dirtyRects.push_back(Rect(r2.left, r2.top,
- MIN(r2.right + 1, SCREEN_WIDTH), MIN(r2.bottom + 1, SCREEN_HEIGHT)));
+ r2.right = MIN(r2.right + 1, SCREEN_WIDTH);
+ r2.bottom = MIN(r2.bottom + 1, SCREEN_HEIGHT);
+
+ if (r2.isValidRect())
+ _dirtyRects.push_back(r2);
}
}