Skip to Content
The Alchemy Project

src/system/system_oam.c

The tick's sprite lists: affine matrices and depth slots. More…

Included by system.c.

Enumerations

NameDescription
enumanonymous enum { OBJ_AFFINE_MATRIX_COUNT, RENDER_DEPTH_SLOT_COUNT }

Functions

NameDescription
voidsyOAMResetTick (void)Starts a new tick of sprites: frees the affine matrices and clears the masks of the depth slots sprites are linked into, a bit a slot.
Sint32syOAMMatrixAllocateFromTransform (AFFINE_TRANSFORM *src)Hands out the next OAM affine matrix for a sprite drawn with src's scale and rotation and fills it in.
voidsyOAMAddSpriteAtDepthClamped (void *entry, Sint32 slot)As syOAMAddSpriteAtDepth, with the depth clamped below OAM_DEPTH_WINDOW, so that the sprite stays behind the windows' sprites.
voidsyOAMAddSpriteAtDepth (void *entry, Sint32 slot)Links a sprite entry at the head of depth slot slot's list (clamped to the RENDER_DEPTH_SLOT_COUNT slots) for this tick, and marks the slot taken.

Description

The tick's sprite lists: affine matrices and depth slots. Part of system.c.

Enumerations in detail

anonymous enum

enum { OBJ_AFFINE_MATRIX_COUNT, RENDER_DEPTH_SLOT_COUNT }

EnumeratorValueDescription
OBJ_AFFINE_MATRIX_COUNT32the OAM's rotation-scaling matrices
RENDER_DEPTH_SLOT_COUNT256depth slots a sprite is linked into

Definition at line 3 of file system_oam.c.

Functions in detail

syOAMResetTick

void syOAMResetTick(void)

Starts a new tick of sprites: frees the affine matrices and clears the masks of the depth slots sprites are linked into, a bit a slot.

References OamDepthMasks and OamMatrixCount.

Referenced by sySynch().

Definition at line 11 of file system_oam.c.

syOAMMatrixAllocateFromTransform

Sint32 syOAMMatrixAllocateFromTransform(AFFINE_TRANSFORM *src)

Hands out the next OAM affine matrix for a sprite drawn with src's scale and rotation and fills it in. Returns the matrix number, or the last (OBJ_AFFINE_MATRIX_COUNT - 1) when all are taken.

References OamMatrices, OamMatrixCount, Sint32, syCos(), syIntegerDivide() and sySin().

Referenced by fdEffectSpriteDraw(), fdHangingVineDraw(), fdRenderApplyProjectedPlacement(), fdRenderApplyProjectedPlacementAtDepth(), fdRopeDraw(), fdTightropeDraw(), mnBattleCommandRowRun(), mnBattleTargetRunSelection(), mnIconMenuDrawIcons(), mnSelectionMenuDraw(), mnWindowSpritePulse(), mnWindowSpriteUpdateAll(), mnWindowSpriteUpdateScaleAnimation(), scGabombaStatueDrawClock(), scGabombaStatueDrawRaisedBlocks() and scShamanVillageUpdateLettering().

Definition at line 20 of file system_oam.c.

syOAMAddSpriteAtDepthClamped

void syOAMAddSpriteAtDepthClamped(void *entry, Sint32 slot)

As syOAMAddSpriteAtDepth, with the depth clamped below OAM_DEPTH_WINDOW, so that the sprite stays behind the windows' sprites.

References OamDepthLists, OamDepthMasks and Sint32.

Referenced by btGeyserDraw(), fdBlankOverlayDrawMarks(), fdEffectSpriteDraw(), fdEffectUpdateSparkles(), fdFadeOverlayDrawMarks(), fdGroundParticlesUpdate(), fdHangingVineDraw(), fdMapScreenUpdateMarkers(), fdMotesUpdate(), fdRenderApplyProjectedPlacement(), fdRenderPlaceProjectedSprite(), fdRisingParticlesUpdate(), fdRopeDraw(), fdTightropeDraw(), fdWeatherUpdateRain(), mnEndingImageDrawStrips(), mnTitleShowTitleScreen(), scAnkohlRuinsDrawSand(), scAquaRockInsideDrawPillars(), scAquaRockInsideDrawSplashes(), scGabombaStatueDrawClock(), scGabombaStatueDrawRaisedBlocks(), scGaugeUpdate(), scLightSpritesDraw(), scLohoFireCannon(), scMarsLighthouseEntranceDrawHoleMask(), scNorthernReachesShatterIceWall() and scTitleUpdateSpriteReveal().

Definition at line 78 of file system_oam.c.

syOAMAddSpriteAtDepth

void syOAMAddSpriteAtDepth(void *entry, Sint32 slot)

Links a sprite entry at the head of depth slot slot's list (clamped to the RENDER_DEPTH_SLOT_COUNT slots) for this tick, and marks the slot taken.

References OamDepthLists, OamDepthMasks and Sint32.

Referenced by btMessageWaitForAdvance(), btMessageWaitForAdvanceAt(), btPlaybackRun(), fdGroundParticlesDraw(), fdRenderApplyProjectedPlacementAtDepth(), mnArrowSetPos(), mnBattleCommandRowRun(), mnBattleDjinnMenuRun(), mnBattleItemMenuRun(), mnBattleMenuUpdateEachTick(), mnBattlePsynergyMenuRun(), mnBattleStatusScreenRun(), mnBattleSummonMenuRun(), mnBattleTargetRunSelection(), mnDjinnShowJoinedMessage(), mnIconMenuDrawIcons(), mnIconPushSlots(), mnItemIconGridDraw(), mnPartyShowJoinedMessage(), mnPartyShowPairJoinedMessage(), mnSelectionMenuDraw(), mnSelectionMenuDrawArrow(), mnWindowSpriteUpdateAll(), scApojiiIslandsDrawMetatileMarkers(), scAquaRockDrawFallingBubbles(), scAquaRockDrawRisingBubbles(), scShamanVillageUpdateLettering(), scTrialRoadDrawFountains() and scTrialRoadDrawRaceMap().

Definition at line 112 of file system_oam.c.