Alchemy

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.

FieldDeclared as
scaleXu16 scaleX8.8 fixed point, read signed: negative mirrors the sprite
scaleYu16 scaleY8.8 fixed point, read signed
angleu16 angle1/65536 turns
paddingu16 paddingnever 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.

Line 13

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.

FieldDeclared as
coefficientss16 coefficients[4]pa, pb, pc and pd
rowsu32 rows[2]pa and pb, then pc and pd, written whole when only the diagonal is set.

Used by AffineMatrix_BuildForEffect, gObjAffineMatrices.

Line 22

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.

Line 35

Also, globals without a comment: gObjAffineMatrices.

On this page