TXD

From GTAMods Wiki
Revision as of 15:51, 14 April 2006 by Grovespaz (talk | contribs)
Jump to navigation Jump to search

Copyed from Spooky, just to make a start..: Please note that this is the Vice City format, although it doesnt differ that much.. Copied from here


The (Vice City) TXD Format

The (usual) txd format looks like this:

 (22) Texture Dictionary
 |
 +-+ (1) Data
 | |--> Number of Textures (dword)
 |
 +-+ (21) Texture No. 1
 | |-+ (1) Data
 | | |--> (all the texture information and the image itself)
 | |
 | +-- (3) Extension (always empty - size=0) --> MISSING
 |
 +-+ (21) Texture No. 2
 | |-- ... (same as above)
 |
 +-+ (21) Texture No. 3
 |-- ...

(The number in brackets stands for the section type - dword)

These are just the alpha flags and (hopefully) depend on the image type:

8bit without alpha: 9728 8bit with alpha: 9472

32bit without alpha: 1536 32bit with alpha: 1280

DXT1 without alpha: 512 DXT1 with alpha: 256 DXT3 with alpha: 768

The first dword is section type, second section size and third the version id of the renderware file. TXD files have the same basic format as DFF files and consist of sections with different purpose. See KCows dff documentation for more infos. Every section has a 12 byte section header, containing type, size and ver id. The version id's are:

 0x0800FFFF for GTA3,
 0x0C02FFFF for VC PS2 and
 0x1003FFFF for VC PC

(in the most cases).

(Just the second byte of the dword changes, that's why all values are divisible by 256)