diff options
author | tcmal <me@aria.rip> | 2024-08-25 17:44:22 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-25 17:44:22 +0100 |
commit | c48b54f3fb7bbe9046915eb99eca02fa84dc55c9 (patch) | |
tree | 752831451d2bd3a658485df724a01ae39e80fae3 /stockton-levels/src/q3/file.rs | |
parent | b437109ebf4da243fd643f0a31546d0d0155b0a4 (diff) |
feat(render): multithreaded texture loading
also a bunch of supporting changes
Diffstat (limited to 'stockton-levels/src/q3/file.rs')
-rw-r--r-- | stockton-levels/src/q3/file.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/stockton-levels/src/q3/file.rs b/stockton-levels/src/q3/file.rs index 1440e21..48066f1 100644 --- a/stockton-levels/src/q3/file.rs +++ b/stockton-levels/src/q3/file.rs @@ -36,11 +36,11 @@ use crate::traits::light_vols::LightVol; use crate::traits::models::Model; use crate::traits::planes::Plane; use crate::traits::textures::Texture; -use crate::traits::tree::BSPNode; +use crate::traits::tree::BspNode; use crate::traits::vertices::{MeshVert, Vertex}; /// A parsed Quake 3 BSP File. -pub struct Q3BSPFile<T: CoordSystem> { +pub struct Q3BspFile<T: CoordSystem> { pub(crate) visdata: Box<[BitBox<Local, u8>]>, pub(crate) textures: Box<[Texture]>, pub(crate) entities: Box<[Entity]>, @@ -53,13 +53,13 @@ pub struct Q3BSPFile<T: CoordSystem> { pub(crate) effects: Box<[Effect]>, pub(crate) faces: Box<[Face]>, pub(crate) models: Box<[Model]>, - pub(crate) tree_root: BSPNode, + pub(crate) tree_root: BspNode, _phantom: PhantomData<T>, } -impl Q3BSPFile<Q3System> { +impl Q3BspFile<Q3System> { /// Parse `data` as a quake 3 bsp file. - pub fn parse_file(data: &[u8]) -> Result<Q3BSPFile<Q3System>> { + pub fn parse_file(data: &[u8]) -> Result<Q3BspFile<Q3System>> { let header = Header::from(data)?; let entities = entities::from_data(header.get_lump(&data, 0))?; @@ -101,7 +101,7 @@ impl Q3BSPFile<Q3System> { brushes.len() as u32, )?; - Ok(Q3BSPFile { + Ok(Q3BspFile { visdata, textures, entities, @@ -120,8 +120,8 @@ impl Q3BSPFile<Q3System> { } } -impl<T: CoordSystem> Q3BSPFile<T> { - pub fn swizzle_to<D: CoordSystem>(mut self) -> Q3BSPFile<D> +impl<T: CoordSystem> Q3BspFile<T> { + pub fn swizzle_to<D: CoordSystem>(mut self) -> Q3BspFile<D> where Swizzler: SwizzleFromTo<T, D>, { @@ -144,7 +144,7 @@ impl<T: CoordSystem> Q3BSPFile<T> { } // TODO: Possibly don't need to move? - Q3BSPFile { + Q3BspFile { visdata: self.visdata, textures: self.textures, entities: self.entities, |