Palette data files

From EDukeWiki
Revision as of 07:43, 21 April 2008 by 189.32.72.201 (talk) (This number is weird, so I expect it's 65536, instead of 655536.)
Jump to navigation Jump to search

Palette, palette mapping and transparancy data is stored in two files, palette.dat and lookup.dat.

palette.dat

index 0: 768 bytes of palette data for the main palette. Each color stored as three bytes for red green and blue in that order. Values only range from 0 to 63 so scaling will be required for acceptable display on a modern system.

index 768: two byte little endian integer containing number of "palookup" tables (used to make art look darker) This number is hereafter known as numpalookups

index 770: numpalookups "palookup" tables. Theese are simple 256 byte lookup tables which map from a color in the image to a color in the display palette.

index 770+(numpalookups*256): 65536 bytes of transparancy data. Essentially a 2D array which takes two color indexes and returns a color index to display.


lookup.dat index 0: number of spritepals (num_tables)

index 1: spritepals, Each spritepal has a prefix byte with it's spritepal number then 256 bytes of lookup data.

index 1+(num_tables*768): alternate main palettes. 5 pallettes in the same format as the main palette (768 bytes each) WATERpalette: used for underwater SLIMEpalette: used for nightvision (in combination with a spritepal which is used to make enemy sprites glow) and presumablly something to do with slime. TITLEpalette: used for the screen where the words duke nukem 3D atomic fly in. REALMSpalette: used for the 3D realms title screen BOSS1palette: used for the animiation you get after defeating the boss at the end of episode 1.