[Scummvm-git-logs] scummvm master -> 1c04c2162a7d02ff37c37f2427f920867dcf3342
mgerhardy
martin.gerhardy at gmail.com
Fri Oct 30 16:29:12 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1c04c2162a TWINE: fixed assert when some sprite are rendered only partially
Commit: 1c04c2162a7d02ff37c37f2427f920867dcf3342
https://github.com/scummvm/scummvm/commit/1c04c2162a7d02ff37c37f2427f920867dcf3342
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2020-10-30T17:28:54+01:00
Commit Message:
TWINE: fixed assert when some sprite are rendered only partially
Changed paths:
engines/twine/twine.cpp
diff --git a/engines/twine/twine.cpp b/engines/twine/twine.cpp
index 0db9fae39b..095cb5a2d9 100644
--- a/engines/twine/twine.cpp
+++ b/engines/twine/twine.cpp
@@ -882,14 +882,14 @@ void TwinEEngine::copyBlockPhys(int32 left, int32 top, int32 right, int32 bottom
assert(top <= bottom);
int32 width = right - left + 1;
int32 height = bottom - top + 1;
- if (width <= 0 || height <= 0) {
- return;
+ if (left + width > SCREEN_WIDTH) {
+ width = SCREEN_WIDTH - left;
}
- if (width > SCREEN_WIDTH) {
- width = SCREEN_WIDTH;
+ if (top + height > SCREEN_HEIGHT) {
+ height = SCREEN_HEIGHT - top;
}
- if (height > SCREEN_HEIGHT) {
- height = SCREEN_HEIGHT;
+ if (width <= 0 || height <= 0) {
+ return;
}
g_system->copyRectToScreen(frontVideoBuffer.getBasePtr(left, top), frontVideoBuffer.pitch, left, top, width, height);
g_system->updateScreen();
More information about the Scummvm-git-logs
mailing list