Skip to main content

Module anim

Module anim 

Source
Expand description

Methods for reading animated characters out of anim.mul/anim.idx

Animations are stored as a sequence of frames, with offsets. Inside these frames, a sequence rows. Rows store their offsets, allowing for compact representations of the data

The underlying raw data for AnimationGroup is defined as |palette:[u16..256]|frame_count:u32|frame_offsets:[u32..frame_count]|frames:[frame..frame_count]|

Frame offsets are read from the end of the palette to find individual frames

The raw frame is defined as

|image_center_x:i16|image_center_y:i16|width:u16|height:u16|rows:[row..?]|

Each row has a header, which either contains offset information and length, or a special stop value of 0x7FFF7FFF

|header:u32|pixels:[u8..?]|

Structsยง

AnimFrame
A frame of an animtion
AnimGroup
An animation sequence
AnimReader
A struct to allow reading of animations from data muls
Row
A single row of a frame