1
0
Fork 0
mirror of https://codeberg.org/icewind/vbsp.git synced 2026-06-03 10:44:07 +02:00

no face normals for now for semver

This commit is contained in:
Robin Appelman 2023-12-21 18:09:33 +01:00
commit f0d614e60c
4 changed files with 55 additions and 68 deletions

View file

@ -500,6 +500,10 @@ impl Packfile {
};
result
}
pub fn into_zip(self) -> Mutex<ZipArchive<Cursor<Vec<u8>>>> {
self.zip
}
}
fn try_read_enum<Enum, Reader, Error, ErrorFn>(

View file

@ -155,7 +155,6 @@ impl<'a> IntoIterator for &'a mut Leaves {
// TODO: Store all the allocated objects inline to improve cache usage
/// A parsed bsp file
#[derive(Debug)]
#[non_exhaustive]
pub struct Bsp {
pub header: Header,
pub entities: Entities,
@ -180,8 +179,6 @@ pub struct Bsp {
pub displacements: Vec<DisplacementInfo>,
pub displacement_vertices: Vec<DisplacementVertex>,
pub displacement_triangles: Vec<DisplacementTriangle>,
vertex_normals: Vec<VertNormal>,
vertex_normal_indices: Vec<VertNormalIndex>,
pub static_props: PropStaticGameLump,
pub pack: Packfile,
}
@ -256,12 +253,6 @@ impl Bsp {
let displacement_triangles = bsp_file
.lump_reader(LumpType::DisplacementTris)?
.read_vec(|r| r.read())?;
let vertex_normals = bsp_file
.lump_reader(LumpType::VertNormals)?
.read_vec(|r| r.read())?;
let vertex_normal_indices = bsp_file
.lump_reader(LumpType::VertNormalIndices)?
.read_vec(|r| r.read())?;
let game_lumps: GameLumpHeader = bsp_file.lump_reader(LumpType::GameLump)?.read()?;
let pack = Packfile::read(bsp_file.lump_reader(LumpType::PakFile)?.into_data())?;
@ -293,8 +284,6 @@ impl Bsp {
displacements,
displacement_vertices,
displacement_triangles,
vertex_normals,
vertex_normal_indices,
static_props,
pack,
};
@ -498,12 +487,6 @@ impl Bsp {
"static props",
"static prop models",
)?;
self.validate_indexes(
self.vertex_normal_indices.iter().map(|i| i.index),
&self.vertex_normals,
"vertex normal indices",
"vertex normals",
)?;
if self.nodes.is_empty() {
return Err(ValidationError::NoRootNode.into());