mirror of
https://github.com/celisej567/LibBSP.git
synced 2026-09-11 20:09:36 +03:00
Add support for 007 Nightfire normals lump
This commit is contained in:
@@ -237,6 +237,22 @@ namespace LibBSP {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index for the vertex normals lump in the BSP file for a specific map format.
|
||||
/// </summary>
|
||||
/// <param name="type">The map type.</param>
|
||||
/// <returns>Index for this lump, or -1 if the format doesn't have this lump.</returns>
|
||||
public static int GetIndexForNormalsLump(MapType type) {
|
||||
switch (type) {
|
||||
case MapType.Nightfire: {
|
||||
return 5;
|
||||
}
|
||||
default: {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index for the patch vertices lump in the BSP file for a specific map format.
|
||||
/// </summary>
|
||||
|
||||
@@ -111,6 +111,7 @@ namespace LibBSP {
|
||||
// Nightfire
|
||||
private Textures _materials;
|
||||
private NumList _indices;
|
||||
private Lump<Vertex> _normals;
|
||||
// Source
|
||||
private Lump<Face> _originalFaces;
|
||||
private NumList _texTable;
|
||||
@@ -208,6 +209,21 @@ namespace LibBSP {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A <see cref="Lump{Vertex}"/> of <see cref="Vertex"/> objects in the BSP file representing the vertex normals of the BSP, if available.
|
||||
/// </summary>
|
||||
public Lump<Vertex> 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;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A <see cref="Lump{Node}"/> of <see cref="Node"/> objects in the BSP file, if available.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user