Skip to Content
The Alchemy Project

src/menu/menu_icons.c

The menus' small pictures and the party row: the Djinn preview's stat arrows and Psynergy icons, the arrows that hop beside a page of four party members, the cursor that moves among them, and the party members' figures standing over the menus. More…

Included by menu.c.

Functions

NameDescription
voidmnLoadDjinnArrows (void)Loads the Djinn preview's up and down stat arrows, the pictures djinn_arrow_up and djinn_arrow_down, into free VRAM cache slots, the state's resourceSlots 0 and 1, for mnIconCreateDjinnArrow.
voidmnFreeArrows (void)Frees the VRAM cache slots of the two arrows the menu loaded (mnLoadStatArrows or mnLoadDjinnArrows).
Sint32mnIconLoadResourceIntoSlot (Sint32 abilityId, Sint32 slot)Loads the Psynergy icon of ability abilityId into VRAM cache slot slot: the icon is built (mnAbilityBuildIconTilesStub) in an ICON_TRANSFER in HEAP_SLOT_ICON_TRANSFER, which is released again.
voidmnIconCreatePsynergyIcon (WINDOW *window, Sint32 x, Sint32 y, Sint32 abilityId)Shows ability abilityId's Psynergy icon at (x, y) of window, for the Djinn preview's Psynergy lists, when a VRAM cache slot is free.
Sint32mnIconCreateStatChangeArrow (WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)Shows a stat change arrow, up or down (STAT_ARROW), at (x, y) of window.
Sint32mnIconCreateDjinnArrow (WINDOW *window, Sint32 x, Sint32 y, Sint32 variant)As mnIconCreateStatChangeArrow, with the up arrow raised 3 pixels and the down arrow 4.
Sint32mnMoveGridCursor (Sint32 *cursor, Sint32 count, Sint32 columns)Moves the selection *cursor among count entries in rows of columns: left and right step and wrap, up and down move a row, the last row ending at the last entry.
voidmnSetPageArrowsUpDown (Sint32 index, Sint32 count)Shows the up arrow when the page of four starting at index's page has one above it and the down arrow when one follows, among count entries.
voidmnSetPageArrowsLeftRight (Sint32 index, Sint32 count)As mnSetPageArrowsUpDown, with the arrows hopping left and right: the Djinn menu's columns of party members.
voidmnMarkChosenMember (Sint32 unused, Sint32 index, Sint32 count)Sets the page arrows for index and sets the chosen party member's figure apart from the others on its page of four: its y MENU_MEMBER_CHOSEN_Y, theirs MENU_MEMBER_Y.
voidmnUpdatePartyFigures (void)An event while the party figures show: places each party member's figure at its menu position and scale through the projected placement.
Sint32fdPartyGetCharacterSpriteStub (Sint32 id)Returns the sprite party member id's figure shows.
voidmnCreatePairFigures (Sint32 first, Sint32 second)mnCreatePartyFigures for two characters (-1 for none): their figures in entries 0 and 1, as the Djinn preview shows the pair a Djinni passes between.
voidmnCreatePartyFigures (Sint32 first)Replaces the menu's party figures with up to four party members' figures, from party place first on, standing (ANIM_STAND), and counts the party.
voidmnShowPartyFigures (WINDOW *window, Sint32 originX, Sint32 originY)Creates the first four party members' figures in a row from tile (originX, originY) inside window, three tiles apart, and starts placing them each tick (mnUpdatePartyFigures).
voidmnReleasePartyFigures (void)Destroys the menu's party figures and stops placing them.

Description

The menus' small pictures and the party row: the Djinn preview's stat arrows and Psynergy icons, the arrows that hop beside a page of four party members, the cursor that moves among them, and the party members' figures standing over the menus. Part of menu.c.

Functions in detail

mnLoadDjinnArrows

void mnLoadDjinnArrows(void)

Loads the Djinn preview's up and down stat arrows, the pictures djinn_arrow_up and djinn_arrow_down, into free VRAM cache slots, the state's resourceSlots 0 and 1, for mnIconCreateDjinnArrow.

References mnVRAMBlockLoadResourceStub(), Sint32 and syVRAMCacheFindFreeEntry().

Referenced by mnDjinnMenuRun().

Definition at line 9 of file menu_icons.c.

mnFreeArrows

void mnFreeArrows(void)

Frees the VRAM cache slots of the two arrows the menu loaded (mnLoadStatArrows or mnLoadDjinnArrows).

References syVRAMCacheFreeEntry().

Referenced by mnDjinnMenuRun() and mnItemMenuRun().

Definition at line 36 of file menu_icons.c.

mnIconLoadResourceIntoSlot

Sint32 mnIconLoadResourceIntoSlot(Sint32 abilityId, Sint32 slot)

Loads the Psynergy icon of ability abilityId into VRAM cache slot slot: the icon is built (mnAbilityBuildIconTilesStub) in an ICON_TRANSFER in HEAP_SLOT_ICON_TRANSFER, which is released again.

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

Referenced by mnIconCreatePsynergyIcon().

Definition at line 47 of file menu_icons.c.

mnIconCreatePsynergyIcon

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

Shows ability abilityId's Psynergy icon at (x, y) of window, for the Djinn preview's Psynergy lists, when a VRAM cache slot is free.

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

Referenced by mnDjinnMenuDrawStatPreview().

Definition at line 65 of file menu_icons.c.

mnIconCreateStatChangeArrow

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

Shows a stat change arrow, up or down (STAT_ARROW), at (x, y) of window. Returns 1, or -1 when no window sprite is free.

References mnWindowSpriteCreateStub() and Sint32.

