Strike Commander Palette Format :
=====================================

By Fabien Sanglard
January 21st, 2014

Palettes can be found in four difference formats in SC:

In IFF files, within PALT, BLWH or CMAP chunk.

Here is the example of PALETTE.IFF


FORM
1798
PALT
  INFO
  14
  PALT
  772
  BLWH
  772
  RANG
  94
  TABL
  8
  FORM
  86
  BILD
    INFO
    20
    TABL
    46

PALETTE.IFF contains the 3D engine palette (PALT) with the colors and also a black and white version in BLWH
(when a player suffers too many G's the vision turns to greyscale).

Palette can also be found out of IFF files. For example in GAMEFLOW.TRE, entry ..\\..\\DATA\\GAMEFLOW\\MAINMENU.PAK is a PAK with three entries. The two first ones are RLEShapes for the menu
and the third one is a 388 bytes blog of data.

After inspection it turned out that palette in SC can ocassionally be stored in full but they are also often just "patches" for the current VGA palette.

Format:

2 bytes: Little Endian offset where to start updating the VGA palette
2 bytes: Num of colors to update
Followed by Num Of Colors bytes * 3 bytes.

The colors are stored as follow: R, G and B.
If you want to convert the color to GPU RGB 888, remember to multiply by 254/63.0f since colors channel were stored on 7 bits, the way VGA was expecting them.