HOPKINS: Fix to not display dirty rects that are off-screen

This commit is contained in:
Paul Gilbert 2013-03-02 21:47:03 -05:00
parent 9d8eb97840
commit 77eb6f74eb

View File

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