1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00

more entity types

This commit is contained in:
Robin Appelman 2022-02-27 19:16:54 +01:00
commit f808d67303

View file

@ -120,6 +120,7 @@ trait FromStrProp: FromStr {}
impl FromStrProp for u8 {} impl FromStrProp for u8 {}
impl FromStrProp for f32 {} impl FromStrProp for f32 {}
impl FromStrProp for u32 {} impl FromStrProp for u32 {}
impl FromStrProp for i32 {}
impl FromStrProp for Vector {} impl FromStrProp for Vector {}
impl<T: FromStrProp> EntityProp<'_> for T impl<T: FromStrProp> EntityProp<'_> for T
@ -168,10 +169,14 @@ impl<'a, T: EntityProp<'a>> EntityProp<'a> for Option<T> {
pub enum Entity<'a> { pub enum Entity<'a> {
#[entity(name = "point_spotlight")] #[entity(name = "point_spotlight")]
SpotLight(SpotLight), SpotLight(SpotLight),
#[entity(name = "light")]
Light(Light),
#[entity(name = "light_spot")] #[entity(name = "light_spot")]
LightSpot(LightSpot), LightSpot(LightSpot),
#[entity(name = "prop_dynamic")] #[entity(name = "prop_dynamic")]
PropDynamic(PropDynamic<'a>), PropDynamic(PropDynamic<'a>),
#[entity(name = "prop_dynamic_override")]
PropDynamicOverride(PropDynamicOverride<'a>),
#[entity(name = "prop_physics_multiplayer")] #[entity(name = "prop_physics_multiplayer")]
PropPhysics(PropDynamic<'a>), PropPhysics(PropDynamic<'a>),
#[entity(name = "env_sprite")] #[entity(name = "env_sprite")]
@ -190,18 +195,43 @@ pub enum Entity<'a> {
AmmoPackSmall(AmmoPack), AmmoPackSmall(AmmoPack),
#[entity(name = "item_ammopack_medium")] #[entity(name = "item_ammopack_medium")]
AmmoPackMedium(AmmoPack), AmmoPackMedium(AmmoPack),
#[entity(name = "item_ammopack_large")] #[entity(name = "item_ammopack_full")]
HealthPackLarge(HealthPack), HealthPackFull(HealthPack),
#[entity(name = "item_healthkit_small")] #[entity(name = "item_healthkit_small")]
HealthPackSmall(HealthPack), HealthPackSmall(HealthPack),
#[entity(name = "item_healthkit_medium")] #[entity(name = "item_healthkit_medium")]
HealthPackMedium(HealthPack), HealthPackMedium(HealthPack),
#[entity(name = "item_healthkit_large")] #[entity(name = "item_healthkit_full")]
AmmoPackLarge(AmmoPack), AmmoPackFull(AmmoPack),
#[entity(name = "env_lightglow")]
LightGlow(LightGlow),
#[entity(name = "trigger_multiple")]
TriggerMultiple(TriggerMultiple<'a>),
#[entity(name = "logic_relay")]
LogicRelay(LogicRelay<'a>),
#[entity(name = "logic_auto")]
LogicAuto(LogicAuto<'a>),
#[entity(name = "func_dustmotes")]
DustMotes(DustMotes<'a>),
#[entity(name = "sky_camera")]
SkyCamera(SkyCamera),
#[entity(name = "path_track")]
PathTrack(PathTrack<'a>),
#[entity(name = "env_soundscape_proxy")]
SoundScapeProxy(SoundScapeProxy<'a>),
#[entity(name = "func_respawnroomvisualizer")]
RespawnVisualizer(RespawnVisualizer<'a>),
#[entity(default)] #[entity(default)]
Unknown(RawEntity<'a>), Unknown(RawEntity<'a>),
} }
#[derive(Debug, Clone, Entity)]
pub struct Light {
pub origin: Vector,
#[entity(name = "_light")]
pub light: [u32; 4],
}
#[derive(Debug, Clone, Entity)] #[derive(Debug, Clone, Entity)]
pub struct SpotLight { pub struct SpotLight {
pub origin: Vector, pub origin: Vector,
@ -217,7 +247,7 @@ pub struct LightSpot {
pub origin: Vector, pub origin: Vector,
pub angles: [f32; 3], pub angles: [f32; 3],
#[entity(name = "_light")] #[entity(name = "_light")]
pub color: [u8; 3], pub light: [u32; 4],
#[entity(name = "_cone")] #[entity(name = "_cone")]
pub cone: u8, pub cone: u8,
} }
@ -241,6 +271,25 @@ pub struct PropDynamic<'a> {
pub parent: Option<&'a str>, pub parent: Option<&'a str>,
} }
#[derive(Debug, Clone, Entity)]
pub struct PropDynamicOverride<'a> {
pub angles: [f32; 3],
#[entity(name = "disablereceiveshadows", default)]
pub disable_receive_shadows: bool,
#[entity(name = "disableshadows", default)]
pub disable_shadows: bool,
#[entity(name = "modelscale")]
pub scale: f32,
pub model: &'a str,
pub origin: Vector,
#[entity(name = "rendercolor")]
pub color: [u8; 3],
#[entity(name = "targetname", default)]
pub name: Option<&'a str>,
#[entity(name = "parentname", default)]
pub parent: Option<&'a str>,
}
#[derive(Debug, Clone, Entity)] #[derive(Debug, Clone, Entity)]
pub struct EnvSprite<'a> { pub struct EnvSprite<'a> {
pub origin: Vector, pub origin: Vector,
@ -326,3 +375,129 @@ pub struct BrushEntity<'a> {
#[entity(name = "rendercolor")] #[entity(name = "rendercolor")]
pub color: [f32; 3], pub color: [f32; 3],
} }
#[derive(Debug, Clone, Entity)]
pub struct LightGlow {
pub origin: Vector,
#[entity(name = "VerticalGlowSize")]
pub vertical_size: u32,
#[entity(name = "HorizontalGlowSize")]
pub horizontal_size: u32,
#[entity(name = "StartDisabled", default)]
pub start_disabled: bool,
#[entity(name = "rendercolor")]
pub color: [f32; 3],
#[entity(name = "MinDist")]
pub min_distance: u32,
#[entity(name = "MaxDist")]
pub max_distance: u32,
}
#[derive(Debug, Clone, Entity)]
pub struct TriggerMultiple<'a> {
pub model: &'a str,
pub origin: Vector,
#[entity(name = "OnStartTouch", default)]
pub start_touch: Option<&'a str>,
#[entity(name = "OnStartTouchAll", default)]
pub start_touch_all: Option<&'a str>,
#[entity(name = "OnEndTouch", default)]
pub end_touch: Option<&'a str>,
#[entity(name = "OnEndTouchAll", default)]
pub end_touch_all: Option<&'a str>,
#[entity(name = "OnNotTouching", default)]
pub not_touching: Option<&'a str>,
#[entity(name = "targetname", default)]
pub target_name: Option<&'a str>,
#[entity(name = "filtername", default)]
pub filter: Option<&'a str>,
pub wait: Option<u32>,
#[entity(name = "StartDisabled", default)]
pub start_disabled: bool,
}
#[derive(Debug, Clone, Entity)]
pub struct LogicRelay<'a> {
pub origin: Vector,
#[entity(name = "targetname", default)]
pub target_name: Option<&'a str>,
#[entity(name = "OnTrigger", default)]
pub on_trigger: Option<&'a str>,
}
#[derive(Debug, Clone, Entity)]
pub struct LogicAuto<'a> {
pub origin: Vector,
#[entity(name = "OnMapSpawn", default)]
pub on_map_spawn: Option<&'a str>,
}
#[derive(Debug, Clone, Entity)]
pub struct DustMotes<'a> {
pub model: &'a str,
pub origin: Vector,
#[entity(name = "StartDisabled", default)]
pub start_disabled: bool,
#[entity(name = "Color")]
pub color: [f32; 3],
#[entity(name = "SpawnRate")]
pub spawn_rate: u32,
#[entity(name = "SizeMin")]
pub size_min: u32,
#[entity(name = "SizeMax")]
pub size_max: u32,
#[entity(name = "Alpha")]
pub alpha: u8,
}
#[derive(Debug, Clone, Entity)]
pub struct SkyCamera {
pub origin: Vector,
#[entity(name = "fogenable")]
pub fog: bool,
pub use_angles: bool,
#[entity(name = "fogstart")]
pub fog_start: f32,
#[entity(name = "fogend")]
pub fog_end: f32,
pub angles: [u32; 3],
#[entity(name = "fogdir")]
pub direction: [u8; 3],
pub scale: u32,
#[entity(name = "fogcolor")]
pub color: [u8; 3],
#[entity(name = "fogcolor2", default)]
pub color2: Option<[u8; 3]>,
}
#[derive(Debug, Clone, Entity)]
pub struct PathTrack<'a> {
pub origin: Vector,
#[entity(default)]
pub target: Option<&'a str>,
#[entity(name = "targetname", default)]
pub target_name: Option<&'a str>,
#[entity(name = "orientationtype", default)]
pub orientation_type: u8,
pub angles: [u32; 3],
pub radius: f32,
pub speed: f32,
}
#[derive(Debug, Clone, Entity)]
pub struct SoundScapeProxy<'a> {
pub origin: Vector,
pub radius: f32,
#[entity(name = "MainSoundscapeName")]
pub main_name: &'a str,
}
#[derive(Debug, Clone, Entity)]
pub struct RespawnVisualizer<'a> {
pub origin: Vector,
#[entity(name = "respawnroomname")]
pub room_name: &'a str,
#[entity(name = "rendercolor")]
pub color: [f32; 3],
pub solid_to_enemies: bool,
}