mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-13 23:43:34 +00:00
TWINE: fixed assert when some sprite are rendered only partially
This commit is contained in:
parent
a9aa2dba5d
commit
1c04c2162a
@ -882,15 +882,15 @@ 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 (left + width > SCREEN_WIDTH) {
|
||||
width = SCREEN_WIDTH - left;
|
||||
}
|
||||
if (top + height > SCREEN_HEIGHT) {
|
||||
height = SCREEN_HEIGHT - top;
|
||||
}
|
||||
if (width <= 0 || height <= 0) {
|
||||
return;
|
||||
}
|
||||
if (width > SCREEN_WIDTH) {
|
||||
width = SCREEN_WIDTH;
|
||||
}
|
||||
if (height > SCREEN_HEIGHT) {
|
||||
height = SCREEN_HEIGHT;
|
||||
}
|
||||
g_system->copyRectToScreen(frontVideoBuffer.getBasePtr(left, top), frontVideoBuffer.pitch, left, top, width, height);
|
||||
g_system->updateScreen();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user