Skip to Content
The Alchemy Project

src/menu/menu_icons.c

The stat and Djinn arrows and the Psynergy icons the menus load into VRAM blocks. More…

Included by menu.c.

Functions

NameDescription
voidmnLoadDjinnArrows (void)Loads the Djinn menu's up and down arrows (djinn_arrow_up and djinn_arrow_down) into two free VRAM blocks, kept in the state's resourceSlots[0] and [1] for mnIconCreateDjinnArrow.
voidmnIconMenuReleaseArrows (void)Releases both cached icon resources used by the menu: the two arrows in the state's resourceSlots, which mnItemMenuRun and mnDjinnMenuRun free as they close.
Sint32mnIconLoadResourceIntoSlot (Sint32 abilityId, Sint32 slot)Loads ability abilityId's Psynergy icon into VRAM block slot: its tiles are built (mnAbilityBuildIconTilesStub) in a scratch ICON_TRANSFER in HEAP_SLOT_ICON_TRANSFER, which is released again.
Sint32mnIconCreatePsynergyIcon (WINDOW *window, Sint32 x, Sint32 y, Sint32 abilityId)Shows ability abilityId's Psynergy icon at (x, y) of window, in a free VRAM block, for the Djinn preview's Psynergy lists; with no block free, nothing.
Sint32mnIconCreateStatChangeArrow (WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)Shows the up arrow (STAT_ARROW_UP) or down arrow (STAT_ARROW_DOWN) loaded by mnLoadStatArrows at (x, y) of window, beside a stat the equipment preview changes (mnTextDrawStatComparison).
Sint32mnIconCreateDjinnArrow (WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)Shows the Djinn menu's up arrow (STAT_ARROW_UP) or down arrow at (x, y) of window, beside a stat the Djinn preview changes, as mnIconCreateStatChangeArrow does: raised 3 pixels for the up arrow and 4 for the down one.

Description

The stat and Djinn arrows and the Psynergy icons the menus load into VRAM blocks. Part of menu.c.

Functions in detail

mnLoadDjinnArrows

void mnLoadDjinnArrows(void)

Loads the Djinn menu's up and down arrows (djinn_arrow_up and djinn_arrow_down) into two free VRAM blocks, kept in the state's resourceSlots[0] and [1] for mnIconCreateDjinnArrow.

References MenuDjinnArrowDownTiles, MenuDjinnArrowUpTiles, Sint32, syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().

Referenced by mnDjinnMenuRun().

Definition at line 9 of file menu_icons.c.

mnIconMenuReleaseArrows

void mnIconMenuReleaseArrows(void)

Releases both cached icon resources used by the menu: the two arrows in the state's resourceSlots, which mnItemMenuRun and mnDjinnMenuRun free as they close.

References syVRAMCacheFreeEntry().

Referenced by mnDjinnMenuRun() and mnItemMenuRun().

Definition at line 36 of file menu_icons.c.

mnIconLoadResourceIntoSlot

Sint32 mnIconLoadResourceIntoSlot(Sint32 abilityId, Sint32 slot)

Loads ability abilityId's Psynergy icon into VRAM block slot: its tiles are built (mnAbilityBuildIconTilesStub) in a scratch ICON_TRANSFER in HEAP_SLOT_ICON_TRANSFER, which is released again. Returns the block's first tile.

References mnAbilityBuildIconTilesStub(), Sint32, syHeapSlotAllocateEWRAM(), syHeapSlotRelease() and syVRAMCacheReload().

Referenced by mnIconCreatePsynergyIcon().

Definition at line 49 of file menu_icons.c.

mnIconCreatePsynergyIcon

Sint32 mnIconCreatePsynergyIcon(WINDOW *window, Sint32 x, Sint32 y, Sint32 abilityId)

Shows ability abilityId's Psynergy icon at (x, y) of window, in a free VRAM block, for the Djinn preview's Psynergy lists; with no block free, nothing. Returns no value; callers ignore it.

References mnIconLoadResourceIntoSlot(), mnWindowSpriteCreateStub(), Sint32 and syVRAMCacheFindFreeEntry().

Referenced by mnDjinnMenuDrawStatPreview().

Definition at line 69 of file menu_icons.c.

mnIconCreateStatChangeArrow

Sint32 mnIconCreateStatChangeArrow(WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)

Shows the up arrow (STAT_ARROW_UP) or down arrow (STAT_ARROW_DOWN) loaded by mnLoadStatArrows at (x, y) of window, beside a stat the equipment preview changes (mnTextDrawStatComparison). Returns 1, or -1 when the window has no sprite free.

References mnWindowSpriteCreateStub() and Sint32.

Referenced by mnTextDrawStatComparison().

Definition at line 90 of file menu_icons.c.

mnIconCreateDjinnArrow

Sint32 mnIconCreateDjinnArrow(WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)

Shows the Djinn menu's up arrow (STAT_ARROW_UP) or down arrow at (x, y) of window, beside a stat the Djinn preview changes, as mnIconCreateStatChangeArrow does: raised 3 pixels for the up arrow and 4 for the down one.

References mnWindowSpriteCreateStub() and Sint32.

Definition at line 123 of file menu_icons.c.