Struct(Ase_Error) { String msg; Ase_Error *next; }; Struct(Ase_ErrorList) { u64 count; Ase_Error *first; Ase_Error *last; }; Struct(Ase_Slice) { u32 start; i32 x1; i32 y1; i32 x2; i32 y2; Ase_Slice *next; }; Struct(Ase_SliceKey) { String name; u32 num_slices; Ase_Slice *slice_head; Ase_SliceKey *next; }; Struct(Ase_Span) { String name; u32 start; u32 end; Ase_Span *next; }; Struct(Ase_Frame) { u32 index; u32 x1; u32 y1; u32 x2; u32 y2; f64 duration; Ase_Frame *next; }; Struct(Ase_DecodedImage) { u32 width; u32 height; u32 *pixels; /* Array of [width * height] pixels */ Ase_ErrorList errors; b32 success; }; Struct(Ase_DecodedSheet) { Vec2 image_size; Vec2 frame_size; u32 num_frames; u32 num_spans; u32 num_slice_keys; Ase_Frame *frame_head; Ase_Span *span_head; Ase_SliceKey *slice_key_head; Ase_ErrorList errors; b32 success; }; Ase_DecodedImage ase_decode_image(Arena *arena, String encoded); Ase_DecodedSheet ase_decode_sheet(Arena *arena, String encoded);