Skip to Content
The Alchemy Project

src/menu/menu_djinn_figures.c

DjinnFigures: the row of four figures the Status and Djinn menus show, placed by an event and eased in and out. More…

Included by menu.c.

Macros

NameDescription
#defineFIGURE_START_X 16Where a new row's figures stand until their screen places them: the top row's at (FIGURE_START_X, TOP_ROW_START_Y), the bottom row's at FIGURE_START_X, parked below the screen (MENU_FIGURE_HIDDEN_Y).
#defineTOP_ROW_START_Y 32
#defineDJINN_FIGURES_DEFINE_RELEASE (name, update)Releases the four sprites and removes their event.
#defineFIGURE_FULL_SCALE ((Uint32)toFIXED(1))The figures' full size, and the height they are placed from: 482 pixels.
#defineFIGURE_ORIGIN_Y toFIXED(482)
#defineFIGURE_WEST_FLAG 0x8000The bit of a figure's y that mnDjinnFiguresSetSlotPos sets to turn it west.

Functions

NameDescription
voidmnDjinnFiguresInitTopRow (void *window, Sint32 unused)Puts up the top row, the Status screen's: one walking Djinni figure of each element (DjinnFiguresSpriteIds), in place of any figures there, placed each tick by mnDjinnFiguresUpdateAllPositions.
voidmnDjinnFiguresUpdateAllPositions (void)Event while the top row is up: places its four figures at full size where the screen has put them.
voidmnDjinnFiguresUpdateBottomRow (void)Event while the bottom row is up: places its figures at their fixed scale or growing toward full size, facing south, or west for a figure whose y carries FIGURE_WEST_FLAG (mnDjinnFiguresSetSlotPos).
voidmnDjinnFiguresInitBottomRow (Sint32 window, Sint32 unused)Puts up the bottom row, the Djinn menu's: one walking Djinni figure of each element at full size, in place of any there, parked below the screen until the menu moves one.
Sint32mnDjinnFiguresSetSlotPos (Sint32 index, Sint32 x, Sint32 y, Sint32 negative)Places figure index at (x, y).
Sint32mnDjinnFiguresSetSlotPhase (Sint32 index, FIXED phase)Sets figure index's scale phase (16.16): negative for a fixed scale of -phase, otherwise the scale it grows from toward full size.
Sint32mnDjinnFiguresReplaceSlot (Sint32 index, Sint32 element, Sint32 animation)Makes figure index the Djinni figure of element (DjinnFiguresSpriteIds) playing animation.
voidmnStartPartyFiguresStanding (void)Has each party figure stand (ANIM_STAND).

Description

DjinnFigures: the row of four figures the Status and Djinn menus show, placed by an event and eased in and out. Part of menu.c.

Macros in detail

FIGURE_START_X

#define FIGURE_START_X 16

Where a new row's figures stand until their screen places them: the top row's at (FIGURE_START_X, TOP_ROW_START_Y), the bottom row's at FIGURE_START_X, parked below the screen (MENU_FIGURE_HIDDEN_Y).

Referenced by mnDjinnFiguresInitBottomRow() and mnDjinnFiguresInitTopRow().

Definition at line 9 of file menu_djinn_figures.c.

TOP_ROW_START_Y

#define TOP_ROW_START_Y 32

Referenced by mnDjinnFiguresInitTopRow().

Definition at line 10 of file menu_djinn_figures.c.

DJINN_FIGURES_DEFINE_RELEASE

#define DJINN_FIGURES_DEFINE_RELEASE(name, update)

Releases the four sprites and removes their event.

Definition at line 47 of file menu_djinn_figures.c.

FIGURE_FULL_SCALE

#define FIGURE_FULL_SCALE ((Uint32)toFIXED(1))

The figures' full size, and the height they are placed from: 482 pixels.

Referenced by mnDjinnFiguresUpdateAllPositions().

Definition at line 69 of file menu_djinn_figures.c.

FIGURE_ORIGIN_Y

#define FIGURE_ORIGIN_Y toFIXED(482)

Referenced by mnDjinnFiguresUpdateAllPositions() and mnDjinnFiguresUpdateBottomRow().

Definition at line 70 of file menu_djinn_figures.c.

FIGURE_WEST_FLAG

#define FIGURE_WEST_FLAG 0x8000

