Alchemy
Loading...
Searching...
No Matches

icons.c File Reference

Item, Psynergy and command icons. More...

Go to the source code of this file.

Macros

#define ICON_FRAME   1
#define ICON_COUNT_ABOVE_ONE   2
#define ICON_COUNT   4
#define ICON_EQUIPPED   8
#define ICON_BROKEN   16
#define ICON_ARTIFACT   32
#define ROUTINE_BLOCK   49

Functions

s32 UiIcon_CountItemIcons (void)
s32 UiIcon_CountPsynergyIcons (void)
void Ui_BuildPairedPatternsToSlot (s32 overlayIcon, s32 frameIcon, s32 *slot, s32 *tileOut, s32 reuse)
 Builds a command icon (overlay overlayIcon over frame frameIcon) and loads it into a sprite tile slot: *slot, or a free one when reuse is 0.
void Ability_RequestGlyph (s32 action, s32 withBase, s32 *slot, s32 *tile, s32 reuse)
 Builds the icon of a battle action's item (its first operand) into a slot, as UiIcon_BuildItemIconTiles.
void UiIcon_BuildItemIconTiles (u32 glyph, s32 withBase, s32 *cacheSlot, s32 *tileOut, s32 reuse)
 Builds the item icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
s32 ItemIcon_Compose (u32 code, u32 layers)
 Draws an item's icon into the glyph work buffer from its inventory code (item id in the low 9 bits, broken 0x200, equipped 0x400, count less one in the top 5 bits) with the layers asked for (ICON_ flags): the frame, the equipped, broken and artifact marks, and the count.
s32 UiIcon_CopyResourceToSlot (s32 inventoryCode, s32 layers, s32 cacheSlot)
 Composes an inventory icon with the requested layers and loads it into cacheSlot.
s32 Ui_BuildPatternToSlot (s32 icon, s32 unused, s32 cacheSlot)
 Builds one of the other icons and loads it into sprite tile slot cacheSlot.
s32 RenderResource_LoadTableEntry (u32 value, s32 unused, u32 slot)
 Loads one of four small fixed images into the sprite tile slot named by slot.
void Ui_PrepareTransferForItem (s32 code)
 Draws an item's icon from its inventory code into the glyph work buffer.
void Ability_LoadGlyph (s32 action, s32 withBase, s32 *slot, s32 *tile, s32 reuse)
 Builds the Psynergy icon of a battle action, as UiIcon_BuildAbilityIconTiles.
void UiIcon_BuildAbilityIconTiles (u32 glyph, s32 withBase, s32 *cacheSlot, s32 *tileOut, s32 reuse)
 Builds the Psynergy icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
void Ui_PrepareTransferFromTableEntry (u32 iconIndex)
 Draws one of the other icons into the glyph work buffer.
void UiGlyph_LoadEntryWithPalette (u32 icon, s32 unused, s32 *slot, s32 *tile, s32 palette, s32 reuse)
 Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is set) and its colours into the sprite palette named by palette.
void UiGlyph_ReservedNoOp (void)
void UiIcon_Decode (GlyphTransfer *glyph, s32 outlined)
 Decodes a compressed icon into the glyph buffer and expands it to tiles, opaque for the first layer or masked over what is there when outlined is set.

Variables

const u8 * gRenderResource_PairSourceTable []

Detailed Description

Item, Psynergy and command icons.

Part of window.c, the window object, compiled only through it.

Definition in file icons.c.

Macro Definition Documentation

◆ ICON_FRAME

#define ICON_FRAME   1

Definition at line 83 of file icons.c.

Referenced by ItemIcon_Compose().

◆ ICON_COUNT_ABOVE_ONE

#define ICON_COUNT_ABOVE_ONE   2

Definition at line 84 of file icons.c.

Referenced by ItemIcon_Compose().

◆ ICON_COUNT

#define ICON_COUNT   4

Definition at line 85 of file icons.c.

Referenced by ItemIcon_Compose().

◆ ICON_EQUIPPED

#define ICON_EQUIPPED   8

Definition at line 86 of file icons.c.

Referenced by ItemIcon_Compose().

◆ ICON_BROKEN

#define ICON_BROKEN   16

