diff --git a/LibBSP/LibBSP.csproj b/LibBSP/LibBSP.csproj index 8712d6d..c73d125 100644 --- a/LibBSP/LibBSP.csproj +++ b/LibBSP/LibBSP.csproj @@ -40,7 +40,10 @@ + + + @@ -67,7 +70,7 @@ - + diff --git a/LibBSP/src/Extensions/PlaneExtensions.cs b/LibBSP/src/Extensions/PlaneExtensions.cs index db06e5a..257d342 100644 --- a/LibBSP/src/Extensions/PlaneExtensions.cs +++ b/LibBSP/src/Extensions/PlaneExtensions.cs @@ -210,7 +210,6 @@ namespace LibBSP { } } List lump = new List(data.Length / structLength); - byte[] bytes = new byte[structLength]; for (int i = 0; i < data.Length / structLength; ++i) { Vector3 normal = new Vector3(BitConverter.ToSingle(data, data.Length * i), BitConverter.ToSingle(data, (data.Length * i) + 4), BitConverter.ToSingle(data, (data.Length * i) + 8)); float distance = BitConverter.ToSingle(data, (data.Length * i) + 12); diff --git a/LibBSP/src/Structs/Common/NumList.cs b/LibBSP/src/Structs/Common/Lumps/NumList.cs similarity index 97% rename from LibBSP/src/Structs/Common/NumList.cs rename to LibBSP/src/Structs/Common/Lumps/NumList.cs index 1644253..378093a 100644 --- a/LibBSP/src/Structs/Common/NumList.cs +++ b/LibBSP/src/Structs/Common/Lumps/NumList.cs @@ -197,6 +197,17 @@ namespace LibBSP { /// Index for this lump, or -1 if the format doesn't have this lump or it's not implemented public static int GetIndexForMarkBrushesLump(MapType version, out DataType dataType) { switch (version) { + case MapType.Quake3: + case MapType.MOHAA: + case MapType.FAKK: { + dataType = DataType.UInt32; + return 6; + } + case MapType.STEF2: + case MapType.STEF2Demo: { + dataType = DataType.UInt32; + return 8; + } case MapType.Quake2: case MapType.SiN: case MapType.Daikatana: diff --git a/LibBSP/src/Util/BSPReader.cs b/LibBSP/src/Util/BSPReader.cs index 168b9ec..43c2b70 100644 --- a/LibBSP/src/Util/BSPReader.cs +++ b/LibBSP/src/Util/BSPReader.cs @@ -7,7 +7,6 @@ namespace LibBSP { /// Handles reading of a BSP file on-demand. /// public class BSPReader { - private FileInfo bspFile; private FileStream stream; private BinaryReader binaryReader; @@ -26,7 +25,6 @@ namespace LibBSP { if (!File.Exists(file.FullName)) { throw new FileNotFoundException("Unable to open BSP file; file " + file.FullName + " not found."); } else { - this.bspFile = file; this.stream = new FileStream(file.FullName, FileMode.Open); this.binaryReader = new BinaryReader(this.stream); }