mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-04 02:54:08 +02:00
solid is an enum
This commit is contained in:
parent
15c1c4e6eb
commit
243d2039c3
2 changed files with 26 additions and 4 deletions
|
|
@ -119,7 +119,7 @@ pub struct StaticPropLump {
|
|||
pub prop_type: u16,
|
||||
pub first_leaf: u16,
|
||||
pub leaf_count: u16,
|
||||
pub solid: u8,
|
||||
pub solid: SolidType,
|
||||
pub skin: i32,
|
||||
pub fade_min_distance: f32,
|
||||
pub fade_max_distance: f32,
|
||||
|
|
@ -170,6 +170,20 @@ bitflags! {
|
|||
}
|
||||
}
|
||||
|
||||
#[repr(u8)]
|
||||
#[derive(BinRead, Debug, Copy, Clone)]
|
||||
#[br(repr = u8)]
|
||||
pub enum SolidType {
|
||||
None = 0,
|
||||
Bsp,
|
||||
Bbox,
|
||||
Obb,
|
||||
ObbYaw,
|
||||
Custom,
|
||||
Physics,
|
||||
Last,
|
||||
}
|
||||
|
||||
impl From<StaticPropLumpFlagsV6> for StaticPropLumpFlags {
|
||||
fn from(v6: StaticPropLumpFlagsV6) -> Self {
|
||||
StaticPropLumpFlags::from_bits_truncate(v6.bits().into())
|
||||
|
|
@ -183,7 +197,7 @@ struct StaticPropLumpV6 {
|
|||
pub prop_type: u16,
|
||||
pub first_leaf: u16,
|
||||
pub leaf_count: u16,
|
||||
pub solid: u8,
|
||||
pub solid: SolidType,
|
||||
pub flags: StaticPropLumpFlagsV6,
|
||||
pub skin: i32,
|
||||
pub fade_min_distance: f32,
|
||||
|
|
@ -223,7 +237,7 @@ struct StaticPropLumpV10 {
|
|||
pub leaf_count: u16,
|
||||
// pad, not align
|
||||
#[br(pad_after = 1)]
|
||||
pub solid: u8,
|
||||
pub solid: SolidType,
|
||||
pub skin: i32,
|
||||
pub fade_min_distance: f32,
|
||||
pub fade_max_distance: f32,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue