Animations

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

Data:

Dim palette(&H100) As Short
Dim frameCount As Integer
Dim lookupTable(frameCount) As Integer
Frame Data...

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

Frame Data:

Dim centerX As Short
Dim centerY As Short
Dim width As Short
Dim height As Short
Pixel Data...

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

Chunks:

Dim header As Integer
Dim palettePixels(XRun) As Byte ' 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 BitXor &H200) - &H200
YOffset = (YOffset BitXor &H200) - &H200

See Also:
 - UO Color Format
 - Index Files