Definition at line 87 of file icons.c.

Referenced by ItemIcon_Compose().

◆ ICON_ARTIFACT

#define ICON_ARTIFACT   32

Definition at line 88 of file icons.c.

Referenced by ItemIcon_Compose().

◆ ROUTINE_BLOCK

#define ROUTINE_BLOCK   49

Definition at line 240 of file icons.c.

Referenced by UiIcon_Decode().

Function Documentation

◆ UiIcon_CountItemIcons()

s32 UiIcon_CountItemIcons ( void )

Definition at line 7 of file icons.c.

Referenced by UiIcon_BuildItemIconTiles(), and UiIcon_CountItemIcons().

◆ UiIcon_CountPsynergyIcons()

s32 UiIcon_CountPsynergyIcons ( void )

Definition at line 11 of file icons.c.

Referenced by UiIcon_BuildAbilityIconTiles(), and UiIcon_CountPsynergyIcons().

◆ Ui_BuildPairedPatternsToSlot()

void Ui_BuildPairedPatternsToSlot ( s32 overlayIcon,
s32 frameIcon,
s32 * slot,
s32 * tileOut,
s32 reuse )

Builds a command icon (overlay overlayIcon over frame frameIcon) and loads it into a sprite tile slot: *slot, or a free one when reuse is 0.

Returns the tile in *tileOut. Frame decode is opaque; the command layer is then composited with transparency.

Definition at line 20 of file icons.c.

Referenced by RenderOutput_CreateWithTransform(), Resource_LoadByMode(), Resource_LoadByModeIntoSlot(), SelectionScreen_HighlightIcon(), SelectionScreen_RedrawIcon(), SelectionScreen_SetupIcon(), and Ui_BuildPairedPatternsToSlot().

◆ Ability_RequestGlyph()

void Ability_RequestGlyph ( s32 action,
s32 withBase,
s32 * slot,
s32 * tile,
s32 reuse )

Builds the icon of a battle action's item (its first operand) into a slot, as UiIcon_BuildItemIconTiles.

Definition at line 42 of file icons.c.

Referenced by Ability_RequestGlyph().

◆ UiIcon_BuildItemIconTiles()

void UiIcon_BuildItemIconTiles ( u32 glyph,
s32 withBase,
s32 * cacheSlot,
s32 * tileOut,
s32 reuse )

Builds the item icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).

Returns the tile in *tileOut. The optional frame is decoded first and selects masked icon expansion.

Definition at line 52 of file icons.c.

Referenced by Ability_RequestGlyph(), DebugMenu_BrowseIcons(), SelectionScreen_SetupIcon(), and UiIcon_BuildItemIconTiles().

◆ ItemIcon_Compose()

s32 ItemIcon_Compose ( u32 code,
u32 layers )

Draws an item's icon into the glyph work buffer from its inventory code (item id in the low 9 bits, broken 0x200, equipped 0x400, count less one in the top 5 bits) with the layers asked for (ICON_ flags): the frame, the equipped, broken and artifact marks, and the count.

Returns 256, or -1 when there is no glyph work buffer.

Definition at line 95 of file icons.c.

Referenced by ItemIcon_Compose(), ItemIcon_LoadIntoSlot(), and UiIcon_CopyResourceToSlot().

◆ UiIcon_CopyResourceToSlot()

s32 UiIcon_CopyResourceToSlot ( s32 inventoryCode,
s32 layers,
s32 cacheSlot )

Composes an inventory icon with the requested layers and loads it into cacheSlot.

The temporary glyph block is released after the upload.

Definition at line 166 of file icons.c.

Referenced by RenderOutput_CreateLoaded(), Resource_LoadByMode(), Resource_LoadByModeIntoSlot(), and UiIcon_CopyResourceToSlot().

◆ Ui_BuildPatternToSlot()

s32 Ui_BuildPatternToSlot ( s32 icon,
s32 unused,
s32 cacheSlot )

Builds one of the other icons and loads it into sprite tile slot cacheSlot.

Definition at line 177 of file icons.c.

Referenced by DebugMenu_BrowseIcons(), Resource_LoadByModeIntoSlot(), and Ui_BuildPatternToSlot().

