pub struct Bsp(vbsp::Bsp); impl Bsp{ pub const fn new(value:vbsp::Bsp)->Self{ Self(value) } } impl AsRef for Bsp{ fn as_ref(&self)->&vbsp::Bsp{ &self.0 } } pub struct MdlData(Vec); impl MdlData{ pub const fn new(value:Vec)->Self{ Self(value) } } impl AsRef<[u8]> for MdlData{ fn as_ref(&self)->&[u8]{ self.0.as_ref() } } pub struct VtxData(Vec); impl VtxData{ pub const fn new(value:Vec)->Self{ Self(value) } } impl AsRef<[u8]> for VtxData{ fn as_ref(&self)->&[u8]{ self.0.as_ref() } } pub struct VvdData(Vec); impl VvdData{ pub const fn new(value:Vec)->Self{ Self(value) } } impl AsRef<[u8]> for VvdData{ fn as_ref(&self)->&[u8]{ self.0.as_ref() } } pub struct ModelData{ pub mdl:MdlData, pub vtx:VtxData, pub vvd:VvdData, } impl ModelData{ pub fn read_model(&self)->Result{ Ok(vmdl::Model::from_parts( vmdl::mdl::Mdl::read(self.mdl.as_ref())?, vmdl::vtx::Vtx::read(self.vtx.as_ref())?, vmdl::vvd::Vvd::read(self.vvd.as_ref())?, )) } }