Skip to Content
The Alchemy Project

include/window/window_sprite.h

Sprites as OAM takes them, and the window sprites: the characters, icons and portraits a window carries.

Included by menu_internal.h, shop_internal.h, window_internal.h, effect_sprite.h, scene.h, scene_effects.h and window.h.

Structures

NameDescription
structICON_ATTRAn icon sprite's OAM attributes, as OAM lays them out.
structICON_SPRAn icon's sprite: its link in the sprite list and its OAM attributes.
structOAM_DATAAttributes zero through two as the hardware lays them out in OAM, plus the halfword after them.
structQUEUED_SPRA sprite as the depth queue takes it: syOAMAddSpriteAtDepth writes the link to the next sprite queued at the same depth, and the OAM attributes follow.
structWINDOW_SPRA window sprite: a sprite in a window's sprite list (a character, an icon or a portrait), with its VRAM cache slot and OAM attributes.
structWINDOW_SPR_LISTA list of window sprites: its first sprite and the link to append after.

Macros

NameDescription
#defineICON_NONE VRAM_CACHE_ENTRY_COUNTAn icon slot that holds no VRAM cache entry.
#defineOAM_MIRROR_X 8OAM_DATA.matrix's bits for a sprite that is not affine: mirrored left to right, top to bottom.
#defineOAM_MIRROR_Y 16

Functions

NameDescription
Sint32mnWindowSpriteCreateAbilityIcon (struct WINDOW *window, Sint32 x, Sint32 y, Sint32 abilityId)Shows ability abilityId's icon as a 16x16 sprite at (x, y) pixels of window.
static inline QUEUED_SPR *mnWindowSpriteGetSprite (WINDOW_SPR *sprite)The queued sprite of window sprite sprite (WINDOW_SPR.sprite).

Variables

NameDescription
STATIC_ASSERT(offsetof (WINDOW_SPR, sprite.oam)

Description

Sprites as OAM takes them, and the window sprites: the characters, icons and portraits a window carries.

Macros in detail

ICON_NONE

#define ICON_NONE VRAM_CACHE_ENTRY_COUNT

An icon slot that holds no VRAM cache entry.

Referenced by mnItemIconGridDraw(), mnItemIconGridInit(), mnItemIconGridLoadItems() and mnItemIconGridRelease().

Definition at line 13 of file window_sprite.h.

OAM_MIRROR_X

#define OAM_MIRROR_X 8

OAM_DATA.matrix's bits for a sprite that is not affine: mirrored left to right, top to bottom.

Referenced by mnOpenBackdropScreen().

Definition at line 45 of file window_sprite.h.

OAM_MIRROR_Y

#define OAM_MIRROR_Y 16

Definition at line 46 of file window_sprite.h.

Functions in detail

mnWindowSpriteGetSprite

static inline QUEUED_SPR *mnWindowSpriteGetSprite(WINDOW_SPR *sprite)

The queued sprite of window sprite sprite (WINDOW_SPR.sprite).

Referenced by fdWindowSpriteListMove(), mnGlyphAddBlankSprite(), mnGlyphDraw(), mnGlyphDrawAsSprite(), mnWindowPutGlyph() and mnWindowSpriteUpdateScaleAnimation().

Definition at line 97 of file window_sprite.h.

Variables in detail

offsetof

STATIC_ASSERT(offsetof(WINDOW_SPR, sprite.oam)

Definition at line 116 of file window_sprite.h.