diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2020-10-29 23:50:43 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-29 23:50:43 -0400 |
commit | 9e55ae22b19d58eca8fc0cdd2fcea9f2cca14319 (patch) | |
tree | fab11011192617763c377d55e07b9371cfc05584 /src/menu.c | |
parent | fbff087e9a252f2695356230803a3ae8c8376e05 (diff) | |
parent | be1685c87fd683c2c4efc6d2ca173d5344bfcf2f (diff) |
Merge pull request #1242 from GriffinRichards/constants-menuinfoicons
Use constants for menu info icon table
Diffstat (limited to 'src/menu.c')
-rw-r--r-- | src/menu.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/menu.c b/src/menu.c index 9c5dec024..457fc2bf2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -25,7 +25,7 @@ #define STD_WINDOW_PALETTE_NUM 14 #define STD_WINDOW_BASE_TILE_NUM 0x214 -struct MoveMenuInfoIcon +struct MenuInfoIcon { u8 width; u8 height; @@ -98,34 +98,34 @@ const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal"); const u8 sTextColors[] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; // Table of move info icon offsets in graphics/interface_fr/menu.png -const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] = +static const struct MenuInfoIcon sMenuInfoIcons[] = { // { width, height, offset } - { 12, 12, 0x00 }, // Unused - { 32, 12, 0x20 }, // Normal icon - { 32, 12, 0x64 }, // Fight icon - { 32, 12, 0x60 }, // Flying icon - { 32, 12, 0x80 }, // Poison icon - { 32, 12, 0x48 }, // Ground icon - { 32, 12, 0x44 }, // Rock icon - { 32, 12, 0x6C }, // Bug icon - { 32, 12, 0x68 }, // Ghost icon - { 32, 12, 0x88 }, // Steel icon - { 32, 12, 0xA4 }, // ??? (Mystery) icon - { 32, 12, 0x24 }, // Fire icon - { 32, 12, 0x28 }, // Water icon - { 32, 12, 0x2C }, // Grass icon - { 32, 12, 0x40 }, // Electric icon - { 32, 12, 0x84 }, // Psychic icon - { 32, 12, 0x4C }, // Ice icon - { 32, 12, 0xA0 }, // Dragon icon - { 32, 12, 0x8C }, // Dark icon - { 42, 12, 0xA8 }, // -Type- icon - { 42, 12, 0xC0 }, // -Power- icon - { 42, 12, 0xC8 }, // -Accuracy- icon - { 42, 12, 0xE0 }, // -PP- icon - { 42, 12, 0xE8 }, // -Effect- icon - { 8, 8, 0xAE }, // Unused (Small white pokeball) - { 8, 8, 0xAF }, // Unused (Small dark pokeball) + { 12, 12, 0x00 }, // Unused + [TYPE_NORMAL + 1] = { 32, 12, 0x20 }, + [TYPE_FIGHTING + 1] = { 32, 12, 0x64 }, + [TYPE_FLYING + 1] = { 32, 12, 0x60 }, + [TYPE_POISON + 1] = { 32, 12, 0x80 }, + [TYPE_GROUND + 1] = { 32, 12, 0x48 }, + [TYPE_ROCK + 1] = { 32, 12, 0x44 }, + [TYPE_BUG + 1] = { 32, 12, 0x6C }, + [TYPE_GHOST + 1] = { 32, 12, 0x68 }, + [TYPE_STEEL + 1] = { 32, 12, 0x88 }, + [TYPE_MYSTERY + 1] = { 32, 12, 0xA4 }, + [TYPE_FIRE + 1] = { 32, 12, 0x24 }, + [TYPE_WATER + 1] = { 32, 12, 0x28 }, + [TYPE_GRASS + 1] = { 32, 12, 0x2C }, + [TYPE_ELECTRIC + 1] = { 32, 12, 0x40 }, + [TYPE_PSYCHIC + 1] = { 32, 12, 0x84 }, + [TYPE_ICE + 1] = { 32, 12, 0x4C }, + [TYPE_DRAGON + 1] = { 32, 12, 0xA0 }, + [TYPE_DARK + 1] = { 32, 12, 0x8C }, + [MENU_INFO_ICON_TYPE] = { 42, 12, 0xA8 }, + [MENU_INFO_ICON_POWER] = { 42, 12, 0xC0 }, + [MENU_INFO_ICON_ACCURACY] = { 42, 12, 0xC8 }, + [MENU_INFO_ICON_PP] = { 42, 12, 0xE0 }, + [MENU_INFO_ICON_EFFECT] = { 42, 12, 0xE8 }, // Unused + [MENU_INFO_ICON_BALL_RED] = { 8, 8, 0xAE }, // For placed decorations in Secret Base + [MENU_INFO_ICON_BALL_BLUE] = { 8, 8, 0xAF }, // For placed decorations in player's room }; @@ -2119,9 +2119,9 @@ void ListMenuLoadStdPalAt(u8 palOffset, u8 palId) LoadPalette(palette, palOffset, 0x20); } -void blit_move_info_icon(u8 windowId, u8 iconId, u16 x, u16 y) +void BlitMenuInfoIcon(u8 windowId, u8 iconId, u16 x, u16 y) { - BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + gMoveMenuInfoIcons[iconId].offset * 32, 0, 0, 128, 128, x, y, gMoveMenuInfoIcons[iconId].width, gMoveMenuInfoIcons[iconId].height); + BlitBitmapRectToWindow(windowId, gFireRedMenuElements_Gfx + sMenuInfoIcons[iconId].offset * 32, 0, 0, 128, 128, x, y, sMenuInfoIcons[iconId].width, sMenuInfoIcons[iconId].height); } void BufferSaveMenuText(u8 textId, u8 *dest, u8 color) |