aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins/graphics.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2013-03-02 21:47:03 -0500
committerPaul Gilbert2013-03-02 21:47:03 -0500
commit77eb6f74eb17deda5e629457ca4ec144782fddfe (patch)
tree88f60a030789c1450bb026eca81c8b09302bfcfe /engines/hopkins/graphics.cpp
parent9d8eb97840072ee2c55dabdaf07c05b4db086eea (diff)
downloadscummvm-rg350-77eb6f74eb17deda5e629457ca4ec144782fddfe.tar.gz
scummvm-rg350-77eb6f74eb17deda5e629457ca4ec144782fddfe.tar.bz2
scummvm-rg350-77eb6f74eb17deda5e629457ca4ec144782fddfe.zip
HOPKINS: Fix to not display dirty rects that are off-screen
Diffstat (limited to 'engines/hopkins/graphics.cpp')
-rw-r--r--engines/hopkins/graphics.cpp9
1 files changed, 6 insertions, 3 deletions
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();