TSAGE: Bugfix for trying to draw off screen objects, which was causing invalid dirty rects

This commit is contained in:
Paul Gilbert 2012-01-01 20:14:37 +11:00
parent be706b1846
commit fe55269653

View File

@ -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);