XPlor/definitions/thqa/rsc.xscript

37 lines
919 B
Plaintext
Raw Normal View History

// RSC Model file format - THQ Australia Engine
// Contains 3D model geometry in g4rc containers
// Big-endian (Xbox 360, Wii)
type thqa_rsc ui("THQA RSC Model", root) byteorder BE
{
criteria {
require ascii(bytesat(0, 4)) == "dsrc";
}
// RSC files have a "dsrc" header
magic = ascii(read(4)) ui("Magic");
u32 total_size ui("Total Size");
// Look for g4rc blocks if there's more data
if (pos() + 4 <= size()) {
search_magic = ascii(read(4));
if (search_magic == "g4rc") {
seek(pos() - 4);
g4rc_type = u32at(pos() + 4) ui("G4RC Type");
g4rc_size = u32at(pos() + 12) ui("G4RC Size");
}
}
file_size = size() ui("Total File Size");
}
type thqa_rsc_vertex ui("RSC Vertex") byteorder BE
{
f32 pos_x ui("Position X");
f32 pos_y ui("Position Y");
f32 pos_z ui("Position Z");
u32 packed_normal ui("Packed Normal");
f32 uv_u ui("UV U");
f32 uv_v ui("UV V");
}