From c48b54f3fb7bbe9046915eb99eca02fa84dc55c9 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:22 +0100 Subject: feat(render): multithreaded texture loading also a bunch of supporting changes --- stockton-levels/src/q3/file.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'stockton-levels/src/q3/file.rs') 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 { +pub struct Q3BspFile { pub(crate) visdata: Box<[BitBox]>, pub(crate) textures: Box<[Texture]>, pub(crate) entities: Box<[Entity]>, @@ -53,13 +53,13 @@ pub struct Q3BSPFile { 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, } -impl Q3BSPFile { +impl Q3BspFile { /// Parse `data` as a quake 3 bsp file. - pub fn parse_file(data: &[u8]) -> Result> { + pub fn parse_file(data: &[u8]) -> Result> { let header = Header::from(data)?; let entities = entities::from_data(header.get_lump(&data, 0))?; @@ -101,7 +101,7 @@ impl Q3BSPFile { brushes.len() as u32, )?; - Ok(Q3BSPFile { + Ok(Q3BspFile { visdata, textures, entities, @@ -120,8 +120,8 @@ impl Q3BSPFile { } } -impl Q3BSPFile { - pub fn swizzle_to(mut self) -> Q3BSPFile +impl Q3BspFile { + pub fn swizzle_to(mut self) -> Q3BspFile where Swizzler: SwizzleFromTo, { @@ -144,7 +144,7 @@ impl Q3BSPFile { } // TODO: Possibly don't need to move? - Q3BSPFile { + Q3BspFile { visdata: self.visdata, textures: self.textures, entities: self.entities, -- cgit v1.2.3