From b1bc05ec058df4b6af848dd166f60070fae5df6b Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 1 Aug 2022 15:37:00 -0400 Subject: [PATCH] Review changes --- include/constants/battle_anim.h | 4 ++-- src/mon_markings.c | 11 +++-------- src/pokemon_storage_system_8.c | 32 ++++++++++++++++---------------- 3 files changed, 21 insertions(+), 26 deletions(-) diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index 1e946dd1a..4363b7fca 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -354,9 +354,9 @@ #define B_ANIM_BAIT_THROW 0x4 #define B_ANIM_ITEM_KNOCKOFF 0x5 #define B_ANIM_TURN_TRAP 0x6 -#define B_ANIM_HELD_ITEM_EFFECT 0x7 +#define B_ANIM_HELD_ITEM_EFFECT 0x7 #define B_ANIM_SMOKEBALL_ESCAPE 0x8 -#define B_ANIM_FOCUS_BAND 0x9 +#define B_ANIM_FOCUS_BAND 0x9 #define B_ANIM_RAIN_CONTINUES 0xA #define B_ANIM_SUN_CONTINUES 0xB #define B_ANIM_SANDSTORM_CONTINUES 0xC diff --git a/src/mon_markings.c b/src/mon_markings.c index d444538e5..da633aacf 100644 --- a/src/mon_markings.c +++ b/src/mon_markings.c @@ -356,9 +356,8 @@ void FreeMonMarkingsMenu(void) u16 i; for (i = 0; i < 3; i++) - { FreeSpriteTilesByTag(sMenu->baseTileTag + i); - } + FreeSpritePaletteByTag(sMenu->basePaletteTag); FreeSpritePaletteByTag(sMenu->basePaletteTag + 1); for (i = 0; i < ARRAY_COUNT(sMenu->windowSprites); i++) @@ -385,20 +384,16 @@ bool8 HandleMonMarkingsMenuInput(void) if (JOY_NEW(DPAD_UP)) { - s8 pos; PlaySE(SE_SELECT); - pos = --sMenu->cursorPos; - if (pos < 0) + if (--sMenu->cursorPos < 0) sMenu->cursorPos = SELECTION_CANCEL; return TRUE; } if (JOY_NEW(DPAD_DOWN)) { - s8 pos; PlaySE(SE_SELECT); - pos = ++sMenu->cursorPos; - if (pos > SELECTION_CANCEL) + if (++sMenu->cursorPos > SELECTION_CANCEL) sMenu->cursorPos = 0; return TRUE; } diff --git a/src/pokemon_storage_system_8.c b/src/pokemon_storage_system_8.c index b14eb9844..cdd7728a2 100644 --- a/src/pokemon_storage_system_8.c +++ b/src/pokemon_storage_system_8.c @@ -595,25 +595,25 @@ void InitItemInfoWindow(void) bool8 UpdateItemInfoWindowSlideIn(void) { - s32 i, var; + s32 i, pos; if (gPSSData->itemInfoWindowOffset == 0) return FALSE; gPSSData->itemInfoWindowOffset--; - var = 25 - gPSSData->itemInfoWindowOffset; - for (i = 0; i < var; i++) + pos = 25 - gPSSData->itemInfoWindowOffset; + for (i = 0; i < pos; i++) { WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + gPSSData->itemInfoWindowOffset + i, i, 12, 1, 8, 15, 25); } - DrawItemInfoWindow(var); + DrawItemInfoWindow(pos); return (gPSSData->itemInfoWindowOffset != 0); } bool8 UpdateItemInfoWindowSlideOut(void) { - s32 i, var; + s32 i, pos; if (gPSSData->itemInfoWindowOffset == 25) return FALSE; @@ -622,28 +622,28 @@ bool8 UpdateItemInfoWindowSlideOut(void) FillBgTilemapBufferRect(0, 0, 25, 11, 1, 10, 17); gPSSData->itemInfoWindowOffset++; - var = 25 - gPSSData->itemInfoWindowOffset; - for (i = 0; i < var; i++) + pos = 25 - gPSSData->itemInfoWindowOffset; + for (i = 0; i < pos; i++) { WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + gPSSData->itemInfoWindowOffset + i, i, 12, 1, 8, 15, 25); } - DrawItemInfoWindow(var); + DrawItemInfoWindow(pos); - FillBgTilemapBufferRect(0, 0, var, 11, 1, 10, 0x11); + FillBgTilemapBufferRect(0, 0, pos, 11, 1, 10, 0x11); return (gPSSData->itemInfoWindowOffset != 25); } -static void DrawItemInfoWindow(u32 pos) +static void DrawItemInfoWindow(u32 x) { - if (pos != 0) + if (x != 0) { - FillBgTilemapBufferRect(0, 0x1A4, 0, 0xB, pos, 1, 0xFu); - FillBgTilemapBufferRect(0, 0x9A4, 0, 0x14, pos, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x1A4, 0, 0xB, x, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x9A4, 0, 0x14, x, 1, 0xFu); } - FillBgTilemapBufferRect(0, 0x1A5, pos, 0xC, 1, 8, 0xFu); - FillBgTilemapBufferRect(0, 0x1A6, pos, 0xB, 1, 1, 0xFu); - FillBgTilemapBufferRect(0, 0x1A7, pos, 0x14, 1, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x1A5, x, 0xC, 1, 8, 0xFu); + FillBgTilemapBufferRect(0, 0x1A6, x, 0xB, 1, 1, 0xFu); + FillBgTilemapBufferRect(0, 0x1A7, x, 0x14, 1, 1, 0xFu); ScheduleBgCopyTilemapToVram(0); }