windows95 animated cursor file format

ani (windows95 animated cursor file format)

this is a paraphrase of the format. it is essetially just a riff file =
with extensions... (view this monospaced)
this info basically comes from the mmdk (multimedia devkit). i don't =
have it in front of me, so i'm going backwards from a vb program i wrote =
to decode .ani files.

"riff" {length of file}
"list" {length of list}
"inam" {length of title} {data}
"iart" {length of author} {data}
"icon" {length of icon} {data} ; 1st in list
"icon" {length of icon} {data} ; last in list (1 to cframes)
"anih" {length of ani header (36 bytes)} {data} ; (see ani header typedef )
"rate" {length of rate block} {data} ; ea. rate is a long (length is 1 to csteps)
"seq " {length of sequence block} {data} ; ea. seq is a long (length is 1 to csteps)


- any of the blocks ("acon", "anih", "rate", or "seq ") can appear in any
order. i've never seen "rate" or "seq " appear before "anih", though. you
need the csteps value from "anih" to read "rate" and "seq ". the order i
usually see the frames is: "riff", "acon", "list", "inam", "iart", "anih",
"rate", "seq ", "list", "icon". you can see the "list" tag is repeated and
the "icon" tag is repeated once for every embedded icon. the data pulled
from the "icon" tag is always in the standard 766-byte .ico file format.

- all {length of...} are 4byte dwords.

- ani header typedef:

struct taganiheader {
dword cbsizeof; // num bytes in aniheader (36 bytes)
dword cframes; // number of unique icons in this cursor
dword csteps; // number of blits before the animation cycles
dword cx, cy; // reserved, must be zero.
dword cbitcount, cplanes; // reserved, must be zero.
dword jifrate; // default jiffies (1/60th of a second) if rate chunk not present.
dword flags; // animation flag (see af_ constants)
} aniheader;

#define af_icon =3d 0x0001l // windows format icon/cursor animation

r. james houghtaling