home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 5 / DATAFILE_PDCD5.iso / utilities / f / fliplay / !FliPlay / FLI_FLCdef < prev    next >
Text File  |  1994-09-12  |  38KB  |  990 lines

  1. Animator Pro File Formats
  2.  
  3.  
  4. This chapter details each of the file formats defined by Animator
  5. Pro.  Formats supported by Animator Pro but defined by another
  6. party, such as GIF and TIFF files, are not described in this
  7. document.
  8.  
  9. The files created by Autodesk Animator Pro are a superset of
  10. those created by the original Autodesk Animator.  In some cases
  11. the Animator Pro formats are identical with the older Animator
  12. format.  In other cases, new data fields or data compression
  13. techniques have been added to the file.
  14.  
  15. All two-byte and four-byte data values in Animator Pro files are
  16. stored in Intel-style order, the same as they would appear in
  17. memory on an 80x86 machine.
  18.  
  19.  
  20. Common Hierarchial Chunked File Structure
  21.  
  22.  
  23. In general, Animator Pro files contain one or more chunks of
  24. information.  Conceptually, a chunk is a combination of control
  25. information and data.  The most common Animator Pro file format
  26. is a header structure followed by hierarchial data chunks.
  27.  
  28. Every chunk begins with a header of at least 6 bytes. The first
  29. four bytes contain the length of the chunk (including the header
  30. itself, and also including the length of all subordinate chunks,
  31. if any).  The next two bytes are an identifier word which
  32. describes the type of data in the chunk.  Some chunks have
  33. headers longer than six bytes, but the size and identifier fields
  34. always occupy the first six bytes of the header.
  35.  
  36. The Animator Pro animation file is a good example of a hierarchial 
  37. chunked file structure.  The data in an animation file is arranged 
  38. as follows:
  39.  
  40.      animation file:
  41.           optional prefix chunk:
  42.                settings chunk
  43.                cel placement chunk
  44.           frame 1 chunk:
  45.                postage stamp chunk:
  46.                     postage stamp data
  47.                color palette chunk
  48.                pixel data chunk
  49.           frame 2 chunk:
  50.                pixel data chunk
  51.           frame 3 chunk:
  52.                color palette chunk
  53.                pixel data chunk
  54.           frame 4 chunk:
  55.                color palette chunk
  56.           ring frame chunk:
  57.                color palette chunk
  58.                pixel data chunk
  59.  
  60. It is possible that new types of chunks not described in this
  61. document will be added to animation files in the future.  We
  62. recommend that you quietly ignore unknown chunk types you
  63. encounter during animation playback.  The size fields in the
  64. chunk headers make it easy to skip an entire unrecognized chunk.
  65.  
  66.  
  67. FLC - Animator Pro Flic Files
  68.  
  69.  
  70. This is the main animation file format created by Animator Pro.
  71. The file contains a 128-byte header, followed by an optional
  72. prefix chunk, followed by one or more frame chunks.
  73.  
  74. The prefix chunk, if present, contains Animator Pro settings
  75. information, CEL placement information, and other auxiliary data.
  76.  
  77. A frame chunk exists for each frame in the animation. In
  78. addition, a ring frame follows all the animation frames.  Each
  79. frame chunk contains color palette information and/or pixel data.
  80.  
  81. The ring frame contains delta-compressed information to loop from
  82. the last frame of the flic back to the first.  It can be helpful
  83. to think of the ring frame as a copy of the first frame,
  84. compressed in a different way.  All flic files will contain a
  85. ring frame, including a single-frame flic.
  86.  
  87.  
  88. The FLC file header
  89.  
  90.  
  91. A FLC file begins with a 128-byte header, described below.  All
  92. lengths and offsets are in bytes.  All values stored in the
  93. header fields are unsigned.
  94.  
  95. Offset  Length  Name         Description
  96.  
  97.   0       4     size         The size of the entire animation file,
  98.                              including this file header.
  99.  
  100.   4       2     magic        File format identifier. Always hex AF12.
  101.  
  102.   6       2     frames       Number of frames in the flic.  This 
  103.                              count does not include the ring frame.  
  104.                              FLC files have a maximum length of 4000 
  105.                              frames.
  106.  
  107.   8       2     width        Screen width in pixels.
  108.  
  109.   10      2     height       Screen height in pixels.
  110.  
  111.   12      2     depth        Bits per pixel (always 8).
  112.  
  113.   14      2     flags        Set to hex 0003 after ring frame is 
  114.                              written and flic header is updated.  
  115.                              This indicates that the file was properly
  116.                              finished and closed.
  117.  
  118.   16      4     speed        Number of milliseconds to delay between 
  119.                              each frame during playback.
  120.  
  121.   20      2     reserved     Unused word, set to 0.
  122.  
  123.   22      4     created      The MSDOS-formatted date and time of the
  124.                              file's creation.
  125.  
  126.   26      4     creator      The serial number of the Animator Pro
  127.                              program used to create the file.  If the 
  128.                              file was created by some other program 
  129.                              using the FlicLib development kit, this 
  130.                              value is hex 464C4942 ("FLIB").
  131.  
  132.   30      4     updated      The MSDOS-formatted date and time of the
  133.                              file's most recent update.
  134.  
  135.   34      4     updater      Indicates who last updated the file.  See 
  136.                              the description of creator.
  137.  
  138.   38      2     aspectx      The x-axis aspect ratio at which the file 
  139.                              was created.
  140.  
  141.   40      2     aspecty      The y-axis aspect ratio at which the file 
  142.                              was created. Most often, the x:y aspect ratio 
  143.                              will be 1:1.  A 320x200 flic has a ratio of 
  144.                              6:5.
  145.  
  146.   42      38    reserved     Unused space, set to zeroes.
  147.  
  148.   80      4     oframe1      Offset from the beginning of the file to the 
  149.                              first animation frame chunk.
  150.  
  151.   84      4     oframe2      Offset from the beginning of the file to
  152.                              the second animation frame chunk.  This value 
  153.                              is used when looping from the ring frame back 
  154.                              to the second frame during playback.
  155.  
  156.   88      40    reserved     Unused space, set to zeroes.
  157.  
  158.  
  159.  
  160. The FLC prefix chunk
  161.  
  162.  
  163. An optional prefix chunk may immediately follow the animation
  164. file header.  This chunk is used to store auxiliary data which is
  165. not directly involved in the animation playback.  The prefix
  166. chunk starts with a 16-byte header (identical in structure to a
  167. frame header), as follows:
  168.  
  169. Offset  Length  Name         Description
  170.  
  171.   0       4     size         The size of the prefix chunk, including 
  172.                              this header and all subordinate chunks 
  173.                              that follow.
  174.  
  175.   4       2     type         Prefix chunk identifier. Always hex F100.
  176.  
  177.   6       2     chunks       Number of subordinate chunks in the
  178.                              prefix chunk.
  179.  
  180.   8       8     reserved     Unused space, set to zeroes.
  181.  
  182. To determine whether a prefix chunk is present, read the 16-byte
  183. header following the file header.  If the type value is hex F100,
  184. it's a prefix chunk.  If the value is hex F1FA it's the first
  185. frame chunk, and no prefix chunk exists.
  186.  
  187. Note
  188.  
  189. Programs other than Animator Pro should never need to create flic
  190. files that contain a prefix chunk.  Programs reading a flic file
  191. should skip the prefix chunk by using the size value in the prefix 
  192. header to read and discard the prefix, or by seeking directly to 
  193. the first frame using the oframe1 field from the file header.
  194.  
  195.  
  196. The FLC frame chunks
  197.  
  198.  
  199. Frame chunks contain the pixel and color data for the animation.
  200. A frame chunk may contain multiple subordinate chunks, each
  201. containing a different type of data for the current frame.  Each
  202. frame chunk starts with a 16-byte header that describes the contents 
  203. of the frame:
  204.  
  205. Offset  Length  Name         Description
  206.  
  207.   0       4     size         The size of the frame chunk, including this
  208.                              header and all subordinate chunks that follow.
  209.  
  210.   4       2     type         Frame chunk identifier. Always hex F1FA.
  211.  
  212.   6       2     chunks       Number of subordinate chunks in the
  213.                              frame chunk.
  214.  
  215.   8       8     reserved     Unu