From 77eb6f74eb17deda5e629457ca4ec144782fddfe Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 2 Mar 2013 21:47:03 -0500 Subject: HOPKINS: Fix to not display dirty rects that are off-screen --- engines/hopkins/graphics.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'engines/hopkins/graphics.cpp') diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index c7b6904335..0c06ef7f48 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1171,9 +1171,12 @@ void GraphicsManager::displayDirtyRects() { unlockScreen(); } - byte *srcP = _videoPtr + WinScan * dstRect.top + (dstRect.left * 2); - g_system->copyRectToScreen(srcP, WinScan, dstRect.left, dstRect.top, - dstRect.width(), dstRect.height()); + // If it's a valid rect, then copy it over + if (dstRect.isValidRect() && dstRect.width() > 0 && dstRect.height() > 0) { + byte *srcP = _videoPtr + WinScan * dstRect.top + (dstRect.left * 2); + g_system->copyRectToScreen(srcP, WinScan, dstRect.left, dstRect.top, + dstRect.width(), dstRect.height()); + } } unlockScreen(); -- cgit v1.2.3