Alchemy
Loading...
Searching...
No Matches

render.c File Reference

The frame's sprite lists: affine matrices, depth slots and the OAM build. More...

Go to the source code of this file.

Typedefs

typedef void(*) OamBuildRoutine(void *work)

Enumerations

enum  { OBJ_AFFINE_MATRIX_COUNT = 32 , RENDER_DEPTH_SLOT_COUNT = 256 }

Functions

void Render_ResetFrame (void)
 Starts a new frame of sprites: frees the affine matrices and empties the 256 depth slots sprites are linked into.
s32 AffineMatrix_BuildForEffect (struct AffineTransform *source)
 Hands out the next OAM affine matrix for a sprite drawn with source's scale and rotation and fills it in.
void Runtime_PushSlotEntry (void *slotEntry, s32 slot)
 Links a sprite entry into depth slot slot (clamped to 0..255) for this frame.
void Render_BuildOamList (void *work)
 Builds this frame's OAM list in work from the sprites linked into the depth slots, with a RAM copy of the ARM builder.

Variables

u8 IwramClearWords []

Detailed Description

The frame's sprite lists: affine matrices, depth slots and the OAM build.

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

Definition in file render.c.

Typedef Documentation

◆ OamBuildRoutine

typedef void(*) OamBuildRoutine(void *work)

Definition at line 18 of file render.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
OBJ_AFFINE_MATRIX_COUNT 
RENDER_DEPTH_SLOT_COUNT 

Definition at line 20 of file render.c.

Function Documentation

◆ Render_ResetFrame()

void Render_ResetFrame ( void )

Starts a new frame of sprites: frees the affine matrices and empties the 256 depth slots sprites are linked into.

Called by WaitFrames after each VBlank.

Definition at line 12 of file render.c.

Referenced by Render_ResetFrame(), System_GetLanguage(), and WaitFrames().

◆ AffineMatrix_BuildForEffect()

s32 AffineMatrix_BuildForEffect ( struct AffineTransform * source)

Hands out the next OAM affine matrix for a sprite drawn with source's scale and rotation and fills it in.

Called by the field sprites and the windows' scaled sprites. Returns the matrix number, 0 to 31. When all 32 are taken it fills nothing and still returns 0, which a caller cannot tell from matrix 0: the sprite is drawn with whatever matrix 0 holds.

Definition at line 27 of file render.c.

Referenced by AffineEffect_UpdateFrame(), AffineMatrix_BuildForEffect(), BattleTarget_RunSelection(), Colosso_UpdateLettering(), Menu_RunCommandRow(), Render_ApplyProjectedPlacement(), Render_PlaceProjectedSprite(), RenderOutput_UpdateScaleAnimation(), SelectionScreen_Draw(), System_GetLanguage(), Ui_ApplyTableScaleToObject(), and UiWork_AnimateSpriteSlots().

◆ Runtime_PushSlotEntry()

◆ Render_BuildOamList()

void Render_BuildOamList ( void * work)

Builds this frame's OAM list in work from the sprites linked into the depth slots, with a RAM copy of the ARM builder.

Called by WaitFrames into the frame scratch heap slot.

Definition at line 96 of file render.c.

Referenced by Render_BuildOamList(), System_GetLanguage(), and WaitFrames().

Variable Documentation

◆ IwramClearWords

u8 IwramClearWords[]
extern

Referenced by Render_ResetFrame().