XPlor/definitions/cod/materialtechniqueset.xscript
njohnson 7b1f5d34a1 Consolidate XScript definitions with byte order inheritance
- Volition VPP: Unified BE/LE types using inheritance pattern
- THQA PAK: Child types now inherit byte order from parent
- Various XScript definition updates and fixes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-11 16:08:46 -05:00

66 lines
1.7 KiB
Plaintext

type materialtechniqueset ui("Material Technique Set")
{
const PTR_INLINE = -1;
i32 technique_set_name_ptr ui("Technique Set Name Ptr");
u8 world_vert_format ui("World Vert Format");
u8 has_been_uploaded ui("Has Been Uploaded");
skip 2; // padding to align to 4 bytes
// Technique count depends on game/platform
technique_count = 0;
match(game) {
"COD4" => {
match(platform) {
"PC" => { technique_count = 34; }
"XBOX360" | "PS3" => { technique_count = 26; }
}
}
"COD5" => {
match(platform) {
"PC" => { technique_count = 59; }
"XBOX360" | "PS3" => { technique_count = 51; }
}
}
}
technique_count = technique_count ui("Technique Count");
// Validate techset (stub/minimal techsets have references instead of inline data)
_is_valid_techset = 1;
if (world_vert_format > 1) {
_is_valid_techset = 0;
}
if (has_been_uploaded > 1) {
_is_valid_techset = 0;
}
if (_is_valid_techset == 1) {
_ptrs_start_pos = pos();
// Read technique pointers as raw bytes
if (technique_count > 0) {
skip technique_count * 4;
}
// Parse inline name
if (technique_set_name_ptr == PTR_INLINE) {
technique_set_name = cstring() ui("Technique Set Name");
set_name(strip(technique_set_name, ","));
}
// Parse each technique if ptr == -1 (inline)
techniques = 0;
if (technique_count > 0) {
repeat(technique_count) {
_ptr_offset = _ptrs_start_pos + (_i * 4);
_ptr = i32at(_ptr_offset);
if (_ptr == PTR_INLINE) {
_technique = parse_here("materialtechnique");
techniques = push("techniques", _technique);
}
}
}
}
}