The bit of a figure's y that mnDjinnFiguresSetSlotPos sets to turn it west.

Referenced by mnDjinnFiguresUpdateBottomRow().

Definition at line 72 of file menu_djinn_figures.c.

Functions in detail

mnDjinnFiguresInitTopRow

void mnDjinnFiguresInitTopRow(void *window, Sint32 unused)

Puts up the top row, the Status screen's: one walking Djinni figure of each element (DjinnFiguresSpriteIds), in place of any figures there, placed each tick by mnDjinnFiguresUpdateAllPositions.

References DjinnFiguresSpriteIds, fdSpriteCreateStub(), fdSpriteDestroyStub(), fdSpriteStartAnimationStub(), mnDjinnFiguresUpdateAllPositions(), Sint32, state and sySetEvent().

Referenced by mnStatusScreenRun().

Definition at line 15 of file menu_djinn_figures.c.

mnDjinnFiguresUpdateAllPositions

void mnDjinnFiguresUpdateAllPositions(void)

Event while the top row is up: places its four figures at full size where the screen has put them.

References fdRenderApplyProjectedPlacementStub(), Sint32 and state.

Referenced by mnDjinnFiguresInitTopRow().

Definition at line 76 of file menu_djinn_figures.c.

mnDjinnFiguresUpdateBottomRow

void mnDjinnFiguresUpdateBottomRow(void)

Event while the bottom row is up: places its figures at their fixed scale or growing toward full size, facing south, or west for a figure whose y carries FIGURE_WEST_FLAG (mnDjinnFiguresSetSlotPos).

References fdRenderApplyProjectedPlacementStub(), mnPageArrowsDrawStub() and Sint32.

Referenced by mnDjinnFiguresInitBottomRow().

Definition at line 110 of file menu_djinn_figures.c.

mnDjinnFiguresInitBottomRow

void mnDjinnFiguresInitBottomRow(Sint32 window, Sint32 unused)

Puts up the bottom row, the Djinn menu's: one walking Djinni figure of each element at full size, in place of any there, parked below the screen until the menu moves one.

References DjinnFiguresSpriteIds, fdSpriteCreateStub(), fdSpriteDestroyStub(), fdSpriteStartAnimationStub(), mnDjinnFiguresUpdateBottomRow(), Sint32, state and sySetEvent().

Referenced by mnDjinnMenuRun().

Definition at line 160 of file menu_djinn_figures.c.

mnDjinnFiguresSetSlotPos

Sint32 mnDjinnFiguresSetSlotPos(Sint32 index, Sint32 x, Sint32 y, Sint32 negative)

Places figure index at (x, y). With negative set, y keeps its low bits and is marked negative from bit 15 up, and the bottom row faces that figure west; no caller sets it. Returns where figureY[index] lies in the menu state, or index when there is no figure.

References Sint32 and state.

Referenced by mnDjinnMenuRunPreview(), mnDjinnMenuRunScreen(), mnDjinnMenuSelectDjinn() and mnDjinnMenuShowMemberStatus().

Definition at line 193 of file menu_djinn_figures.c.

mnDjinnFiguresSetSlotPhase

Sint32 mnDjinnFiguresSetSlotPhase(Sint32 index, FIXED phase)

Sets figure index's scale phase (16.16): negative for a fixed scale of -phase, otherwise the scale it grows from toward full size.

References Sint32.

Referenced by mnDjinnMenuRunPreview() and mnDjinnMenuSelectDjinn().

Definition at line 209 of file menu_djinn_figures.c.

mnDjinnFiguresReplaceSlot

Sint32 mnDjinnFiguresReplaceSlot(Sint32 index, Sint32 element, Sint32 animation)

Makes figure index the Djinni figure of element (DjinnFiguresSpriteIds) playing animation. Returns 1.

References DjinnFiguresSpriteIds, fdSpriteCreateStub(), fdSpriteDestroyStub(), fdSpriteStartAnimationStub(), Sint32 and state.

Referenced by mnDjinnMenuSelectDjinn().

Definition at line 219 of file menu_djinn_figures.c.

mnStartPartyFiguresStanding

void mnStartPartyFiguresStanding(void)

Has each party figure stand (ANIM_STAND). Nothing calls it.

References fdSpriteStartAnimationStub() and Sint32.

Definition at line 243 of file menu_djinn_figures.c.