Skip to Content
The Alchemy Project

src/window/window_icons.c

Item, Psynergy and command icons. More…

Included by window.c.

Functions

NameDescription
Sint32mnIconCountItemIcons (void)Returns how many item icons the icon table holds; mnIconBuildItemIconTiles draws icon 0 for a number past them.
Sint32mnIconCountPsynergyIcons (void)Returns how many Psynergy icons the icon table holds; mnIconBuildAbilityIconTiles draws icon 0 for a number past them.
voidmnIconBuildCommandIconTiles (Sint32 overlayIcon, Sint32 frame, Sint32 *slot, Sint32 *tileOut, Sint32 reuse)Builds a command's icon, its picture over one of the frames (ICON_FRAME), and loads it into a sprite tile slot: *slot, or a free one when reuse is 0.
voidmnAbilityBuildItemIconTiles ( Sint32 action, Sint32 withBase, Sint32 *slot, Sint32 *tile, Sint32 reuse)Unused: builds an ability's icon from the item icons rather than the Psynergy icons, as mnIconBuildItemIconTiles.
voidmnIconBuildItemIconTiles (Uint32 icon, Sint32 withBase, Sint32 *cacheSlot, Sint32 *tileOut, Sint32 reuse)Builds item icon number icon, over the item frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
Sint32mnItemIconCompose (Uint32 code, Uint32 layers)Draws an item's icon into the glyph transfer buffer from its inventory code (INVENTORY_ENCODING) with the layers asked for (ICON_ flags): the frame, the equipped, broken and cursed marks, and the count.
Sint32mnItemIconLoadLayersIntoSlot (Sint32 inventoryCode, Sint32 layers, Sint32 cacheSlot)Draws an item's icon from its inventory code with the layers asked for (mnItemIconCompose) and loads it into sprite tile slot cacheSlot.
Sint32mnIconBuildMiscellaneousIconTiles (Sint32 icon, Sint32 unused, Sint32 cacheSlot)Builds one of the other icons (IconMiscellaneousIconPointers) and loads it into sprite tile slot cacheSlot.
Sint32mnTitleLoadFirstTile (Uint32 entry, Sint32 unused, Uint32 slot)Loads 32 bytes, one sprite tile, from the start of MenuTitlePictures into the VRAM cache entry slot, whichever entry is asked for: those bytes are the table's first pointers, not a picture.
voidmnIconDrawItem (Sint32 code)Draws an item's icon from its inventory code into the glyph transfer buffer, with no frame or marks; code 0 draws icon 0.
voidmnAbilityBuildIconTiles ( Sint32 action, Sint32 withBase, Sint32 *slot, Sint32 *tile, Sint32 reuse)Builds an ability's Psynergy icon, as mnIconBuildAbilityIconTiles.
voidmnIconBuildAbilityIconTiles (Uint32 icon, Sint32 withBase, Sint32 *cacheSlot, Sint32 *tileOut, Sint32 reuse)Builds Psynergy icon number icon, over the item frame when withBase is set, and loads it into *cacheSlot (a free slot unless reuse is set).
voidmnIconDrawMiscellaneous (Uint32 iconIndex)Draws one of the other icons into the glyph transfer buffer.
voidmnIconLoadWithPalette (Uint32 icon, Sint32 unused, Sint32 *slot, Sint32 *tile, Sint32 palette, Sint32 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.
voidmnIconReservedNoOperation (void)Unused: an empty function among the icon builders.
voidmnIconDecode (ICON_TRANSFER *glyph, Sint32 overlay)Decodes a compressed icon into the glyph buffer and expands it to tiles: opaque for the first layer, or drawn over what is there when overlay is set.

Description

Item, Psynergy and command icons. Part of window.c.

Functions in detail

mnIconCountItemIcons

Sint32 mnIconCountItemIcons(void)

Returns how many item icons the icon table holds; mnIconBuildItemIconTiles draws icon 0 for a number past them.

References ItemIcons, ItemIconsEnd and Sint32.

Referenced by mnIconBuildItemIconTiles().

Definition at line 9 of file window_icons.c.

mnIconCountPsynergyIcons

Sint32 mnIconCountPsynergyIcons(void)

Returns how many Psynergy icons the icon table holds; mnIconBuildAbilityIconTiles draws icon 0 for a number past them.

References PsynergyIcons, PsynergyIconsEnd and Sint32.

Referenced by mnIconBuildAbilityIconTiles().

Definition at line 16 of file window_icons.c.

mnIconBuildCommandIconTiles

void mnIconBuildCommandIconTiles(Sint32 overlayIcon, Sint32 frame, Sint32 *slot, Sint32 *tileOut, Sint32 reuse)

Builds a command's icon, its picture over one of the frames (ICON_FRAME), and loads it into a sprite tile slot: *slot, or a free one when reuse is 0.

References IconBasePointerTable, IconOverlayPointerTable, mnIconDecode(), Sint32, state, syHeapSlotAllocate(), syHeapSlotRelease(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().

Referenced by mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot(), mnSelectionMenuHighlightIcon(), mnSelectionMenuRedrawIcon(), mnSelectionMenuSetupIcon() and mnWindowSpriteCreateOverlaidIcon().

Definition at line 23 of file window_icons.c.

mnAbilityBuildItemIconTiles

void mnAbilityBuildItemIconTiles( Sint32 action, Sint32 withBase, Sint32 *slot, Sint32 *tile, Sint32 reuse)

Unused: builds an ability's icon from the item icons rather than the Psynergy icons, as mnIconBuildItemIconTiles.

References gmAbilityGetDefinitionStub(), mnIconBuildItemIconTiles() and Sint32.

Definition at line 50 of file window_icons.c.

mnIconBuildItemIconTiles

void mnIconBuildItemIconTiles(Uint32 icon, Sint32 withBase, Sint32 *cacheSlot, Sint32 *tileOut, Sint32 reuse)

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

References IconBasePointerTable, ItemIcons, mnIconCountItemIcons(), mnIconDecode(), Sint32, state, syHeapSlotAllocate(), syHeapSlotRelease(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().

Referenced by mnAbilityBuildItemIconTiles(), mnDebugBrowserIcons() and mnSelectionMenuSetupIcon().

Definition at line 59 of file window_icons.c.

mnItemIconCompose

Sint32 mnItemIconCompose(Uint32 code, Uint32 layers)

Draws an item's icon into the glyph transfer buffer from its inventory code (INVENTORY_ENCODING) with the layers asked for (ICON_ flags): the frame, the equipped, broken and cursed marks, and the count. Returns -1 with no glyph transfer buffer and 256 otherwise; no caller reads the result.

References gmItemGetDefinitionStub(), IconBasePointerTable, IconDigitPointers, IconMarkPointers, ItemIcons, mnIconDecode(), Sint32 and state.

Referenced by mnItemIconLoadIntoSlot() and mnItemIconLoadLayersIntoSlot().

Definition at line 100 of file window_icons.c.

mnItemIconLoadLayersIntoSlot

Sint32 mnItemIconLoadLayersIntoSlot(Sint32 inventoryCode, Sint32 layers, Sint32 cacheSlot)

Draws an item's icon from its inventory code with the layers asked for (mnItemIconCompose) and loads it into sprite tile slot cacheSlot.

References mnItemIconCompose(), Sint32, state, syHeapSlotAllocate(), syHeapSlotRelease() and syVRAMCacheLoad().

Referenced by mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot() and mnWindowSpriteCreateLoaded().

Definition at line 183 of file window_icons.c.

mnIconBuildMiscellaneousIconTiles

Sint32 mnIconBuildMiscellaneousIconTiles(Sint32 icon, Sint32 unused, Sint32 cacheSlot)

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

References mnIconDrawMiscellaneous(), Sint32, state, syHeapSlotAllocate(), syHeapSlotRelease() and syVRAMCacheLoad().

Referenced by mnDebugBrowserIcons() and mnSelectionIconLoadIntoSlot().

Definition at line 198 of file window_icons.c.

mnTitleLoadFirstTile

Sint32 mnTitleLoadFirstTile(Uint32 entry, Sint32 unused, Uint32 slot)

Loads 32 bytes, one sprite tile, from the start of MenuTitlePictures into the VRAM cache entry slot, whichever entry is asked for: those bytes are the table's first pointers, not a picture.

References MenuTitlePictures, Sint32 and syVRAMCacheLoad().

Referenced by mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot() and mnWindowSpriteCreateFromTable().

Definition at line 213 of file window_icons.c.

mnIconDrawItem

void mnIconDrawItem(Sint32 code)

Draws an item's icon from its inventory code into the glyph transfer buffer, with no frame or marks; code 0 draws icon 0. The caller holds the buffer.

References glyph, gmItemGetDefinitionStub(), ItemIcons, mnIconDecode() and Sint32.

Referenced by gmItemLoadIcon(), scColossoShowItemIcon(), scCottageRoomsBShowMythrilBag(), scFloatNut(), scImilFuchinFallsPlaceDragonsEye(), scInit(), scKalayPrepareTown(), scSanctumRaiseItemIcon(), scShipRoomsPlaceAnchorCharm(), scSolSanctumElementalStarRoomPresentStarFX(), scSolSanctumEruptionPlayWiseOneRescue() and scVaultPlaceItemIcon().

Definition at line 234 of file window_icons.c.

mnAbilityBuildIconTiles

void mnAbilityBuildIconTiles( Sint32 action, Sint32 withBase, Sint32 *slot, Sint32 *tile, Sint32 reuse)

Builds an ability's Psynergy icon, as mnIconBuildAbilityIconTiles.

References gmAbilityGetDefinitionStub(), mnIconBuildAbilityIconTiles() and Sint32.

Referenced by mnAbilityIconLoadIntoSlot(), mnBattlePsynergyMenuRun(), mnBattleSummonMenuRun(), mnSelectionIconLoad(), mnSelectionIconLoadIntoSlot() and mnSelectionMenuSetupIcon().

Definition at line 254 of file window_icons.c.

mnIconBuildAbilityIconTiles

void mnIconBuildAbilityIconTiles(Uint32 icon, Sint32 withBase, Sint32 *cacheSlot, Sint32 *tileOut, Sint32 reuse)

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

References IconBasePointerTable, mnIconCountPsynergyIcons(), mnIconDecode(), PsynergyIcons, Sint32, state, syHeapSlotAllocate(), syHeapSlotRelease(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().

Referenced by mnAbilityBuildIconTiles() and mnDebugBrowserIcons().

Definition at line 263 of file window_icons.c.

mnIconDrawMiscellaneous

void mnIconDrawMiscellaneous(Uint32 iconIndex)

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

References glyph, IconMiscellaneousIconPointers and mnIconDecode().

Referenced by mnIconBuildMiscellaneousIconTiles() and mnStatusIconLoadIntoSlot().

Definition at line 301 of file window_icons.c.

mnIconLoadWithPalette

void mnIconLoadWithPalette(Uint32 icon, Sint32 unused, Sint32 *slot, Sint32 *tile, Sint32 palette, Sint32 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.

References mnIconDecode(), Sint32, state, syDMAXCopy(), syHeapSlotAllocate(), syHeapSlotRelease(), syResourceGetTableEntry(), syVRAMCacheFindFreeEntry() and syVRAMCacheLoad().

Referenced by mnDebugBrowserPortraits(), mnDjinnShowJoinedMessage(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnPortraitCreate(), mnPortraitLoad() and mnPortraitReload().

Definition at line 314 of file window_icons.c.

mnIconReservedNoOperation

void mnIconReservedNoOperation(void)

Unused: an empty function among the icon builders.

Definition at line 352 of file window_icons.c.

mnIconDecode

void mnIconDecode(ICON_TRANSFER *glyph, Sint32 overlay)

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

References glyph, HeapSlots, mnTileDecompress4bpp, mnTileExpandMasked, mnTileExpandOpaque, Sint32, syHeapSlotRelease(), TileDecompress4bppCodeSize, TileExpandMaskedCodeSize and TileExpandOpaqueCodeSize.

Referenced by mnIconBuildAbilityIconTiles(), mnIconBuildCommandIconTiles(), mnIconBuildItemIconTiles(), mnIconDrawItem(), mnIconDrawMiscellaneous(), mnIconLoadWithPalette() and mnItemIconCompose().

Definition at line 358 of file window_icons.c.