- FMOD: FSB audio bank format support - THQ: PAK archives, G4RC textures, RAD video, STR strings, GML scripts - Volition: VPP archives, PEG textures, ASM container format - Wii: BNR banner format with metadata extraction Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
83 lines
1.5 KiB
Plaintext
83 lines
1.5 KiB
Plaintext
// Texture Format (2xtc / ctx2) - THQ Australia Engine
|
|
// Contains texture/image data
|
|
// Big-endian (Xbox 360, Wii)
|
|
|
|
type thqa_ctx2 [display="THQA Texture"] byteorder BE
|
|
{
|
|
criteria {
|
|
require ascii(bytesat(0, 4)) == "2xtc";
|
|
}
|
|
|
|
// Header
|
|
magic = ascii(read(4));
|
|
|
|
ui("magic", "Magic");
|
|
u32 version;
|
|
|
|
ui("version", "Version");
|
|
u32 width;
|
|
|
|
ui("width", "Width");
|
|
u32 height;
|
|
|
|
ui("height", "Height");
|
|
|
|
// Format info
|
|
u32 texture_format;
|
|
|
|
ui("texture_format", "Format");
|
|
u32 mipmap_count;
|
|
|
|
ui("mipmap_count", "Mipmap Count");
|
|
u32 flags;
|
|
|
|
ui("flags", "Flags");
|
|
|
|
// Data info
|
|
u32 data_offset;
|
|
|
|
ui("data_offset", "Data Offset");
|
|
u32 data_size;
|
|
|
|
ui("data_size", "Data Size");
|
|
|
|
// Decode format type
|
|
format_name = "Unknown";
|
|
if (texture_format == 0x00) {
|
|
format_name = "RGBA8888";
|
|
}
|
|
if (texture_format == 0x01) {
|
|
format_name = "RGB888";
|
|
}
|
|
if (texture_format == 0x02) {
|
|
format_name = "DXT1";
|
|
}
|
|
if (texture_format == 0x03) {
|
|
format_name = "DXT3";
|
|
}
|
|
if (texture_format == 0x04) {
|
|
format_name = "DXT5";
|
|
}
|
|
if (texture_format == 0x52) {
|
|
format_name = "Xbox360 DXT1";
|
|
}
|
|
if (texture_format == 0x53) {
|
|
format_name = "Xbox360 DXT3";
|
|
}
|
|
if (texture_format == 0x54) {
|
|
format_name = "Xbox360 DXT5";
|
|
}
|
|
|
|
format_name = format_name;
|
|
|
|
|
|
ui("format_name", "Format Name");
|
|
|
|
// Read texture data
|
|
if (data_offset > 0 && data_size > 0) {
|
|
seek(data_offset);
|
|
texture_data = read(data_size);
|
|
ui("texture_data", "Texture Data");
|
|
}
|
|
}
|