Maelstrom ANM

From MultimediaWiki
Jump to navigation Jump to search

This is an animation format used in the strategy game from early 1990s. It employs chunked format with ANIM being the root chunk, BPIC used for the first (intra) frame and DFRM used for the delta frames.

Intra frame has the following header:

 1 byte  - unknown
 1 byte  - mode (0 - raw, 1 - RLE)
 2 bytes - height
 2 bytes - width
 1 byte  - depth (should be 8)
 1 byte  - number of palette colours
 N*3 bytes - palette

RLE opcodes are trivial: 0-127 means read 1-128 pixels, 128-255 means run of 129-2 pixels.

Delta frames use RLE compression which is employed per column. For each column there's a byte telling the number of RLE opcodes followed by those opcodes and data:

  • 0 - run, read byte for run length and byte for colour value
  • 1-127 - skip 1-127 lines
  • 128-255 - read 128-1 pixels