mirror of
https://github.com/mkxp-z/mkxp-z.git
synced 2025-08-04 14:05:32 +02:00
Don't clamp Bitmap::blit
Bitmap::stretchBlt handles that now
This commit is contained in:
parent
2247f1d9b7
commit
43ac2b35a1
2 changed files with 2 additions and 14 deletions
|
@ -927,24 +927,12 @@ IntRect Bitmap::rect() const
|
||||||
}
|
}
|
||||||
|
|
||||||
void Bitmap::blt(int x, int y,
|
void Bitmap::blt(int x, int y,
|
||||||
const Bitmap &source, IntRect rect,
|
const Bitmap &source, const IntRect &rect,
|
||||||
int opacity)
|
int opacity)
|
||||||
{
|
{
|
||||||
if (source.isDisposed())
|
if (source.isDisposed())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// FIXME: RGSS allows the source rect to both lie outside
|
|
||||||
// the bitmap rect and be inverted in both directions;
|
|
||||||
// clamping only covers a subset of these cases (and
|
|
||||||
// doesn't fix anything for a direct stretch_blt call).
|
|
||||||
|
|
||||||
/* Clamp rect to source bitmap size */
|
|
||||||
if (rect.x + rect.w > source.width())
|
|
||||||
rect.w = source.width() - rect.x;
|
|
||||||
|
|
||||||
if (rect.y + rect.h > source.height())
|
|
||||||
rect.h = source.height() - rect.y;
|
|
||||||
|
|
||||||
stretchBlt(IntRect(x, y, rect.w, rect.h),
|
stretchBlt(IntRect(x, y, rect.w, rect.h),
|
||||||
source, rect, opacity);
|
source, rect, opacity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
IntRect rect() const;
|
IntRect rect() const;
|
||||||
|
|
||||||
void blt(int x, int y,
|
void blt(int x, int y,
|
||||||
const Bitmap &source, IntRect rect,
|
const Bitmap &source, const IntRect &rect,
|
||||||
int opacity = 255);
|
int opacity = 255);
|
||||||
|
|
||||||
void stretchBlt(IntRect destRect,
|
void stretchBlt(IntRect destRect,
|
||||||
|
|
Loading…
Add table
Reference in a new issue