1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 18:54:05 +02:00

allow bsp version 19 (partial implementation)

This commit is contained in:
Quaternions 2025-02-16 14:18:27 -08:00
commit 90b839c7f2

View file

@ -72,6 +72,9 @@ pub enum Entity<'a> {
#[serde(rename = "env_soundscape")] #[serde(rename = "env_soundscape")]
#[serde(borrow)] #[serde(borrow)]
EnvSoundscape(EnvSoundscape<'a>), EnvSoundscape(EnvSoundscape<'a>),
#[serde(rename = "env_soundscape_proxy")]
#[serde(borrow)]
EnvSoundscapeProxy(EnvSoundscapeProxy<'a>),
#[serde(rename = "env_soundscape_triggerable")] #[serde(rename = "env_soundscape_triggerable")]
#[serde(borrow)] #[serde(borrow)]
EnvSoundscapeTriggerable(EnvSoundscapeTriggerable<'a>), EnvSoundscapeTriggerable(EnvSoundscapeTriggerable<'a>),
@ -219,14 +222,22 @@ pub enum Entity<'a> {
#[serde(borrow)] #[serde(borrow)]
GameWeaponManager(GameWeaponManager<'a>), GameWeaponManager(GameWeaponManager<'a>),
#[serde(rename = "hostage_entity")] #[serde(rename = "hostage_entity")]
HostageEntity(HostageEntity), #[serde(borrow)]
HostageEntity(HostageEntity<'a>),
#[serde(rename = "info_camera_link")] #[serde(rename = "info_camera_link")]
#[serde(borrow)] #[serde(borrow)]
InfoCameraLink(InfoCameraLink<'a>), InfoCameraLink(InfoCameraLink<'a>),
#[serde(rename = "info_ladder")] #[serde(rename = "info_ladder")]
InfoLadder(InfoLadder), InfoLadder(InfoLadder),
#[serde(rename = "info_lighting_relative")]
#[serde(borrow)]
InfoLightingRelative(InfoLightingRelative<'a>),
#[serde(rename = "info_map_parameters")] #[serde(rename = "info_map_parameters")]
InfoMapParameters(InfoMapParameters), InfoMapParameters(InfoMapParameters),
#[serde(rename = "info_node")]
InfoNode(InfoNode),
#[serde(rename = "info_node_hint")]
InfoNodeHint(InfoNodeHint),
#[serde(rename = "info_particle_system")] #[serde(rename = "info_particle_system")]
#[serde(borrow)] #[serde(borrow)]
InfoParticleSystem(InfoParticleSystem<'a>), InfoParticleSystem(InfoParticleSystem<'a>),
@ -930,11 +941,18 @@ pub struct EnvSoundscape<'a> {
pub radius: f32, pub radius: f32,
pub soundscape: &'a str, pub soundscape: &'a str,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub startdisabled: bool, pub startdisabled: bool,
#[serde(default)] #[serde(default)]
pub targetname: Option<&'a str>, pub targetname: Option<&'a str>,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct EnvSoundscapeProxy<'a> {
pub mainsoundscapename: &'a str,
pub origin: Vector,
pub radius: i32,
}
#[derive(Debug, Clone, Deserialize)]
pub struct EnvSoundscapeTriggerable<'a> { pub struct EnvSoundscapeTriggerable<'a> {
pub origin: Vector, pub origin: Vector,
#[serde(default)] #[serde(default)]
@ -951,6 +969,8 @@ pub struct EnvSoundscapeTriggerable<'a> {
pub position5: Option<&'a str>, pub position5: Option<&'a str>,
#[serde(default)] #[serde(default)]
pub position6: Option<&'a str>, pub position6: Option<&'a str>,
#[serde(default)]
pub position7: Option<&'a str>,
pub radius: u16, pub radius: u16,
pub soundscape: &'a str, pub soundscape: &'a str,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
@ -963,7 +983,7 @@ pub struct EnvSpark<'a> {
pub angles: Angles, pub angles: Angles,
pub magnitude: u8, pub magnitude: u8,
#[serde(default)] #[serde(default)]
pub maxdelay: Option<u8>, pub maxdelay: Option<f32>,
pub origin: Vector, pub origin: Vector,
#[serde(default)] #[serde(default)]
pub parentname: Option<&'a str>, pub parentname: Option<&'a str>,
@ -1180,6 +1200,7 @@ pub struct FilterMulti<'a> {
pub struct FuncAreaportal<'a> { pub struct FuncAreaportal<'a> {
pub portalnumber: u8, pub portalnumber: u8,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub portalversion: bool, pub portalversion: bool,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
pub startopen: bool, pub startopen: bool,
@ -1194,8 +1215,10 @@ pub struct FuncAreaportalwindow<'a> {
pub fadestartdist: u16, pub fadestartdist: u16,
pub portalnumber: u8, pub portalnumber: u8,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub portalversion: bool, pub portalversion: bool,
pub target: &'a str, #[serde(default)]
pub target: Option<&'a str>,
pub translucencylimit: f32, pub translucencylimit: f32,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
@ -1203,6 +1226,10 @@ pub struct FuncBombTarget<'a> {
pub bombexplode: &'a str, pub bombexplode: &'a str,
pub model: &'a str, pub model: &'a str,
#[serde(default)] #[serde(default)]
pub spawnflags: Option<u32>,
#[serde(default)]
pub target: Option<&'a str>,
#[serde(default)]
pub targetname: Option<&'a str>, pub targetname: Option<&'a str>,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
@ -1213,6 +1240,9 @@ pub struct FuncBreakable<'a> {
pub angles: Option<Angles>, pub angles: Option<Angles>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub delay: bool,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub disablereceiveshadows: bool, pub disablereceiveshadows: bool,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
@ -1252,9 +1282,10 @@ pub struct FuncBreakable<'a> {
pub renderamt: u8, pub renderamt: u8,
pub rendercolor: Color, pub rendercolor: Color,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub renderfx: bool, pub renderfx: bool,
#[serde(deserialize_with = "bool_from_int")] #[serde(default)]
pub rendermode: bool, pub rendermode: Option<u8>,
#[serde(default)] #[serde(default)]
pub spawnflags: Option<u32>, pub spawnflags: Option<u32>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
@ -1288,8 +1319,10 @@ pub struct FuncBreakableSurf<'a> {
pub material: bool, pub material: bool,
pub model: &'a str, pub model: &'a str,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub nodamageforces: bool, pub nodamageforces: bool,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub performancemode: bool, pub performancemode: bool,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
pub pressuredelay: bool, pub pressuredelay: bool,
@ -1642,7 +1675,18 @@ pub struct FuncIllusionary<'a> {
#[serde(default)] #[serde(default)]
pub rendermode: Option<u8>, pub rendermode: Option<u8>,
#[serde(default)] #[serde(default)]
pub skin: Option<i32>,
#[serde(default)]
pub spawnflags: Option<u32>,
#[serde(default)]
pub speed: Option<u8>,
#[serde(default)]
pub targetname: Option<&'a str>, pub targetname: Option<&'a str>,
#[serde(default)]
pub wait: Option<u8>,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub zhlt_lightflags: bool,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct FuncLod<'a> { pub struct FuncLod<'a> {
@ -2015,7 +2059,12 @@ pub struct FuncWall<'a> {
#[serde(default)] #[serde(default)]
pub rendermode: Option<u8>, pub rendermode: Option<u8>,
#[serde(default)] #[serde(default)]
pub spawnflags: Option<u32>,
#[serde(default)]
pub targetname: Option<&'a str>, pub targetname: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub zhlt_lightflags: bool,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct FuncWallToggle<'a> { pub struct FuncWallToggle<'a> {
@ -2162,9 +2211,19 @@ pub struct GameWeaponManager<'a> {
pub weaponname: &'a str, pub weaponname: &'a str,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct HostageEntity { pub struct HostageEntity<'a> {
pub angles: Angles, pub angles: Angles,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub hostagetype: bool,
#[serde(default)]
pub model: Option<&'a str>,
pub origin: Vector, pub origin: Vector,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub skin: bool,
#[serde(default)]
pub spawnflags: Option<u32>,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct InfoCameraLink<'a> { pub struct InfoCameraLink<'a> {
@ -2192,12 +2251,41 @@ pub struct InfoLadder {
pub mins_z: f32, pub mins_z: f32,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct InfoLightingRelative<'a> {
pub lightinglandmark: &'a str,
pub origin: Vector,
pub targetname: &'a str,
}
#[derive(Debug, Clone, Deserialize)]
pub struct InfoMapParameters { pub struct InfoMapParameters {
pub angles: Angles, #[serde(default)]
pub angles: Option<Angles>,
pub bombradius: u16, pub bombradius: u16,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
pub buying: bool, pub buying: bool,
pub origin: Vector, pub origin: Vector,
#[serde(default)]
pub spawnflags: Option<u32>,
}
#[derive(Debug, Clone, Deserialize)]
pub struct InfoNode {
pub nodeid: u16,
pub origin: Vector,
}
#[derive(Debug, Clone, Deserialize)]
pub struct InfoNodeHint {
pub angles: Angles,
pub hinttype: u16,
pub ignorefacing: u8,
pub maximumstate: u8,
#[serde(deserialize_with = "bool_from_int")]
pub minimumstate: bool,
pub nodefov: u8,
pub nodeid: u8,
pub origin: Vector,
#[serde(deserialize_with = "bool_from_int")]
pub starthintdisabled: bool,
pub targetnode: i32,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct InfoParticleSystem<'a> { pub struct InfoParticleSystem<'a> {
@ -2277,6 +2365,8 @@ pub struct Infodecal<'a> {
#[serde(default)] #[serde(default)]
pub lowpriority: bool, pub lowpriority: bool,
pub origin: Vector, pub origin: Vector,
#[serde(default)]
pub spawnflags: Option<u32>,
pub texture: &'a str, pub texture: &'a str,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
@ -2319,8 +2409,7 @@ pub struct KeyframeRope<'a> {
pub spawnflags: Option<u32>, pub spawnflags: Option<u32>,
pub subdiv: u8, pub subdiv: u8,
pub targetname: &'a str, pub targetname: &'a str,
#[serde(deserialize_with = "bool_from_int")] pub texturescale: u8,
pub texturescale: bool,
pub width: u8, pub width: u8,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
@ -2334,7 +2423,8 @@ pub struct Light<'a> {
#[serde(default)] #[serde(default)]
pub _hardfalloff: Option<u16>, pub _hardfalloff: Option<u16>,
pub _light: &'a str, pub _light: &'a str,
pub _lighthdr: &'a str, #[serde(default)]
pub _lighthdr: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub _lightscalehdr: bool, pub _lightscalehdr: bool,
@ -2358,14 +2448,18 @@ pub struct Light<'a> {
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct LightEnvironment<'a> { pub struct LightEnvironment<'a> {
pub _ambient: &'a str, pub _ambient: &'a str,
pub _ambienthdr: &'a str, #[serde(default)]
pub _ambienthdr: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub _ambientscalehdr: bool, pub _ambientscalehdr: bool,
#[serde(default)] #[serde(default)]
pub _diffuse_light: Option<LightColor>, pub _diffuse_light: Option<LightColor>,
#[serde(default)]
pub _diffuse_lighting: Option<LightColor>,
pub _light: LightColor, pub _light: LightColor,
pub _lighthdr: &'a str, #[serde(default)]
pub _lighthdr: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub _lightscalehdr: bool, pub _lightscalehdr: bool,
@ -2373,6 +2467,8 @@ pub struct LightEnvironment<'a> {
pub origin: Vector, pub origin: Vector,
#[serde(default)] #[serde(default)]
pub pitch: Option<i32>, pub pitch: Option<i32>,
#[serde(default)]
pub spawnflags: Option<u32>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub style: bool, pub style: bool,
@ -2396,7 +2492,8 @@ pub struct LightSpot<'a> {
pub _hardfalloff: bool, pub _hardfalloff: bool,
pub _inner_cone: u8, pub _inner_cone: u8,
pub _light: LightColor, pub _light: LightColor,
pub _lighthdr: &'a str, #[serde(default)]
pub _lighthdr: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub _lightscalehdr: bool, pub _lightscalehdr: bool,
@ -2412,6 +2509,8 @@ pub struct LightSpot<'a> {
pub origin: Vector, pub origin: Vector,
pub pitch: f32, pub pitch: f32,
#[serde(default)] #[serde(default)]
pub renderamt: Option<u8>,
#[serde(default)]
pub spawnflags: Option<u32>, pub spawnflags: Option<u32>,
#[serde(default)] #[serde(default)]
pub style: Option<u8>, pub style: Option<u8>,
@ -2620,9 +2719,8 @@ pub struct MoveRope<'a> {
pub subdiv: u8, pub subdiv: u8,
#[serde(default)] #[serde(default)]
pub targetname: Option<&'a str>, pub targetname: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] pub texturescale: u8,
pub texturescale: bool, pub width: f32,
pub width: u8,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
pub struct PathTrack<'a> { pub struct PathTrack<'a> {
@ -2977,20 +3075,27 @@ pub struct PropDoorRotating<'a> {
pub disableshadows: bool, pub disableshadows: bool,
pub distance: u8, pub distance: u8,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub forceclosed: bool, pub forceclosed: bool,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
pub hardware: bool, pub hardware: bool,
pub model: &'a str, pub model: &'a str,
pub onclose: &'a str, #[serde(default)]
pub onopen: &'a str, pub onclose: Option<&'a str>,
#[serde(default)]
pub onopen: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub opendir: bool, pub opendir: bool,
pub origin: Vector, pub origin: Vector,
pub returndelay: u8, pub returndelay: u8,
pub skin: u8, pub skin: u8,
pub soundcloseoverride: &'a str, #[serde(default)]
pub soundmoveoverride: &'a str, pub soundcloseoverride: Option<&'a str>,
pub soundopenoverride: &'a str, #[serde(default)]
pub soundmoveoverride: Option<&'a str>,
#[serde(default)]
pub soundopenoverride: Option<&'a str>,
pub spawnflags: u32, pub spawnflags: u32,
pub speed: u8, pub speed: u8,
pub targetname: &'a str, pub targetname: &'a str,
@ -3027,6 +3132,8 @@ pub struct PropDynamic<'a> {
pub fadescale: bool, pub fadescale: bool,
#[serde(default)] #[serde(default)]
pub globalname: Option<&'a str>, pub globalname: Option<&'a str>,
#[serde(default)]
pub lightingoriginhack: Option<&'a str>,
pub maxanimtime: u8, pub maxanimtime: u8,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
@ -3061,9 +3168,8 @@ pub struct PropDynamic<'a> {
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub rendermode: bool, pub rendermode: bool,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub setbodygroup: bool, pub setbodygroup: Option<u8>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub skin: bool, pub skin: bool,
@ -3098,9 +3204,8 @@ pub struct PropDynamicOverride<'a> {
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub exploderadius: bool, pub exploderadius: bool,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub fademaxdist: bool, pub fademaxdist: Option<u16>,
pub fademindist: i32, pub fademindist: i32,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
pub fadescale: bool, pub fadescale: bool,
@ -3130,8 +3235,10 @@ pub struct PropDynamicOverride<'a> {
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub randomanimation: bool, pub randomanimation: bool,
pub renderamt: u8, #[serde(default)]
pub rendercolor: Color, pub renderamt: Option<u8>,
#[serde(default)]
pub rendercolor: Option<Color>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub renderfx: bool, pub renderfx: bool,
@ -3217,12 +3324,10 @@ pub struct PropPhysics<'a> {
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub rendermode: bool, pub rendermode: bool,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub shadowcastdist: bool, pub shadowcastdist: Option<u8>,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub skin: bool, pub skin: Option<u8>,
pub spawnflags: u32, pub spawnflags: u32,
#[serde(default)] #[serde(default)]
pub targetname: Option<&'a str>, pub targetname: Option<&'a str>,
@ -3284,6 +3389,8 @@ pub struct PropPhysicsMultiplayer<'a> {
pub onbreak: Option<&'a str>, pub onbreak: Option<&'a str>,
#[serde(default)] #[serde(default)]
pub onhealthchanged: Option<&'a str>, pub onhealthchanged: Option<&'a str>,
#[serde(default)]
pub onmotionenabled: Option<&'a str>,
pub origin: Vector, pub origin: Vector,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
@ -3551,6 +3658,8 @@ pub struct TriggerOnce<'a> {
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
pub startdisabled: bool, pub startdisabled: bool,
#[serde(default)] #[serde(default)]
pub targetname: Option<&'a str>,
#[serde(default)]
pub wait: Option<i32>, pub wait: Option<i32>,
} }
#[derive(Debug, Clone, Deserialize)] #[derive(Debug, Clone, Deserialize)]
@ -4250,8 +4359,10 @@ pub struct Worldspawn<'a> {
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub defaultteam: bool, pub defaultteam: bool,
pub detailmaterial: &'a str, #[serde(default)]
pub detailvbsp: &'a str, pub detailmaterial: Option<&'a str>,
#[serde(default)]
pub detailvbsp: Option<&'a str>,
#[serde(deserialize_with = "bool_from_int")] #[serde(deserialize_with = "bool_from_int")]
#[serde(default)] #[serde(default)]
pub gametitle: bool, pub gametitle: bool,
@ -4289,4 +4400,7 @@ pub struct Worldspawn<'a> {
pub waveheight: Option<f32>, pub waveheight: Option<f32>,
pub world_maxs: Vector, pub world_maxs: Vector,
pub world_mins: Vector, pub world_mins: Vector,
#[serde(deserialize_with = "bool_from_int")]
#[serde(default)]
pub worldtype: bool,
} }