home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
f
/
fliplay
/
!FliPlay
/
FLI_FLCdef
< prev
next >
Wrap
Text File
|
1994-09-12
|
38KB
|
990 lines
Animator Pro File Formats
This chapter details each of the file formats defined by Animator
Pro. Formats supported by Animator Pro but defined by another
party, such as GIF and TIFF files, are not described in this
document.
The files created by Autodesk Animator Pro are a superset of
those created by the original Autodesk Animator. In some cases
the Animator Pro formats are identical with the older Animator
format. In other cases, new data fields or data compression
techniques have been added to the file.
All two-byte and four-byte data values in Animator Pro files are
stored in Intel-style order, the same as they would appear in
memory on an 80x86 machine.
Common Hierarchial Chunked File Structure
In general, Animator Pro files contain one or more chunks of
information. Conceptually, a chunk is a combination of control
information and data. The most common Animator Pro file format
is a header structure followed by hierarchial data chunks.
Every chunk begins with a header of at least 6 bytes. The first
four bytes contain the length of the chunk (including the header
itself, and also including the length of all subordinate chunks,
if any). The next two bytes are an identifier word which
describes the type of data in the chunk. Some chunks have
headers longer than six bytes, but the size and identifier fields
always occupy the first six bytes of the header.
The Animator Pro animation file is a good example of a hierarchial
chunked file structure. The data in an animation file is arranged
as follows:
animation file:
optional prefix chunk:
settings chunk
cel placement chunk
frame 1 chunk:
postage stamp chunk:
postage stamp data
color palette chunk
pixel data chunk
frame 2 chunk:
pixel data chunk
frame 3 chunk:
color palette chunk
pixel data chunk
frame 4 chunk:
color palette chunk
ring frame chunk:
color palette chunk
pixel data chunk
It is possible that new types of chunks not described in this
document will be added to animation files in the future. We
recommend that you quietly ignore unknown chunk types you
encounter during animation playback. The size fields in the
chunk headers make it easy to skip an entire unrecognized chunk.
FLC - Animator Pro Flic Files
This is the main animation file format created by Animator Pro.
The file contains a 128-byte header, followed by an optional
prefix chunk, followed by one or more frame chunks.
The prefix chunk, if present, contains Animator Pro settings
information, CEL placement information, and other auxiliary data.
A frame chunk exists for each frame in the animation. In
addition, a ring frame follows all the animation frames. Each
frame chunk contains color palette information and/or pixel data.
The ring frame contains delta-compressed information to loop from
the last frame of the flic back to the first. It can be helpful
to think of the ring frame as a copy of the first frame,
compressed in a different way. All flic files will contain a
ring frame, including a single-frame flic.
The FLC file header
A FLC file begins with a 128-byte header, described below. All
lengths and offsets are in bytes. All values stored in the
header fields are unsigned.
Offset Length Name Description
0 4 size The size of the entire animation file,
including this file header.
4 2 magic File format identifier. Always hex AF12.
6 2 frames Number of frames in the flic. This
count does not include the ring frame.
FLC files have a maximum length of 4000
frames.
8 2 width Screen width in pixels.
10 2 height Screen height in pixels.
12 2 depth Bits per pixel (always 8).
14 2 flags Set to hex 0003 after ring frame is
written and flic header is updated.
This indicates that the file was properly
finished and closed.
16 4 speed Number of milliseconds to delay between
each frame during playback.
20 2 reserved Unused word, set to 0.
22 4 created The MSDOS-formatted date and time of the
file's creation.
26 4 creator The serial number of the Animator Pro
program used to create the file. If the
file was created by some other program
using the FlicLib development kit, this
value is hex 464C4942 ("FLIB").
30 4 updated The MSDOS-formatted date and time of the
file's most recent update.
34 4 updater Indicates who last updated the file. See
the description of creator.
38 2 aspectx The x-axis aspect ratio at which the file
was created.
40 2 aspecty The y-axis aspect ratio at which the file
was created. Most often, the x:y aspect ratio
will be 1:1. A 320x200 flic has a ratio of
6:5.
42 38 reserved Unused space, set to zeroes.
80 4 oframe1 Offset from the beginning of the file to the
first animation frame chunk.
84 4 oframe2 Offset from the beginning of the file to
the second animation frame chunk. This value
is used when looping from the ring frame back
to the second frame during playback.
88 40 reserved Unused space, set to zeroes.
The FLC prefix chunk
An optional prefix chunk may immediately follow the animation
file header. This chunk is used to store auxiliary data which is
not directly involved in the animation playback. The prefix
chunk starts with a 16-byte header (identical in structure to a
frame header), as follows:
Offset Length Name Description
0 4 size The size of the prefix chunk, including
this header and all subordinate chunks
that follow.
4 2 type Prefix chunk identifier. Always hex F100.
6 2 chunks Number of subordinate chunks in the
prefix chunk.
8 8 reserved Unused space, set to zeroes.
To determine whether a prefix chunk is present, read the 16-byte
header following the file header. If the type value is hex F100,
it's a prefix chunk. If the value is hex F1FA it's the first
frame chunk, and no prefix chunk exists.
Note
Programs other than Animator Pro should never need to create flic
files that contain a prefix chunk. Programs reading a flic file
should skip the prefix chunk by using the size value in the prefix
header to read and discard the prefix, or by seeking directly to
the first frame using the oframe1 field from the file header.
The FLC frame chunks
Frame chunks contain the pixel and color data for the animation.
A frame chunk may contain multiple subordinate chunks, each
containing a different type of data for the current frame. Each
frame chunk starts with a 16-byte header that describes the contents
of the frame:
Offset Length Name Description
0 4 size The size of the frame chunk, including this
header and all subordinate chunks that follow.
4 2 type Frame chunk identifier. Always hex F1FA.
6 2 chunks Number of subordinate chunks in the
frame chunk.
8 8 reserved Unu