bitflags 2

This commit is contained in:
Robin Appelman 2023-12-27 20:53:56 +01:00
commit 31fc82bbdb
5 changed files with 29 additions and 19 deletions

View file

@ -174,10 +174,12 @@ pub struct StudioHeader {
unused3: i32,
}
#[derive(Zeroable, Pod, Copy, Clone, Debug)]
#[repr(C)]
pub struct ModelFlags(u32);
bitflags! {
#[derive(Zeroable, Pod)]
#[repr(C)]
pub struct ModelFlags: u32 {
impl ModelFlags: u32 {
const AUTOGENERATED_HITBOX = 0x00000001;
const USES_ENV_CUBEMAP = 0x00000002;
const FORCE_OPAQUE = 0x00000004;

View file

@ -33,10 +33,12 @@ pub struct Bone {
reserved: [i32; 8], // remove as appropriate
}
#[derive(Zeroable, Pod, Copy, Clone, Debug)]
#[repr(C)]
pub struct BoneFlags(u32);
bitflags! {
#[derive(Zeroable, Pod)]
#[repr(C)]
pub struct BoneFlags: u32 {
impl BoneFlags: u32 {
const BONE_PHYSICALLY_SIMULATED = 0x00000001;
const BONE_PHYSICS_PROCEDURAL = 0x00000002;
const BONE_ALWAYS_PROCEDURAL = 0x00000004;

View file

@ -102,10 +102,12 @@ impl MeshHeader {
}
}
#[derive(Clone, Copy, Zeroable, Pod, Debug)]
#[repr(C)]
pub struct MeshFlags(u8);
bitflags! {
#[derive(Zeroable, Pod)]
#[repr(C)]
pub struct MeshFlags: u8 {
impl MeshFlags: u8 {
const IS_TEETH = 0x01;
const IS_EYES = 0x02;
}
@ -149,10 +151,12 @@ impl StripGroupHeader {
}
}
#[derive(Clone, Copy, Zeroable, Pod, Debug)]
#[repr(C)]
pub struct StripGroupFlags(u8);
bitflags! {
#[derive(Zeroable, Pod)]
#[repr(C)]
pub struct StripGroupFlags: u8 {
impl StripGroupFlags: u8 {
const IS_FLEXED = 0x01;
const IS_HWSKINNED = 0x02;
const IS_DELTA_FLEXED = 0x04;
@ -176,10 +180,12 @@ pub struct StripHeader {
static_assertions::const_assert_eq!(size_of::<StripHeader>(), 27);
#[derive(Clone, Copy, Zeroable, Pod, Debug)]
#[repr(C)]
pub struct StripFlags(u8);
bitflags! {
#[derive(Zeroable, Pod)]
#[repr(C)]
pub struct StripFlags: u8 {
impl StripFlags: u8 {
const IS_TRI_LIST = 0x01;
const IS_TRI_STRIP = 0x02;
}