affine.h
games/tbs/include/affine.h on GitHub
Structures
AffineTransform
struct AffineTransform
A sprite's rotation and scale: scales in 8.8 fixed point (0x100 is full size), the angle in 1/65536 turns.
| Field | Declared as | |
|---|---|---|
scaleX | u16 scaleX | 8.8 fixed point, read signed: negative mirrors the sprite |
scaleY | u16 scaleY | 8.8 fixed point, read signed |
angle | u16 angle | 1/65536 turns |
padding | u16 padding | never read; keeps the struct 8 bytes |
Used by AffineEffect_UpdateFrame, AffineMatrix_BuildForEffect, BattleTarget_RunSelection, Colosso_UpdateLettering, RenderOutput_UpdateScaleAnimation, Render_ApplyProjectedPlacement, Render_PlaceProjectedSprite, UiWork_AnimateSpriteSlots, Ui_ApplyTableScaleToObject.
Unions
AffineMatrix
union AffineMatrix
One OAM rotation-scaling matrix: pa, pb, pc and pd in 8.8 fixed point, the inverse of the transform the sprite is drawn with.
| Field | Declared as | |
|---|---|---|
coefficients | s16 coefficients[4] | pa, pb, pc and pd |
rows | u32 rows[2] | pa and pb, then pc and pd, written whole when only the diagonal is set. |
Used by AffineMatrix_BuildForEffect, gObjAffineMatrices.
Globals
gObjAffineCount
extern u8 gObjAffineCount
The matrices handed out this frame (up to 32), copied into OAM with the sprites
Used by AffineMatrix_BuildForEffect, Render_ResetFrame.
Also, globals without a comment: gObjAffineMatrices.