After the frame header come the chunks that make up the
frame. First comes a color chunk if the color map has changed
from the last frame. Then comes a pixel chunk if the pixels have
changed. If the frame is absolutely identical to the last frame
there will be no chunks at all.
FLI_COLOR Chunks
The first word is the number of packets in this chunk. This
is followed directly by the packets. The first byte of a packet
says how many colors to skip. The next byte says how many colors
to change. If this byte is zero it is interpreted to mean 256.
Next follows 3 bytes for each color to change (one each for red,
green and blue).
FLI_LC Chunks
This is the most common, and alas, most complex chunk. The
first word (16 bits) is the number of lines starting from the top
of the screen that are the same as the previous frame. (For
example, if there is motion only on the bottom line of screen
you'd have a 199 here.) The next word is the number of lines
that do change. Next there is the data for the changing lines
themselves. Each line is compressed individually; among other
things this makes it much easier to play back the FLI at a
reduced size.
skip_count
size_count
data
FLI_BLACK Chunks
These are very simple. There is no data associated with
them at all. In fact they are only generated for the first frame
in Autodesk Animator after the user selects NEW under the FLIC
menu.
FLI_BRUN Chunks
These are much like FLI_LC chunks without the skips. They
start immediately with the data for the first line, and go line-
by-line from there. The first byte contains the number of
packets in that line. The format for a packet is:
size_count
data
FLI_COPY Chunks
These are 64000 bytes of data for direct reading onto the
screen.
-----------------------------------------------------------------------
And here's the PRO extensions:
-----------------------------------------------------------------------
This is supplemental info on the AutoDesk Animator FLI and FLC formats.
First WORD (16 bits) is the number of compressed lines to follow. Next
is the data for the changing lines themselves, always starting with the
first line. Each line is compressed individually.
The first WORD (16 bits) of a compressed line is the number of packets in
the line. If the number of packets is a negative skip -packets lines.
If the number of packets is positive, decode the packets. The format of
an individual packet is:
skip_count
size_count
data
The skip count is a single byte. If more than 255 pixels are to be
skipped, it must be broken into 2 packets. The size_count is also a byte.
If it is positive, that many WORDS of data follow and are to be copied to
the screen. If it is negative, a single WORDS value follows, and is to be
repeated -size_count times.
The first WORD is the number of packets in this chunk. This is followed
directly by the packets. The first byte of a packet is how many colors
to skip. The next byte is how many colors to change. If this number is
0, (zero), it means 256. Next follow 3 bytes for each color to change.
(One each for red, green and blue).
FLC's may contain all the above chunks plus one other:
FLC's also contains a frame with the magic bytes set to hex 00A1. This
is the first frame in the .flc file. Actually it isn't a frame at all
but to have several chunks within it that specify file location info
specific to Animator Pro. IE: filepath, font to use, and .COL file info.
This FRAME may be skipped while loading. That's right! Ignore it! The
frame header is the same length as all other frames. So you may read the
frame header, then skip past the rest of the frame.
NOTE: When reading the FLI header on the newer FLI and FLC files, the
FLI signature bytes are AF12 instead of AF11 used in the older FLI files.
Also, you cannot ignore the screen width and height they may not be
320 x 200.
If you have any questions or more info on the FLI or FLC formats,
please let me know.
Mike Haaland
(corrected by P. Oliver 30 May 1997 using information supplied by Reeves Hall)
CompuServe : 72300,1433
Delphi : MikeHaaland
Internet : mike@htsmm1.las-vegas.nv.us
Usenet : ...!htsmm1.las-vegas.nv.us!mike