XPlor/definitions/cod/gfxworld.xscript
njohnson 0fa26e5256 Expand Call of Duty XScript definitions
Add new asset type definitions:
- GfxWorld and related structures (cells, lights, probes)
- Menu system (menudef, itemdef, windowdef, listboxdef)
- Sound system (soundalias, soundfile, speakermap, sndcurve)
- D3D resources (vertex/index buffers)
- Font glyphs and expression entries

Update existing definitions with improved field annotations
and UI display properties.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 16:36:40 -05:00

156 lines
6.1 KiB
Plaintext

type gfxworld [display="GFX World"]
{
// ========================================
// GfxWorld Header - PC VERSION (732 bytes)
// ========================================
// Name pointers (8 bytes)
i32 name_ptr [ui, readonly, display="Name Ptr"];
i32 basename_ptr [ui, readonly, display="Base Name Ptr"];
// Counts and indices (16 bytes)
i32 plane_count [ui, readonly, display="Plane Count"];
i32 node_count [ui, readonly, display="Node Count"];
i32 index_count [ui, readonly, display="Index Count"];
i32 indices_ptr [ui, readonly, display="Indices Ptr"];
// PC has no D3DIndexBuffer - just surfaceCount + unk (8 bytes)
i32 surface_count [ui, readonly, display="Surface Count"];
i32 unk [ui, readonly, display="Unknown"];
// Sky data (16 bytes)
i32 sky_surf_count [ui, readonly, display="Sky Surf Count"];
i32 sky_start_surfs_ptr [ui, readonly, display="Sky Start Surfs Ptr"];
i32 sky_image_ptr [ui, readonly, display="Sky Image Ptr"];
u8 sky_sampler_state [ui, readonly, display="Sky Sampler State"];
skip(3); // padding
// Vertex data (4 + 8 = 12 bytes)
u32 vertex_count [ui, readonly, display="Vertex Count"];
vertex_data = parse_here("gfxworldvertexdata");
// Vertex layer data (4 + 8 = 12 bytes)
u32 vertex_layer_data_size [ui, readonly, display="Vertex Layer Data Size"];
vertex_layer_data = parse_here("gfxworldvertexlayerdata");
// Sun light parse params - EMBEDDED (128 bytes on PC - name is char[64])
sun_parse = parse_here("sunlightparseparams");
// Sun light pointer (4 bytes)
i32 sun_light_ptr [ui, readonly, display="Sun Light Ptr"];
// Sun color from BSP (12 bytes)
sun_color = read(12) [ui, readonly, display="Sun Color"];
// Light counts and reflection probes (24 bytes)
u32 sun_primary_light_index [ui, readonly, display="Sun Primary Light Index"];
u32 primary_light_count [ui, readonly, display="Primary Light Count"];
i32 cull_group_count [ui, readonly, display="Cull Group Count"];
u32 reflection_probe_count [ui, readonly, display="Reflection Probe Count"];
i32 reflection_probes_ptr [ui, readonly, display="Reflection Probes Ptr"];
i32 reflection_probe_textures_ptr [ui, readonly, display="Reflection Probe Textures Ptr"];
// DPVS planes - EMBEDDED (16 bytes)
dpvs_planes = parse_here("gfxworlddpvsplanes");
// Cells and lightmaps (16 bytes)
i32 cell_bits_count [ui, readonly, display="Cell Bits Count"];
i32 cells_ptr [ui, readonly, display="Cells Ptr"];
i32 lightmap_count [ui, readonly, display="Lightmap Count"];
i32 lightmaps_ptr [ui, readonly, display="Lightmaps Ptr"];
// Light grid - EMBEDDED (56 bytes on PC - mins/maxs are uint16)
light_grid = parse_here("gfxlightgrid");
// Texture pointers (16 bytes)
i32 lightmaps_primary_ptr [ui, readonly, display="Lightmaps Primary Ptr"];
i32 lightmaps_secondary_ptr [ui, readonly, display="Lightmaps Secondary Ptr"];
i32 model_count [ui, readonly, display="Model Count"];
i32 models_ptr [ui, readonly, display="Models Ptr"];
// Bounds (24 bytes)
mins = read(12) [ui, readonly, display="Mins"];
maxs = read(12) [ui, readonly, display="Maxs"];
// Checksum and material memory (12 bytes)
u32 checksum [ui, readonly, display="Checksum"];
i32 material_memory_count [ui, readonly, display="Material Memory Count"];
i32 material_memory_ptr [ui, readonly, display="Material Memory Ptr"];
// Sun flare - EMBEDDED (96 bytes)
sun_flare = parse_here("sunflare");
// Outdoor lookup matrix (64 bytes)
outdoor_lookup_matrix = read(64) [ui, readonly, display="Outdoor Lookup Matrix"];
// Final pointers (40 bytes)
i32 outdoor_image_ptr [ui, readonly, display="Outdoor Image Ptr"];
i32 cell_caster_bits_ptr [ui, readonly, display="Cell Caster Bits Ptr"];
i32 scene_dyn_model_ptr [ui, readonly, display="Scene Dyn Model Ptr"];
i32 scene_dyn_brush_ptr [ui, readonly, display="Scene Dyn Brush Ptr"];
i32 primary_light_ent_shadow_vis_ptr [ui, readonly, display="Primary Light Ent Shadow Vis Ptr"];
i32 primary_light_dyn_ent_shadow_vis_ptr_0 [ui, readonly, display="Primary Light Dyn Ent Shadow Vis Ptr 0"];
i32 primary_light_dyn_ent_shadow_vis_ptr_1 [ui, readonly, display="Primary Light Dyn Ent Shadow Vis Ptr 1"];
i32 primary_light_for_model_dyn_ent_ptr [ui, readonly, display="Primary Light For Model Dyn Ent Ptr"];
i32 shadow_geom_ptr [ui, readonly, display="Shadow Geom Ptr"];
i32 light_region_ptr [ui, readonly, display="Light Region Ptr"];
// DPVS static - EMBEDDED (104 bytes on PC - has 3 extra fields)
dpvs = parse_here("gfxworlddpvsstatic");
// DPVS dynamic - EMBEDDED (48 bytes)
dpvs_dyn = parse_here("gfxworlddpvsdynamic");
// ========================================
// Inline data (after header, ptr == -1)
// ========================================
// Parse names if inline
if (name_ptr == -1) {
name = cstring() [ui, readonly, display="Name"];
_name = name;
}
if (basename_ptr == -1) {
basename = cstring() [ui, readonly, display="Base Name"];
}
// Indices array - only if inline (ptr == -1)
if (indices_ptr == -1 && index_count > 0) {
indices = read(index_count * 2) [ui, readonly, display="Indices"];
}
// Sky start surfs - only if inline
if (sky_start_surfs_ptr == -1 && sky_surf_count > 0) {
sky_start_surfs = read(sky_surf_count * 4) [ui, readonly, display="Sky Start Surfs"];
}
// Sky image - only if inline
if (sky_image_ptr == -1) {
sky_image = parse_here("image");
}
// Sun light - only if inline
if (sun_light_ptr == -1) {
sun_light = parse_here("gfxlight");
}
// Reflection probes - only if inline
if (reflection_probes_ptr == -1 && reflection_probe_count > 0) {
reflection_probes = 0;
repeat(reflection_probe_count) {
_probe = parse_here("gfxreflectionprobe");
reflection_probes = push("reflection_probes", _probe);
}
}
// Reflection probe textures - only if inline
if (reflection_probe_textures_ptr == -1 && reflection_probe_count > 0) {
reflection_probe_textures = 0;
repeat(reflection_probe_count) {
_tex = parse_here("gfxtexture");
reflection_probe_textures = push("reflection_probe_textures", _tex);
}
}
}