FF7/TEX format

From Final Fantasy Inside
< FF7
Revision as of 13:48, 11 March 2005 by my_wiki>Halkun
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

TEX Texture Data Format for PC by Mirix

FF7 PC texture consists of header, an optional palette and bitmap data. Usually data are stored like palletized picture, with bitmap pixels referencing to palette. Color 0 (in palette its usually black) is usually used as transparent color.

Sometimes, (I'm not sure if it is used in ff7 at all), when bit depth is 16 data are stored as packed RGB in style RGB555, which means 5 bits per color in one 2 byte entry.


Offset Size Description
0x00 56 bytes Unknown
0x38 4 bytes (long) bit depth - can be 4, 8, 16
0x3c 4 bytes (long) Image Width
0x40 4 bytes (long) Image Height
0x44 20 bytes Unknown
0x58 4 bytes (long) Number of Palette Entries
0x5c 144 bytes Unknown
0xec Palette Entries * 4 Every 4 bytes from palette represent one color, BGRA -Blue Green Red Alpha, but I'm not sure about the alpha byte. I'm using only the BGR part
After the Palette data
Varies (sizex * sizey) if bit depth is 4 or 8, (sizex * sizey * 2) if bit depth is 16

The bitmap: If bit depth is 4 or 8, every byte of bitmap data is reference to palette color. If bit depth is 16, bitmap is composed from 16bit

(2byte, short) values, which are RGB555 colors.