From fe552696533e47b79d1299c831dfda98de884b01 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 1 Jan 2012 20:14:37 +1100 Subject: [PATCH] TSAGE: Bugfix for trying to draw off screen objects, which was causing invalid dirty rects --- engines/tsage/graphics.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index af3a2f9199d..4db898662f2 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -595,7 +595,8 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi if (destBounds.bottom > destSurface.h) destBounds.bottom = destSurface.h; - if (destBounds.isValidRect()) { + if (destBounds.isValidRect() && !((destBounds.right < 0) || (destBounds.bottom < 0) + || (destBounds.left >= SCREEN_WIDTH) || (destBounds.top >= SCREEN_HEIGHT))) { // Register the affected area as dirty addDirtyRect(destBounds);