Table of Contents

Falcon 4 .APL File Format

Falcon 4.0 Forum, Falcon 4 Home, Falcon 4 Campaign, Falcon 4 Cockpits, Falcon 4 Database, Falcon 4 File Formats, Falcon 4 SRTM Terrain, Falcon 4 Terrain, Falcon 4 Textures, Falcon 4 Tools

An APL is a palettized image with the ability to store alpha values in the palette.

NOTE:The byte order on disk is little-endian.

Specification

APL file format:

Data TypeWidth(Bytes)Field NameDescription
DWORD4MAGIC = 0x030870, the magic number that identifies this file as an .APL file)
WORD2WIDTHwidth of the image in pixels
WORD2HEIGHTheight of the image in pixels
DWORD[256]1024PALETTE every 4 bytes (i.e. each DWORD) represents a single palette entry; a palette therefore holds 256 entries, numbered 0-255.
The high-order byte = ALPHA, and the next lower-order 3 bytes are Red, Green, and Blue, respectively.
BYTE[]WIDTH*HEIGHTIMAGEDATAEach byte in the IMAGEDATA section represents one pixel in the image; each byte's value is an offset into the palette array (0-255)

Reading an .APL file

The byte value associated with each pixel, provides an index into the palette array, telling you which palette entry to use for determining the color to use for rendering that pixel. Just look up the corresponding palette entry to get the color data for that pixel, as well as the alpha channel value. If the alpha component is set to 0x80, then this magic value means do not use ALPHA.