Animations

Data File: Anim.mul
Index File: Anim.idx

Data:

short[0x100] palette;
int frameCount;
int[frameCount] lookupTable;
Frame Data...

To find the data for a frame, seek to 0x200 + lookupTable[frame].

Frame Data:

short centerX;
short centerY;
short width;
short height;
Pixel Data...

Pixel data comes in chunks. If the current chunk header is 0x7FFF7FFF, the image is completed.

Chunks:

int header;
byte[XRun] palettePixels; // See description below for XRun

Header Bit Masks:

1F1E1D1C1B1A191817161514131211100F0E0D0C0B0A09080706050403020100
YOffsetXOffsetXRun

XOffset and YOffset are relative to centerX and centerY.
XRun indicates how many pixels are contained in this line.
XOffset and YOffset are signed, so we need to compensate for that:
XOffset = (XOffset ^ 0x200) - 0x200
YOffset = (YOffset ^ 0x200) - 0x200

See Also:
 - UO Color Format
 - Index Files