summaryrefslogtreecommitdiff
path: root/src/code
diff options
context:
space:
mode:
authorDragorn421 <Dragorn421@users.noreply.github.com>2024-08-27 08:47:08 +0200
committerGitHub <noreply@github.com>2024-08-27 02:47:08 -0400
commitc00991da29ac2032f7194892538173b093d192ec (patch)
tree202483fc02b255a7a4caa0cd24965aee8fc1e61b /src/code
parent160d8f41920f9cefa174b9cf665f1e9a2892fd73 (diff)
match PreRender_CopyImageRegionImpl (#2093)
Diffstat (limited to 'src/code')
-rw-r--r--src/code/PreRender.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/code/PreRender.c b/src/code/PreRender.c
index 527b9c867..aedc0d07a 100644
--- a/src/code/PreRender.c
+++ b/src/code/PreRender.c
@@ -138,6 +138,7 @@ void PreRender_CopyImageRegionImpl(PreRender* this, Gfx** gfxP) {
s32 ult;
s32 lrt;
s32 uly;
+ s32 lry;
// Make sure that we don't load past the end of the source image
if (nRows > rowsRemaining) {
@@ -148,6 +149,7 @@ void PreRender_CopyImageRegionImpl(PreRender* this, Gfx** gfxP) {
ult = this->ulySave + curRow;
lrt = ult + nRows - 1;
uly = this->uly + curRow;
+ lry = uly + nRows - 1;
// Load a horizontal strip of the source image in RGBA16 format
gDPLoadTextureTile(gfx++, this->fbufSave, G_IM_FMT_RGBA, G_IM_SIZ_16b, this->widthSave, this->height - 1,
@@ -155,7 +157,7 @@ void PreRender_CopyImageRegionImpl(PreRender* this, Gfx** gfxP) {
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
// Draw that horizontal strip to the destination image, dsdx is 4 << 10 for COPY mode
- gSPTextureRectangle(gfx++, this->ulx << 2, uly << 2, this->lrx << 2, (uly + nRows - 1) << 2, G_TX_RENDERTILE,
+ gSPTextureRectangle(gfx++, this->ulx << 2, uly << 2, this->lrx << 2, lry << 2, G_TX_RENDERTILE,
this->ulxSave << 5, ult << 5, 4 << 10, 1 << 10);
curRow += nRows;