Add and use BSP constants

This commit is contained in:
Matt Nadareski
2022-12-28 10:04:10 -08:00
parent e07b66812c
commit c3636a0743
3 changed files with 31 additions and 34 deletions

View File

@@ -3,35 +3,12 @@ using System.Linq;
using System.Text;
using BurnOutSharp.Models.BSP;
using BurnOutSharp.Utilities;
using static BurnOutSharp.Models.BSP.Constants;
namespace BurnOutSharp.Builders
{
public static class BSP
{
#region Constants
/// <summary>
/// Number of lumps in a BSP
/// </summary>
private const int HL_BSP_LUMP_COUNT = 15;
/// <summary>
/// Index for the entities lump
/// </summary>
public const int HL_BSP_LUMP_ENTITIES = 0;
/// <summary>
/// Index for the texture data lump
/// </summary>
public const int HL_BSP_LUMP_TEXTUREDATA = 2;
/// <summary>
/// Number of valid mipmap levels
/// </summary>
public const int HL_BSP_MIPMAP_COUNT = 4;
#endregion
#region Byte Data
/// <summary>

View File

@@ -0,0 +1,25 @@
namespace BurnOutSharp.Models.BSP
{
public static class Constants
{
/// <summary>
/// Number of lumps in a BSP
/// </summary>
public const int HL_BSP_LUMP_COUNT = 15;
/// <summary>
/// Index for the entities lump
/// </summary>
public const int HL_BSP_LUMP_ENTITIES = 0;
/// <summary>
/// Index for the texture data lump
/// </summary>
public const int HL_BSP_LUMP_TEXTUREDATA = 2;
/// <summary>
/// Number of valid mipmap levels
/// </summary>
public const int HL_BSP_MIPMAP_COUNT = 4;
}
}

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using static BurnOutSharp.Models.BSP.Constants;
namespace BurnOutSharp.Wrappers
{
@@ -41,12 +42,6 @@ namespace BurnOutSharp.Wrappers
#endregion
#region Extension Properties
// TODO: Figure out what extension oroperties are needed
#endregion
#region Instance Variables
/// <summary>
@@ -155,10 +150,10 @@ namespace BurnOutSharp.Wrappers
string specialLumpName = string.Empty;
switch (i)
{
case Builders.BSP.HL_BSP_LUMP_ENTITIES:
case HL_BSP_LUMP_ENTITIES:
specialLumpName = " (entities)";
break;
case Builders.BSP.HL_BSP_LUMP_TEXTUREDATA:
case HL_BSP_LUMP_TEXTUREDATA:
specialLumpName = " (texture data)";
break;
}
@@ -267,10 +262,10 @@ namespace BurnOutSharp.Wrappers
string filename = $"lump_{index}.bin";
switch (index)
{
case Builders.BSP.HL_BSP_LUMP_ENTITIES:
case HL_BSP_LUMP_ENTITIES:
filename = "entities.ent";
break;
case Builders.BSP.HL_BSP_LUMP_TEXTUREDATA:
case HL_BSP_LUMP_TEXTUREDATA:
filename = "texture_data.bin";
break;
}