diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-10-29 11:51:47 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-10-29 11:51:47 -0400 |
commit | 901cd476b65b9212032f21b4ff19f6e77154af4a (patch) | |
tree | 97a4926382376acae128419e3c82e802ad66f707 /src | |
parent | 07bf225f9416b3d75fb69101d1d5ec87a19031b6 (diff) |
Fix incorrect arguments on CopyRectToBgTilemapBufferRect
Diffstat (limited to 'src')
-rwxr-xr-x | src/party_menu.c | 13 | ||||
-rw-r--r-- | src/pokemon_storage_system.c | 8 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/party_menu.c b/src/party_menu.c index 9829d62e9..5ef8699fa 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2792,7 +2792,7 @@ static void SwitchSelectedMons(u8 taskId) // returns FALSE if the slot has slid fully offscreen / back onscreen static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newWidth) { - if ((x + width) < 0) + if (x + width < 0) return FALSE; if (x > 31) return FALSE; @@ -2807,7 +2807,7 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW { *leftMove = 0; *newX = x; - if ((x + width) > 31) + if (x + width > 31) *newWidth = 32 - x; else *newWidth = width; @@ -2818,14 +2818,13 @@ static bool8 TryMovePartySlot(s16 x, s16 width, u8 *leftMove, u8 *newX, u8 *newW static void MoveAndBufferPartySlot(const void *rectSrc, s16 x, s16 y, s16 width, s16 height, s16 dir) { - // The use of the dimension parameters here is a mess - u8 leftMove, newX, newWidth; // leftMove is used as a srcX, newX is used as both x and srcHeight, newWidth is used as both width and destY + u8 srcX, newX, newWidth; - if (TryMovePartySlot(x, width, &leftMove, &newX, &newWidth)) + if (TryMovePartySlot(x, width, &srcX, &newX, &newWidth)) { FillBgTilemapBufferRect_Palette0(0, 0, newX, y, newWidth, height); - if (TryMovePartySlot(x + dir, width, &leftMove, &newX, &newWidth)) - CopyRectToBgTilemapBufferRect(0, rectSrc, leftMove, 0, width, height, newX, y, newWidth, height, 17, 0, 0); + if (TryMovePartySlot(x + dir, width, &srcX, &newX, &newWidth)) + CopyRectToBgTilemapBufferRect(0, rectSrc, srcX, 0, width, height, newX, y, newWidth, height, 17, 0, 0); } } diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index e18a6db76..36d54123c 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -5437,16 +5437,16 @@ static bool32 WaitForWallpaperGfxLoad(void) static void DrawWallpaper(const void *tilemap, s8 direction, u8 offset) { - s16 var = offset * 256; - s16 var2 = (offset * 2) + 3; + s16 tileOffset = offset * 256; + s16 paletteNum = (offset * 2) + 3; s16 x = ((sStorage->bg2_X / 8 + 10) + (direction * 24)) & 0x3F; - CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 0x14, 0x12, x, 2, 0x14, 0x12, 0x11, var, var2); + CopyRectToBgTilemapBufferRect(2, tilemap, 0, 0, 20, 18, x, 2, 20, 18, 17, tileOffset, paletteNum); if (direction == 0) return; if (direction > 0) - x += 0x14; + x += 20; else x -= 4; |