Review changes

This commit is contained in:
Eduardo Quezada
2022-08-01 15:37:00 -04:00
parent 95b16a2391
commit b1bc05ec05
3 changed files with 21 additions and 26 deletions
+2 -2
View File
@@ -354,9 +354,9 @@
#define B_ANIM_BAIT_THROW 0x4 #define B_ANIM_BAIT_THROW 0x4
#define B_ANIM_ITEM_KNOCKOFF 0x5 #define B_ANIM_ITEM_KNOCKOFF 0x5
#define B_ANIM_TURN_TRAP 0x6 #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_SMOKEBALL_ESCAPE 0x8
#define B_ANIM_FOCUS_BAND 0x9 #define B_ANIM_FOCUS_BAND 0x9
#define B_ANIM_RAIN_CONTINUES 0xA #define B_ANIM_RAIN_CONTINUES 0xA
#define B_ANIM_SUN_CONTINUES 0xB #define B_ANIM_SUN_CONTINUES 0xB
#define B_ANIM_SANDSTORM_CONTINUES 0xC #define B_ANIM_SANDSTORM_CONTINUES 0xC
+3 -8
View File
@@ -356,9 +356,8 @@ void FreeMonMarkingsMenu(void)
u16 i; u16 i;
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{
FreeSpriteTilesByTag(sMenu->baseTileTag + i); FreeSpriteTilesByTag(sMenu->baseTileTag + i);
}
FreeSpritePaletteByTag(sMenu->basePaletteTag); FreeSpritePaletteByTag(sMenu->basePaletteTag);
FreeSpritePaletteByTag(sMenu->basePaletteTag + 1); FreeSpritePaletteByTag(sMenu->basePaletteTag + 1);
for (i = 0; i < ARRAY_COUNT(sMenu->windowSprites); i++) for (i = 0; i < ARRAY_COUNT(sMenu->windowSprites); i++)
@@ -385,20 +384,16 @@ bool8 HandleMonMarkingsMenuInput(void)
if (JOY_NEW(DPAD_UP)) if (JOY_NEW(DPAD_UP))
{ {
s8 pos;
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
pos = --sMenu->cursorPos; if (--sMenu->cursorPos < 0)
if (pos < 0)
sMenu->cursorPos = SELECTION_CANCEL; sMenu->cursorPos = SELECTION_CANCEL;
return TRUE; return TRUE;
} }
if (JOY_NEW(DPAD_DOWN)) if (JOY_NEW(DPAD_DOWN))
{ {
s8 pos;
PlaySE(SE_SELECT); PlaySE(SE_SELECT);
pos = ++sMenu->cursorPos; if (++sMenu->cursorPos > SELECTION_CANCEL)
if (pos > SELECTION_CANCEL)
sMenu->cursorPos = 0; sMenu->cursorPos = 0;
return TRUE; return TRUE;
} }
+16 -16
View File
@@ -595,25 +595,25 @@ void InitItemInfoWindow(void)
bool8 UpdateItemInfoWindowSlideIn(void) bool8 UpdateItemInfoWindowSlideIn(void)
{ {
s32 i, var; s32 i, pos;
if (gPSSData->itemInfoWindowOffset == 0) if (gPSSData->itemInfoWindowOffset == 0)
return FALSE; return FALSE;
gPSSData->itemInfoWindowOffset--; gPSSData->itemInfoWindowOffset--;
var = 25 - gPSSData->itemInfoWindowOffset; pos = 25 - gPSSData->itemInfoWindowOffset;
for (i = 0; i < var; i++) for (i = 0; i < pos; i++)
{ {
WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + gPSSData->itemInfoWindowOffset + i, i, 12, 1, 8, 15, 25); 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); return (gPSSData->itemInfoWindowOffset != 0);
} }
bool8 UpdateItemInfoWindowSlideOut(void) bool8 UpdateItemInfoWindowSlideOut(void)
{ {
s32 i, var; s32 i, pos;
if (gPSSData->itemInfoWindowOffset == 25) if (gPSSData->itemInfoWindowOffset == 25)
return FALSE; return FALSE;
@@ -622,28 +622,28 @@ bool8 UpdateItemInfoWindowSlideOut(void)
FillBgTilemapBufferRect(0, 0, 25, 11, 1, 10, 17); FillBgTilemapBufferRect(0, 0, 25, 11, 1, 10, 17);
gPSSData->itemInfoWindowOffset++; gPSSData->itemInfoWindowOffset++;
var = 25 - gPSSData->itemInfoWindowOffset; pos = 25 - gPSSData->itemInfoWindowOffset;
for (i = 0; i < var; i++) for (i = 0; i < pos; i++)
{ {
WriteSequenceToBgTilemapBuffer(0, GetBgAttribute(0, BG_ATTR_BASETILE) + 0x14 + gPSSData->itemInfoWindowOffset + i, i, 12, 1, 8, 15, 25); 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); 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, 0x1A4, 0, 0xB, x, 1, 0xFu);
FillBgTilemapBufferRect(0, 0x9A4, 0, 0x14, pos, 1, 0xFu); FillBgTilemapBufferRect(0, 0x9A4, 0, 0x14, x, 1, 0xFu);
} }
FillBgTilemapBufferRect(0, 0x1A5, pos, 0xC, 1, 8, 0xFu); FillBgTilemapBufferRect(0, 0x1A5, x, 0xC, 1, 8, 0xFu);
FillBgTilemapBufferRect(0, 0x1A6, pos, 0xB, 1, 1, 0xFu); FillBgTilemapBufferRect(0, 0x1A6, x, 0xB, 1, 1, 0xFu);
FillBgTilemapBufferRect(0, 0x1A7, pos, 0x14, 1, 1, 0xFu); FillBgTilemapBufferRect(0, 0x1A7, x, 0x14, 1, 1, 0xFu);
ScheduleBgCopyTilemapToVram(0); ScheduleBgCopyTilemapToVram(0);
} }