◆ RenderResource_LoadTableEntry()

s32 RenderResource_LoadTableEntry ( u32 value,
s32 unused,
u32 slot )

Loads one of four small fixed images into the sprite tile slot named by slot.

Definition at line 190 of file icons.c.

Referenced by RenderOutput_CreateFromTable(), RenderResource_LoadTableEntry(), Resource_LoadByMode(), and Resource_LoadByModeIntoSlot().

◆ Ui_PrepareTransferForItem()

void Ui_PrepareTransferForItem ( s32 code)

Draws an item's icon from its inventory code into the glyph work buffer.

Definition at line 218 of file icons.c.

Referenced by Sanctum_RaiseItemIcon(), and Ui_PrepareTransferForItem().

◆ Ability_LoadGlyph()

void Ability_LoadGlyph ( s32 action,
s32 withBase,
s32 * slot,
s32 * tile,
s32 reuse )

Builds the Psynergy icon of a battle action, as UiIcon_BuildAbilityIconTiles.

Definition at line 234 of file icons.c.

Referenced by Ability_LoadGlyph(), BattleMenu_RunActionSelection(), Resource_LoadByMode(), Resource_LoadByModeIntoSlot(), Resource_LoadIndexedEntryToBuffer(), SelectionScreen_SetupIcon(), and SummonMenu_SelectSummon().

◆ UiIcon_BuildAbilityIconTiles()

void UiIcon_BuildAbilityIconTiles ( u32 glyph,
s32 withBase,
s32 * cacheSlot,
s32 * tileOut,
s32 reuse )

Builds the Psynergy icon glyph, over the icon frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).

Returns the tile in *tileOut. The optional frame is decoded first and selects masked icon expansion.

Definition at line 246 of file icons.c.

Referenced by Ability_LoadGlyph(), DebugMenu_BrowseIcons(), and UiIcon_BuildAbilityIconTiles().

◆ Ui_PrepareTransferFromTableEntry()

void Ui_PrepareTransferFromTableEntry ( u32 iconIndex)

Draws one of the other icons into the glyph work buffer.

Definition at line 278 of file icons.c.

Referenced by Resource_LoadTableEntryToBuffer(), Ui_BuildPatternToSlot(), and Ui_PrepareTransferFromTableEntry().

◆ UiGlyph_LoadEntryWithPalette()

void UiGlyph_LoadEntryWithPalette ( u32 icon,
s32 unused,
s32 * slot,
s32 * tile,
s32 palette,
s32 reuse )

Loads a 32x32 icon from the icon resource into sprite tile slot *slot (a free slot unless reuse is set) and its colours into the sprite palette named by palette.

Returns the tile in *tile. This resource stores its palette before the encoded tile payload.

Definition at line 291 of file icons.c.

Referenced by CreateSideObject(), DebugMenu_BrowseEntryGlyphs(), Djinn_ShowJoinedMessage(), Party_ShowJoinedMessage(), Party_ShowPairJoinedMessage(), Ui_LoadCharacterEntryForSlot(), UiGlyph_LoadEntryWithPalette(), and UiGlyph_LoadPortrait().

◆ UiGlyph_ReservedNoOp()

void UiGlyph_ReservedNoOp ( void )

Definition at line 317 of file icons.c.

Referenced by UiGlyph_ReservedNoOp().

◆ UiIcon_Decode()

void UiIcon_Decode ( GlyphTransfer * glyph,
s32 outlined )

Decodes a compressed icon into the glyph buffer and expands it to tiles, opaque for the first layer or masked over what is there when outlined is set.

Releases each copied decoder before loading the next routine into the same slot.

Definition at line 323 of file icons.c.

Referenced by ItemIcon_Compose(), Ui_BuildPairedPatternsToSlot(), Ui_PrepareTransferForItem(), Ui_PrepareTransferFromTableEntry(), UiGlyph_LoadEntryWithPalette(), UiIcon_BuildAbilityIconTiles(), UiIcon_BuildItemIconTiles(), and UiIcon_Decode().

Variable Documentation

◆ gRenderResource_PairSourceTable

const u8* gRenderResource_PairSourceTable[]
extern