Permalink
Cannot retrieve contributors at this time
45 lines (42 sloc)
1.29 KB
| //http://wiki.tockdom.com/wiki/TPL_%28File_Format%29 | |
| BigEndian(); | |
| struct { | |
| byte id[4]; | |
| uint32 numImages; | |
| uint32 imageTableOffset <format=hex>; | |
| FSeek(header.imageTableOffset); | |
| struct { | |
| uint32 headerOffset <format=hex>; | |
| uint32 paletteOffset <format=hex>; | |
| } imageTable[numImages]; | |
| } header; | |
| local int i; | |
| for (i = 0; i < header.numImages; i++) { | |
| if (header.imageTable[i].paletteOffset) { | |
| struct { | |
| ushort numEntries; | |
| byte unpacked; | |
| byte padding; | |
| uint32 format <format=hex, comment="0x00: IA8, 0x01: RGB565, 0x02: RGB5A3">; | |
| uint32 dataOffset; | |
| } paletteHeader; | |
| } | |
| } | |
| for (i = 0; i < header.numImages; i++) { | |
| FSeek(header.imageTable[i].headerOffset); | |
| struct { | |
| ushort height; | |
| ushort width; | |
| uint32 format <format=hex, comment="0x00: I4, 0x01: I8, 0x02: IA4, 0x03: IA8, 0x04: RGB565, 0x05: RGB5A3, 0x06: RGBA32 (RGBA8), 0x08: C4 (CI4), 0x09: C8 (CI8), 0x0A: C14X2 (CI14x2), 0x0E: CMPR">; | |
| uint32 offset <format=hex>; | |
| uint32 wrapS; | |
| uint32 wrapT; | |
| uint32 minFilter; | |
| uint32 magFilter; | |
| float LODBias; | |
| ubyte edgeLODEnable; | |
| ubyte minLOD; | |
| ubyte maxLOD; | |
| ubyte unpacked; | |
| } textureHeader; | |
| } |