mirror of
https://github.com/celisej567/LibBSP.git
synced 2026-09-11 20:09:36 +03:00
Some cleanups. Fix compiler warnings, and move NumList into the Lumps folder.
This commit is contained in:
@@ -40,7 +40,10 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="src\Attributes\CountAttribute.cs" />
|
||||
<Compile Include="src\Attributes\IndexAttribute.cs" />
|
||||
<Compile Include="src\Extensions\Color32Extensions.cs" />
|
||||
<Compile Include="src\Extensions\CustomAttributeExtensions.cs" />
|
||||
<Compile Include="src\Extensions\PlaneExtensions.cs" />
|
||||
<Compile Include="src\Extensions\RectExtensions.cs" />
|
||||
<Compile Include="src\Extensions\StringExtensions.cs" />
|
||||
@@ -67,7 +70,7 @@
|
||||
<Compile Include="src\Structs\BSP\Texture.cs" />
|
||||
<Compile Include="src\Structs\Common\Entity.cs" />
|
||||
<Compile Include="src\Structs\Common\Lumps\Entities.cs" />
|
||||
<Compile Include="src\Structs\Common\NumList.cs" />
|
||||
<Compile Include="src\Structs\Common\Lumps\NumList.cs" />
|
||||
<Compile Include="src\Structs\Common\Rect.cs" />
|
||||
<Compile Include="src\Structs\Doom\Linedef.cs" />
|
||||
<Compile Include="src\Structs\Doom\DoomMap.cs" />
|
||||
|
||||
@@ -210,7 +210,6 @@ namespace LibBSP {
|
||||
}
|
||||
}
|
||||
List<Plane> lump = new List<Plane>(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);
|
||||
|
||||
@@ -197,6 +197,17 @@ namespace LibBSP {
|
||||
/// <returns>Index for this lump, or -1 if the format doesn't have this lump or it's not implemented</returns>
|
||||
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:
|
||||
@@ -7,7 +7,6 @@ namespace LibBSP {
|
||||
/// Handles reading of a BSP file on-demand.
|
||||
/// </summary>
|
||||
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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user