User Tools

Site Tools


openomf:pic

Pilot Image File Format (.PIC)

The PIC files contain the pilot portraits and their HAR palettes for the tournaments.

Header section

PIC files always begin with a dword that tells the number of pilot portraits in the file. After this, there is trash data until position 200 (0xC8).

At offset 0xC8 there is a list of data block offsets. Each offset is a dword, and there are the same number of them as was found in the pilot number dword in the header.

It seems that data blocks are tightly fit together, and first data block always starts right after the offset list, so it may be possible to completely disregard the offset list and just read continuously without fseek. Still, it is probably safer to use it. The data blocks continue until the end of the file.

Data section

Data block header

Offset Length Type Description
0 1 ubyte Unknown. Maybe tells if the portrait is meant for a player or an opponent ? Always 1 in PLAYERS.PIC, 0 otherwise.
1 2 uword Sex of the pilot. 0 = male, 1 = female.
3 144 char[] A HAR palette of exactly 48 colors. Should be set of palette offset 0. This is a standard 6bit VGA palette, so remember to do conversion!
147 1 ubyte Unknown. Maybe tells if there is image data ? There always seems to be.

At offset 148 starts the usual sprite data block. More on this below.

Sprite data

Sprite data is in the usual sprite format (See Sprite format for details). For rendering the portrait sprites, a palette from a .BK file should be used.

Note! For some reason, the sprite width and height that are written in the sprite header are too small. It is necessary to add 1 to both.

openomf/pic.txt · Last modified: 2015/04/10 12:22 by 127.0.0.1