Referenced by mnTextDrawStatComparison().

Definition at line 82 of file menu_icons.c.

mnIconCreateDjinnArrow

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

As mnIconCreateStatChangeArrow, with the up arrow raised 3 pixels and the down arrow 4. Returns 1, or -1 when no window sprite is free.

References mnWindowSpriteCreateStub() and Sint32.

Definition at line 111 of file menu_icons.c.

mnMoveGridCursor

Sint32 mnMoveGridCursor(Sint32 *cursor, Sint32 count, Sint32 columns)

Moves the selection *cursor among count entries in rows of columns: left and right step and wrap, up and down move a row, the last row ending at the last entry. Returns 0 when it stays, 1 when it moves within its row and 2 when it reaches another row (another page of the party members).

References PerWork, result, Sint32 and sySoundPlayStub().

Referenced by mnItemMenuRunMemberSelection(), mnItemMenuSelectTarget(), mnPartyMemberChooserChooseMember(), mnPsynergyMenuSelectMember(), mnPsynergyMenuSelectTarget() and mnStatusScreenRunPartyRow().

Definition at line 148 of file menu_icons.c.

mnSetPageArrowsUpDown

void mnSetPageArrowsUpDown(Sint32 index, Sint32 count)

Shows the up arrow when the page of four starting at index's page has one above it and the down arrow when one follows, among count entries.

References Sint32.

Referenced by mnMarkChosenMember().

Definition at line 190 of file menu_icons.c.

mnSetPageArrowsLeftRight

void mnSetPageArrowsLeftRight(Sint32 index, Sint32 count)

As mnSetPageArrowsUpDown, with the arrows hopping left and right: the Djinn menu's columns of party members.

References Sint32.

Referenced by mnDjinnMenuSelectDjinn().

Definition at line 214 of file menu_icons.c.

mnMarkChosenMember

void mnMarkChosenMember(Sint32 unused, Sint32 index, Sint32 count)

Sets the page arrows for index and sets the chosen party member's figure apart from the others on its page of four: its y MENU_MEMBER_CHOSEN_Y, theirs MENU_MEMBER_Y.

References mnSetPageArrowsUpDown() and Sint32.

Referenced by mnItemMenuRunList(), mnItemMenuRunMemberSelection(), mnItemMenuSelectTarget(), mnPartyMemberChooserChooseMember(), mnPsynergyMenuRunList(), mnPsynergyMenuSelectMember(), mnPsynergyMenuSelectTarget() and mnStatusScreenRunPartyRow().

Definition at line 239 of file menu_icons.c.

mnUpdatePartyFigures

void mnUpdatePartyFigures(void)

An event while the party figures show: places each party member's figure at its menu position and scale through the projected placement.

References fdRenderApplyProjectedPlacementAtDepthStub() and Sint32.

Referenced by mnDjinnMenuRunPreview(), mnDjinnMenuShowHelp(), mnDjinnMenuShowMemberStatus(), mnItemMenuShowDetails(), mnReleasePartyFigures(), mnShowPartyFigures() and mnStatusScreenRunPages().

Definition at line 257 of file menu_icons.c.

fdPartyGetCharacterSpriteStub

Sint32 fdPartyGetCharacterSpriteStub(Sint32 id)

Returns the sprite party member id's figure shows.

Referenced by mnCreatePairFigures() and mnCreatePartyFigures().

Definition at line 291 of file menu_icons.c.

mnCreatePairFigures

void mnCreatePairFigures(Sint32 first, Sint32 second)

mnCreatePartyFigures for two characters (-1 for none): their figures in entries 0 and 1, as the Djinn preview shows the pair a Djinni passes between.

References fdPartyGetCharacterSpriteStub(), fdSpriteCreateStub(), fdSpriteDestroyStub(), fdSpriteStartAnimationStub() and Sint32.

Referenced by mnDjinnMenuRunPreview().

Definition at line 295 of file menu_icons.c.

mnCreatePartyFigures

void mnCreatePartyFigures(Sint32 first)

Replaces the menu's party figures with up to four party members' figures, from party place first on, standing (ANIM_STAND), and counts the party.

References fdPartyGetCharacterSpriteStub(), fdSpriteCreateStub(), fdSpriteDestroyStub(), fdSpriteStartAnimationStub(), gmPartyListMembersStub() and Sint32.

Referenced by mnDjinnMenuSelectDjinn(), mnItemMenuRunList(), mnItemMenuRunMemberSelection(), mnItemMenuSelectTarget(), mnPartyMemberChooserChooseMember(), mnPsynergyMenuRunList(), mnPsynergyMenuSelectMember(), mnPsynergyMenuSelectTarget(), mnShowPartyFigures() and mnStatusScreenRunPartyRow().

Definition at line 334 of file menu_icons.c.

mnShowPartyFigures

void mnShowPartyFigures(WINDOW *window, Sint32 originX, Sint32 originY)

Creates the first four party members' figures in a row from tile (originX, originY) inside window, three tiles apart, and starts placing them each tick (mnUpdatePartyFigures).

References mnCreatePartyFigures(), mnUpdatePartyFigures(), Sint32 and sySetEvent().

Referenced by mnItemMenuInit() and mnStatusScreenInit().

Definition at line 370 of file menu_icons.c.

mnReleasePartyFigures

void mnReleasePartyFigures(void)

Destroys the menu's party figures and stops placing them.

References fdSpriteDestroyStub(), mnUpdatePartyFigures(), Sint32 and syCloseEvent().

Referenced by mnItemMenuClose().

Definition at line 392 of file menu_icons.c.