diff --git a/LibBSP/Source/Extensions/VertexExtensions.cs b/LibBSP/Source/Extensions/VertexExtensions.cs
index 8cb7d0a..a93d3bc 100644
--- a/LibBSP/Source/Extensions/VertexExtensions.cs
+++ b/LibBSP/Source/Extensions/VertexExtensions.cs
@@ -237,6 +237,22 @@ namespace LibBSP {
}
}
+ ///
+ /// Gets the index for the vertex normals lump in the BSP file for a specific map format.
+ ///
+ /// The map type.
+ /// Index for this lump, or -1 if the format doesn't have this lump.
+ public static int GetIndexForNormalsLump(MapType type) {
+ switch (type) {
+ case MapType.Nightfire: {
+ return 5;
+ }
+ default: {
+ return -1;
+ }
+ }
+ }
+
///
/// Gets the index for the patch vertices lump in the BSP file for a specific map format.
///
diff --git a/LibBSP/Source/Structs/BSP/BSP.cs b/LibBSP/Source/Structs/BSP/BSP.cs
index 35a42f7..e870af9 100644
--- a/LibBSP/Source/Structs/BSP/BSP.cs
+++ b/LibBSP/Source/Structs/BSP/BSP.cs
@@ -111,6 +111,7 @@ namespace LibBSP {
// Nightfire
private Textures _materials;
private NumList _indices;
+ private Lump _normals;
// Source
private Lump _originalFaces;
private NumList _texTable;
@@ -208,6 +209,21 @@ namespace LibBSP {
}
}
+ ///
+ /// A of objects in the BSP file representing the vertex normals of the BSP, if available.
+ ///
+ public Lump normals {
+ get {
+ if (_normals == null) {
+ int index = VertexExtensions.GetIndexForNormalsLump(version);
+ if (index >= 0) {
+ _normals = VertexExtensions.LumpFactory(reader.ReadLump(this[index]), this, this[index]);
+ }
+ }
+ return _normals;
+ }
+ }
+
///
/// A of objects in the BSP file, if available.
///