1#ifndef ALCHEMY_ANIMSPR_H
2#define ALCHEMY_ANIMSPR_H
SpriteColorMode
AnimationEntry.param: how Render_DecodeFrame colours a layer's pixels.
@ SPRITE_COLOR_BGR
red and blue swapped
@ SPRITE_COLOR_BLACK
solid colour 1, black
@ SPRITE_COLOR_WHITE
solid colour 15, white
@ SPRITE_COLOR_RED_TINT
red raised to full
@ SPRITE_COLOR_GRB
red and green swapped
@ SPRITE_COLOR_GREEN_TINT
green raised to full
@ SPRITE_COLOR_HIDDEN
solid colour 0, transparent
@ SPRITE_COLOR_GBR
red to blue, green to red, blue to green
@ SPRITE_COLOR_FILL
solid gDecodeFillByte
@ SPRITE_COLOR_BRG
red to green, green to blue, blue to red
@ SPRITE_COLOR_BLUE_TINT
blue raised to full
@ SPRITE_COLOR_RBG
green and blue swapped
@ SPRITE_COLOR_GREY
greyscale
The edition's language, for C to compare (LANGUAGE == LANGUAGE_GERMAN).
A sprite's screen position and scale.
STATIC_ASSERT, a compile-time check that emits nothing.
#define STATIC_ASSERT(condition)
C89 permits repeated extern declarations of the same array.
#define offsetof(type, member)
One animation layer of a sprite: its animation id, frames, running script and timer.
u8 frameBase
frame the script chose, before facing; 255 blank
u8 param
SpriteColorMode its pixels are drawn with; 0 when taken.
u8 pos
byte offset of the next command in script
u8 ** scripts
the metadata's command scripts, one per animation number
u8 step
taken off timer each frame; 16 is normal speed
u8 * script
the running script; null when stopped (ANIM_CMD_END)
u8 kind
The facing table its frames follow (from the metadata, or ANIM_CMD_SET_KIND); zero marks a free layer...
s16 animId
the sprite id whose metadata and frames it uses
u8 mode
frame codec: 1 type-01, 3 LZ, anything else raw
void ** frames
frame pointers, from the metadata or a resource slot
u16 timer
Time left on the current frame in sixteenths of a frame, read signed: each timed command adds its arg...
u8 frame
frame shown, frameBase plus the facing offset; 255 none
u8 priority
drawing order 0 to 3 among the layers; above 3 not drawn
An animated sprite: its image and shadow, scale, rotation, size and up to four animation layers.
struct AnimationSpritePart shadow
struct AnimationSpritePart image
u16 rotation
1/65536 turns
u8 flags
bits: 1 outlined in ObjectSystemWork's edge and fill colours | 0 shadow drawn (set when created)
u8 width
pixels; zero marks a free sprite
u8 lastNo
The animation number last selected, which selecting again skips.
u8 slot
VRAM cache entry holding its tiles.
struct AnimationEntry * entries[4]
its layers; empty ones null
u8 count
layers in use, up to the last one present
u8 useOwnScale
Drawn at its own scale, not scaled by distance (fixed camera).
u8 unk1d2
not named by TBS code
s32 scale
16.16 fixed point, 0x10000 full size
u8 retainCacheEntry
Keeps the VRAM cache entry when it is released or off screen.
u8 dirty
nonzero redraws its pixels into VRAM when next drawn
The hardware sprite attributes one part of an animated sprite (its image or its shadow) is drawn with...
u16 fullColor
256 colours; set for both parts when created
u8 unk0a[2]
zero when created; not named by TBS code
u16 y
The OAM entry's attributes 0 to 2.
u8 unk00[4]
The link to the next part queued in the same depth slot this frame (Runtime_PushSlotEntry).
u16 tile
first sprite tile in VRAM
u16 affine
0 plain, 1 affine, 3 affine at double size
u16 affineIndex
affine matrix, or 8 for a mirrored plain sprite
u16 priority
2 when created
The object system's work: the flag that suspends sprite projection, the outline's edge and fill colou...
u16 used
sprite pixel bytes composed since the camera reset it
struct ResourceSlot slots[8]
u8 unk02[2]
not named by TBS code
u8 fill
outline fill colour; 0 when the field sets up
s16 suspended
nonzero while a menu has suspended sprite projection
s32 count
sprite group tables taken from unk08
u8 edge
outline edge colour; 15 when the field sets up
u8 unk08[0x10]
the sprite group tables, taken in turn by count
A resource slot: the tag of the animation loaded into it (slot number and animation id) and the buffe...
s32 tag
(slot << 12) | animation id
void * buffer
the decoded frames, their offsets made pointers
The integer types, TRUE, UNUSED and the fixed-address macros.