From 43ac2b35a153335cb757c950bcd8d75bf99bd054 Mon Sep 17 00:00:00 2001 From: Wayward Heart <91356680+WaywardHeart@users.noreply.github.com> Date: Wed, 18 Oct 2023 21:00:18 -0500 Subject: [PATCH] Don't clamp Bitmap::blit Bitmap::stretchBlt handles that now --- src/display/bitmap.cpp | 14 +------------- src/display/bitmap.h | 2 +- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/display/bitmap.cpp b/src/display/bitmap.cpp index dd86993a..95eef5dc 100644 --- a/src/display/bitmap.cpp +++ b/src/display/bitmap.cpp @@ -927,24 +927,12 @@ IntRect Bitmap::rect() const } void Bitmap::blt(int x, int y, - const Bitmap &source, IntRect rect, + const Bitmap &source, const IntRect &rect, int opacity) { if (source.isDisposed()) 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), source, rect, opacity); } diff --git a/src/display/bitmap.h b/src/display/bitmap.h index a73aa64e..9a1bbddd 100644 --- a/src/display/bitmap.h +++ b/src/display/bitmap.h @@ -63,7 +63,7 @@ public: IntRect rect() const; void blt(int x, int y, - const Bitmap &source, IntRect rect, + const Bitmap &source, const IntRect &rect, int opacity = 255); void stretchBlt(IntRect destRect,