CMP Files


CMP Files General

CMP files contain information to change the viewed color depending on light level and/or if it's viewed through another color . Making oddly-colored areas is just one use of them.

The file is structured in three parts with a possible fourth .

File structure:

TCMPHeader
TPalette
64 TTables - light levels 0-63
256 TTables - transparency tables. May not be present
(TCMPHeader.HasTransparency determines this).

The header for an CMP file is:

CMP:

TCMPHeader=record
array[0..3] of char;    {'CMP ' - notice space after CMP}
longint;                {Apparently - version = 20 - 2.0?}
Longint;                {Transparency - If Not 0 then 256 more TTables - transparency tables }
array[1..52] of byte; {zeros - padding?}
end;

Followed by the palette information.

TPalette=array[0..255] of record
r,g,b:byte;

Finaly followed by the light level table(s).

TTable=array[0..255] of byte

Optional transparency tables (256)

TTable=array[0..255] of byte