mirror of
https://github.com/libretro/scummvm.git
synced 2025-03-02 08:19:19 +00:00
Handle empty clip rectangles in GfxView::drawScaled(). Fixes an assert in the first room of the game
svn-id: r50503
This commit is contained in:
parent
42351265f1
commit
3a2ac994d4
@ -660,8 +660,12 @@ void GfxView::drawScaled(const Common::Rect &rect, const Common::Rect &clipRect,
|
||||
scaledWidth = MIN(clipRect.width(), scaledWidth);
|
||||
scaledHeight = MIN(clipRect.height(), scaledHeight);
|
||||
|
||||
const uint16 offsetY = clipRect.top - rect.top;
|
||||
const uint16 offsetX = clipRect.left - rect.left;
|
||||
const int16 offsetY = clipRect.top - rect.top;
|
||||
const int16 offsetX = clipRect.left - rect.left;
|
||||
|
||||
// Happens in SQ6, first room
|
||||
if (offsetX < 0 || offsetY < 0)
|
||||
return;
|
||||
|
||||
assert(scaledHeight + offsetY <= ARRAYSIZE(scalingY));
|
||||
assert(scaledWidth + offsetX <= ARRAYSIZE(scalingX));
|
||||
|
Loading…
x
Reference in New Issue
Block a user