Difference between revisions of "Palette file"

From Worms Knowledge Base

Jump to: navigation, search
(Unstubbed, complete PAL file format description)
m (RIFF length --> file length)
Line 6: Line 6:
 
As like every other RIFF file, the PAL files start off with the RIFF header:
 
As like every other RIFF file, the PAL files start off with the RIFF header:
 
* 4-byte RIFF signature "RIFF"
 
* 4-byte RIFF signature "RIFF"
* 4-byte RIFF length in bytes (excluding the RIFF header)
+
* 4-byte file length in bytes (excluding the RIFF header)
 
* 4-byte PAL signature "PAL " (note the space / 0x20 at the end)
 
* 4-byte PAL signature "PAL " (note the space / 0x20 at the end)
  

Revision as of 10:55, 5 August 2012

(Up to File formats)

W:A and WWP use the Microsoft RIFF file format to store their color palettes used in the frontend. The palette files all reside in the "Graphics" directory and its subfolders.

File format

As like every other RIFF file, the PAL files start off with the RIFF header:

  • 4-byte RIFF signature "RIFF"
  • 4-byte file length in bytes (excluding the RIFF header)
  • 4-byte PAL signature "PAL " (note the space / 0x20 at the end)

The PAL files then include 4 different chunks, of which only the "data" chunk is important. The purpose of the other chunks "offl", "tran" and "unde" are all 32 bytes long, filled with 0x00. Their purpose remains unknown since they can be deleted and the game still accepts the PAL files. Like other RIFF chunks, the data chunk starts with its signature and length:

  • 4-byte data chunk signature "data"
  • 4-byte data chunk size excluding the chunk header
  • 2-byte PAL version. This version is always 0x0300.
  • 2-byte color entry count. This determines how many colors are following.

Each color consists of 4 bytes holding the following data:

  • 1-byte red amount of color
  • 1-byte green amount of color
  • 1-byte blue amount of color
  • 1-byte "flags" - W:A PAL files always have the 0x00 flag, so no flag is set.

See also

  • Worms PAL Editor - does not save the 3 useless chunks, with no side-effect in the game

External links

Personal tools