XPlor/definitions/cod/rawfile.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

23 lines
476 B
Plaintext

type rawfile ui("Raw File")
{
const PTR_INLINE = -1;
i32 name_ptr ui("Name Ptr");
i32 len ui("Length");
i32 buffer_ptr ui("Buffer Ptr");
// Inline data
if (name_ptr == PTR_INLINE) {
name = cstring() ui("Name");
set_name(name);
}
// Data buffer (if inline) - read len + 1 bytes for null terminator
if (buffer_ptr == PTR_INLINE && len > 0) {
raw_data = read(len + 1) ui("Raw Data");
set_viewer("text");
set_text(ascii(raw_data));
}
}