mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-09-21 22:35:06 +00:00
BSP model cleanup
This commit is contained in:
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Indicies
|
||||
/// </summary>
|
||||
public LeafAmbientIndex[]? Indicies { get; set; }
|
||||
public LeafAmbientIndex[] Indicies { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Lightings
|
||||
/// </summary>
|
||||
public LeafAmbientLighting[]? Lightings { get; set; }
|
||||
public LeafAmbientLighting[] Lightings { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,4 +30,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public VbspContents Contents;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Brushes
|
||||
/// </summary>
|
||||
public Brush[]? Brushes { get; set; }
|
||||
public Brush[] Brushes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// references into the texture and displacement info lumps.
|
||||
/// Bevel is zero for normal brush sides, but 1 if the side is
|
||||
/// a bevel plane (which seem to be used for collision detection).
|
||||
///
|
||||
///
|
||||
/// Unlike the face array, brushsides are not culled (removed)
|
||||
/// where they touch the void. Void-facing sides do however have
|
||||
/// their texinfo entry changed to the tools/toolsnodraw texture
|
||||
@@ -17,7 +17,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// entries which are used to render that brush. Brushsides are
|
||||
/// used by the engine to calculate all player physics collision
|
||||
/// with world brushes. (Vphysics objects use lump 29 instead.)
|
||||
///
|
||||
///
|
||||
/// The maximum number of brushsides is 65536 (MAX_MAP_BRUSHSIDES).
|
||||
/// The maximum number of brushsides on a single brush is 128 (MAX_BRUSH_SIDES).
|
||||
/// </summary>
|
||||
@@ -45,4 +45,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public short Bevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Brushsides
|
||||
/// </summary>
|
||||
public Brushside[]? Brushsides { get; set; }
|
||||
public Brushside[] Brushsides { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspFacesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Faces
|
||||
/// </summary>
|
||||
public BspFace[]? Faces { get; set; }
|
||||
public BspFace[] Faces { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,85 +10,85 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Header data
|
||||
/// </summary>
|
||||
public BspHeader? Header { get; set; }
|
||||
public BspHeader Header { get; set; }
|
||||
|
||||
#region Lumps
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_ENTITIES [0]
|
||||
/// </summary>
|
||||
public EntitiesLump? Entities { get; set; }
|
||||
public EntitiesLump Entities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PLANES [1]
|
||||
/// </summary>
|
||||
public PlanesLump? PlanesLump { get; set; }
|
||||
public PlanesLump PlanesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXTURES [2]
|
||||
/// </summary>
|
||||
public TextureLump? TextureLump { get; set; }
|
||||
public TextureLump TextureLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VERTICES [3]
|
||||
/// </summary>
|
||||
public VerticesLump? VerticesLump { get; set; }
|
||||
public VerticesLump VerticesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VISIBILITY [4]
|
||||
/// </summary>
|
||||
public VisibilityLump? VisibilityLump { get; set; }
|
||||
public VisibilityLump VisibilityLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_NODES [5]
|
||||
/// </summary>
|
||||
public BspNodesLump? NodesLump { get; set; }
|
||||
public BspNodesLump NodesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXINFO [6]
|
||||
/// </summary>
|
||||
public BspTexinfoLump? TexinfoLump { get; set; }
|
||||
public BspTexinfoLump TexinfoLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_FACES [7]
|
||||
/// </summary>
|
||||
public BspFacesLump? FacesLump { get; set; }
|
||||
public BspFacesLump FacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LIGHTING [8]
|
||||
/// </summary>
|
||||
public LightmapLump? LightmapLump { get; set; }
|
||||
public LightmapLump LightmapLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_CLIPNODES [9]
|
||||
/// </summary>s
|
||||
public ClipnodesLump? ClipnodesLump { get; set; }
|
||||
public ClipnodesLump ClipnodesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAVES [10]
|
||||
/// </summary>
|
||||
public BspLeavesLump? LeavesLump { get; set; }
|
||||
public BspLeavesLump LeavesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_MARKSURFACES [11]
|
||||
/// </summary>
|
||||
public MarksurfacesLump? MarksurfacesLump { get; set; }
|
||||
public MarksurfacesLump MarksurfacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_EDGES [12]
|
||||
/// </summary>
|
||||
public EdgesLump? EdgesLump { get; set; }
|
||||
public EdgesLump EdgesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_SURFEDGES [13]
|
||||
/// </summary>
|
||||
public SurfedgesLump? SurfedgesLump { get; set; }
|
||||
public SurfedgesLump SurfedgesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_MODELS [14]
|
||||
/// </summary>
|
||||
public BspModelsLump? ModelsLump { get; set; }
|
||||
public BspModelsLump ModelsLump { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
/// <remarks>15 entries</remarks>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.BSP_HEADER_LUMPS)]
|
||||
public BspLumpEntry[]? Lumps;
|
||||
public BspLumpEntry[] Lumps = new BspLumpEntry[Constants.BSP_HEADER_LUMPS];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspLeavesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Leaves
|
||||
/// </summary>
|
||||
public BspLeaf[]? Leaves { get; set; }
|
||||
public BspLeaf[] Leaves { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,4 +17,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public int Length;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,32 +18,32 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// clipnodes, but I am not sure about this. The meaning of the
|
||||
/// next value is also somehow unclear to me. Finally their are
|
||||
/// direct indexes into the faces array, not taking the redirecting
|
||||
/// by the marksurfaces.
|
||||
/// by the marksurfaces.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class BspModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
public Vector3D? Mins;
|
||||
public Vector3D Mins;
|
||||
|
||||
/// <summary>
|
||||
/// Defines bounding box
|
||||
/// </summary>
|
||||
public Vector3D? Maxs;
|
||||
public Vector3D Maxs;
|
||||
|
||||
/// <summary>
|
||||
/// Coordinates to move the coordinate system
|
||||
/// </summary>
|
||||
public Vector3D? OriginVector;
|
||||
public Vector3D OriginVector;
|
||||
|
||||
/// <summary>
|
||||
/// Index into nodes array
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MAX_MAP_HULLS)]
|
||||
public int[]? HeadnodesIndex = new int[Constants.MAX_MAP_HULLS];
|
||||
public int[] HeadnodesIndex = new int[Constants.MAX_MAP_HULLS];
|
||||
|
||||
/// <summary>
|
||||
/// ???
|
||||
@@ -60,4 +60,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public int FacesCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspModelsLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Model
|
||||
/// </summary>
|
||||
public BspModel[]? Models { get; set; }
|
||||
public BspModel[] Models { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// This lump is simple again and contains an array of binary
|
||||
/// structures, the nodes, which are a major part of the BSP tree.
|
||||
///
|
||||
///
|
||||
/// Every BSPNODE structure represents a node in the BSP tree and
|
||||
/// every node equals more or less a division step of the BSP algorithm.
|
||||
/// Therefore, each node has an index (iPlane) referring to a plane
|
||||
@@ -20,8 +20,8 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Finally firstFace indexes into the face lump and spezifies the
|
||||
/// first of nFaces surfaces contained in this node.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class BspNode
|
||||
{
|
||||
@@ -59,4 +59,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public ushort FaceCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspNodesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Nodes
|
||||
/// </summary>
|
||||
public BspNode[]? Nodes { get; set; }
|
||||
public BspNode[] Nodes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// The texinfo lump contains informations about how textures are
|
||||
/// applied to surfaces. The lump itself is an array of binary data
|
||||
/// structures.
|
||||
///
|
||||
///
|
||||
/// This struct is mainly responsible for the calculation of the texture
|
||||
/// coordinates (vS, fSShift, vT, fTShift). This values determine the
|
||||
/// position of the texture on the surface. The iMiptex integer refers
|
||||
@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// S-vector
|
||||
/// </summary>
|
||||
public Vector3D? SVector;
|
||||
public Vector3D SVector;
|
||||
|
||||
/// <summary>
|
||||
/// Texture shift in the S direction
|
||||
@@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// T-vector
|
||||
/// </summary>
|
||||
public Vector3D? TVector;
|
||||
public Vector3D TVector;
|
||||
|
||||
/// <summary>
|
||||
/// Texture shift in the T direction
|
||||
@@ -49,4 +49,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public TextureFlag Flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class BspTexinfoLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Texinfos
|
||||
/// </summary>
|
||||
public BspTexinfo[]? Texinfos { get; set; }
|
||||
public BspTexinfo[] Texinfos { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L600"/>
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L600"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CDispCornerNeighbors
|
||||
{
|
||||
@@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
public byte NeighborCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L583"/>
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L583"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CDispNeighbor
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public CDispSubNeighbor[]? SubNeighbors = new CDispSubNeighbor[2];
|
||||
public CDispSubNeighbor[] SubNeighbors = new CDispSubNeighbor[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ using System.Runtime.InteropServices;
|
||||
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L557"/>
|
||||
/// <see href="https://github.com/ValveSoftware/source-sdk-2013/blob/0d8dceea4310fde5706b3ce1c70609d72a38efdf/sp/src/public/bspfile.h#L557"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class CDispSubNeighbor
|
||||
{
|
||||
@@ -29,4 +29,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public byte NeighborSpan;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,12 +5,12 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// This lump contains the so-called clipnodes, which build a second
|
||||
/// BSP tree used only for collision detection.
|
||||
///
|
||||
///
|
||||
/// This structure is a reduced form of the BSPNODE struct from the
|
||||
/// nodes lump. Also the BSP tree built by the clipnodes is simpler
|
||||
/// than the one described by the BSPNODEs to accelerate collision calculations.
|
||||
/// than the one described by the BSPNODEs to accelerate collision calculations.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Clipnode
|
||||
{
|
||||
@@ -23,6 +23,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Negative numbers are contents
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public short[]? ChildrenIndices = new short[2];
|
||||
public short[] ChildrenIndices = new short[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class ClipnodesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Clipnodes
|
||||
/// </summary>
|
||||
public Clipnode[]? Clipnodes { get; set; }
|
||||
public Clipnode[] Clipnodes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// 4-byte lightmap structure
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class ColorRGBExp32
|
||||
{
|
||||
@@ -17,4 +17,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
public sbyte Exponent;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,11 +6,11 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// The lighting data for each sample is represented by an array
|
||||
/// of 6 ColorRGBExp32
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class CompressedLightCube
|
||||
{
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
|
||||
public ColorRGBExp32[]? Colors;
|
||||
public ColorRGBExp32[] Colors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public static class Constants
|
||||
{
|
||||
#region Header
|
||||
@@ -45,7 +45,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
public const int MAX_MAP_PORTALS = 65536;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Entities
|
||||
|
||||
public const int MAX_KEY = 32;
|
||||
@@ -61,7 +61,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
public const int MIPLEVELS = 4;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region VBSP
|
||||
|
||||
public static readonly byte[] SignatureBytes = [0x56, 0x42, 0x53, 0x50];
|
||||
@@ -79,15 +79,15 @@ namespace SabreTools.Data.Models.BSP
|
||||
public const string LzmaHeaderString = "LZMA";
|
||||
|
||||
public const uint LzmaHeaderUInt32 = 0x414D5A4C;
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Overlay
|
||||
|
||||
public const int OVERLAY_BSP_FACE_COUNT = 64;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Worldlights
|
||||
|
||||
/// <summary>
|
||||
@@ -97,4 +97,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,16 +9,16 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// is resolution of the cubemap, specified as 2^(size-1) pixels
|
||||
/// square. If set as 0, the default size of 6 (32x32 pixels) is
|
||||
/// used. There can be a maximum of 1024 (MAX_MAP_CUBEMAPSAMPLES)
|
||||
/// cubemaps in a file.
|
||||
///
|
||||
/// cubemaps in a file.
|
||||
///
|
||||
/// When the "buildcubemaps" console command is performed, six
|
||||
/// snapshots of the map (one for each direction) are taken at the
|
||||
/// location of each env_cubemap entity. These snapshots are stored
|
||||
/// in a multi-frame texture (vtf) file, which is added to the
|
||||
/// Pakfile lump (see above). The textures are named cX_Y_Z.vtf,
|
||||
/// where (X,Y,Z) are the (integer) coordinates of the corresponding
|
||||
/// cubemap.
|
||||
///
|
||||
/// cubemap.
|
||||
///
|
||||
/// Faces containing materials that are environment mapped (e.g.
|
||||
/// shiny textures) reference their assigned cubemap through their
|
||||
/// material name. A face with a material named (e.g.) walls/shiny.vmt
|
||||
@@ -26,11 +26,11 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// to a renamed material maps/mapname/walls/shiny_X_Y_Z.vmt, where
|
||||
/// (X,Y,Z) are the cubemap coordinates as before. This .vmt file
|
||||
/// is also stored in the Pakfile, and references the cubemap .vtf
|
||||
/// file through its $envmap property.
|
||||
///
|
||||
/// file through its $envmap property.
|
||||
///
|
||||
/// Version 20 files contain extra cX_Y_Z.hdr.vtf files in the
|
||||
/// Pakfile lump, containing HDR texture files in RGBA16161616F
|
||||
/// (16-bit per channel) format.
|
||||
/// (16-bit per channel) format.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -40,11 +40,11 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Position of light snapped to the nearest integer
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
||||
public int[]? Origin = new int[3];
|
||||
public int[] Origin = new int[3];
|
||||
|
||||
/// <summary>
|
||||
/// Resolution of cubemap, 0 - default
|
||||
/// </summary>
|
||||
public int Size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Cubemaps
|
||||
/// </summary>
|
||||
public Cubemap[]? Cubemaps { get; set; }
|
||||
public Cubemap[] Cubemaps { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,14 +18,14 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// This face is used to set the texture and overall physical location
|
||||
/// and boundaries of the displacement.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class DispInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Start position used for orientation
|
||||
/// </summary>
|
||||
public Vector3D? StartPosition;
|
||||
public Vector3D StartPosition;
|
||||
|
||||
/// <summary>
|
||||
/// Index into LUMP_DISP_VERTS.
|
||||
@@ -76,18 +76,18 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Indexed by NEIGHBOREDGE_ defines.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public CDispNeighbor[]? EdgeNeighbors = new CDispNeighbor[4];
|
||||
public CDispNeighbor[] EdgeNeighbors = new CDispNeighbor[4];
|
||||
|
||||
/// <summary>
|
||||
/// Indexed by CORNER_ defines.
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public CDispCornerNeighbors[]? CornerNeighbors = new CDispCornerNeighbors[4];
|
||||
public CDispCornerNeighbors[] CornerNeighbors = new CDispCornerNeighbors[4];
|
||||
|
||||
/// <summary>
|
||||
/// Active verticies
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
||||
public uint[]? AllowedVerts = new uint[10];
|
||||
public uint[] AllowedVerts = new uint[10];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Infos
|
||||
/// </summary>
|
||||
public DispInfo[]? Infos { get; set; }
|
||||
public DispInfo[] Infos { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Tris
|
||||
/// </summary>
|
||||
public DispTri[]? Tris { get; set; }
|
||||
public DispTri[] Tris { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,18 +7,18 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// vec is the normalized vector of the offset of each displacement vertex from
|
||||
/// its original (flat) position; dist is the distance the offset has taken
|
||||
/// place; and alpha is the alpha-blending of the texture at that vertex.
|
||||
///
|
||||
///
|
||||
/// A displacement of power p references (2^p + 1)^2 dispverts in the array,
|
||||
/// starting from the DispVertStart index.
|
||||
/// starting from the DispVertStart index.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class DispVert
|
||||
{
|
||||
/// <summary>
|
||||
/// Vector field defining displacement volume.
|
||||
/// </summary>
|
||||
public Vector3D? Vec;
|
||||
public Vector3D Vec;
|
||||
|
||||
/// <summary>
|
||||
/// Displacement distances.
|
||||
@@ -30,4 +30,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public float Alpha;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Verts
|
||||
/// </summary>
|
||||
public DispVert[]? Verts { get; set; }
|
||||
public DispVert[] Verts { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@ namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The edges delimit the face and further refer to the vertices of the
|
||||
/// face. Each edge is pointing to the start and end vertex of the edge.
|
||||
/// face. Each edge is pointing to the start and end vertex of the edge.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Edge
|
||||
@@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Indices into vertex array
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public ushort[]? VertexIndices = new ushort[2];
|
||||
public ushort[] VertexIndices = new ushort[2];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class EdgesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Edge
|
||||
/// </summary>
|
||||
public Edge[]? Edges { get; set; }
|
||||
public Edge[] Edges { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class EntitiesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Entities
|
||||
/// </summary>
|
||||
public Entity[]? Entities { get; set; }
|
||||
public Entity[] Entities { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,22 +7,22 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// It consists of the string representations of all entities,
|
||||
/// which are copied directly from the input file to the output
|
||||
/// BSP file by the compiler.
|
||||
///
|
||||
///
|
||||
/// Every entity begins and ends with curly brackets. In between
|
||||
/// there are the attributes of the entity, one in each line,
|
||||
/// which are pairs of strings enclosed by quotes. The first
|
||||
/// string is the name of the attribute (the key), the second one
|
||||
/// its value. The attribute "classname" is mandatory for every
|
||||
/// entity specifiying its type and therefore, how it is
|
||||
/// interpreted by the engine.
|
||||
/// interpreted by the engine.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class Entity
|
||||
{
|
||||
/// <summary>
|
||||
/// Entity attributes
|
||||
/// </summary>
|
||||
public List<KeyValuePair<string, string>>? Attributes { get; set; }
|
||||
public List<KeyValuePair<string, string>> Attributes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ using System;
|
||||
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public enum BspContents : int
|
||||
{
|
||||
CONTENTS_EMPTY = -1,
|
||||
@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
CONTENTS_TRANSLUCENT = -15,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_flags_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_flags_(Source)"/>
|
||||
[Flags]
|
||||
public enum VbspContents : uint
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
CONTENTS_EMPTY = 0x00000000,
|
||||
|
||||
/// <summary>
|
||||
/// An eye is never valid in a solid
|
||||
/// An eye is never valid in a solid
|
||||
/// </summary>
|
||||
CONTENTS_SOLID = 0x00000001,
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
CONTENTS_MIST = 0x00000040,
|
||||
|
||||
/// <summary>
|
||||
/// Block AI line of sight
|
||||
/// Block AI line of sight
|
||||
/// </summary>
|
||||
CONTENTS_BLOCKLOS = 0x00000040,
|
||||
|
||||
@@ -101,13 +101,13 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
/// <summary>
|
||||
/// Per team contents used to differentiate collisions
|
||||
/// between players and objects on different teams
|
||||
/// between players and objects on different teams
|
||||
/// </summary>
|
||||
CONTENTS_TEAM1 = 0x00000800,
|
||||
|
||||
/// <summary>
|
||||
/// Per team contents used to differentiate collisions
|
||||
/// between players and objects on different teams
|
||||
/// between players and objects on different teams
|
||||
/// </summary>
|
||||
CONTENTS_TEAM2 = 0x00001000,
|
||||
|
||||
@@ -215,12 +215,12 @@ namespace SabreTools.Data.Models.BSP
|
||||
CONTENTS_LADDER = 0x20000000,
|
||||
|
||||
/// <summary>
|
||||
/// Use accurate hitboxes on trace
|
||||
/// Use accurate hitboxes on trace
|
||||
/// </summary>
|
||||
CONTENTS_HITBOX = 0x40000000,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[Flags]
|
||||
public enum DispTriTag : ushort
|
||||
{
|
||||
@@ -231,7 +231,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
DISPTRI_FLAG_SURFPROP2 = 0x10,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public enum EmitType
|
||||
{
|
||||
/// <summary>
|
||||
@@ -267,8 +267,8 @@ namespace SabreTools.Data.Models.BSP
|
||||
EMIT_SKYAMBIENT,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public enum LumpType : int
|
||||
{
|
||||
#region BSP and VBSP
|
||||
@@ -292,14 +292,14 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// The texture lump is somehow a bit more complex then the
|
||||
/// other lumps, because it is possible to save textures
|
||||
/// directly within the BSP file instead of storing them in
|
||||
/// external WAD files.
|
||||
/// external WAD files.
|
||||
/// </summary>
|
||||
/// <remarks>LUMP_TEXDATA in VBSP</remarks>
|
||||
LUMP_TEXTURES = 2,
|
||||
|
||||
/// <summary>
|
||||
/// This lump simply consists of all vertices of the BSP tree.
|
||||
/// They are stored as a primitve array of triples of floats.
|
||||
/// They are stored as a primitve array of triples of floats.
|
||||
/// </summary>
|
||||
/// <remarks>LUMP_VERTEXES in VBSP</remarks>
|
||||
LUMP_VERTICES = 3,
|
||||
@@ -312,20 +312,20 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Potentially Visible Sets (PVS) (also called VIS lists) in the
|
||||
/// same amout of leaves of the tree, the user can enter (often
|
||||
/// referred to as VisLeaves). The visiblilty lists are stored as
|
||||
/// sequences of bitfields, which are run-length encoded.
|
||||
/// sequences of bitfields, which are run-length encoded.
|
||||
/// </summary>
|
||||
LUMP_VISIBILITY = 4,
|
||||
|
||||
/// <summary>
|
||||
/// This lump is simple again and contains an array of binary
|
||||
/// structures, the nodes, which are a major part of the BSP tree.
|
||||
/// structures, the nodes, which are a major part of the BSP tree.
|
||||
/// </summary>
|
||||
LUMP_NODES = 5,
|
||||
|
||||
/// <summary>
|
||||
/// The texinfo lump contains informations about how textures are
|
||||
/// applied to surfaces. The lump itself is an array of binary data
|
||||
/// structures.
|
||||
/// structures.
|
||||
/// </summary>
|
||||
LUMP_TEXINFO = 6,
|
||||
|
||||
@@ -338,13 +338,13 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// This is one of the largest lumps in the BSP file. The lightmap
|
||||
/// lump stores all lightmaps used in the entire map. The lightmaps
|
||||
/// are arrays of triples of bytes (3 channel color, RGB) and stored
|
||||
/// continuously.
|
||||
/// continuously.
|
||||
/// </summary>
|
||||
LUMP_LIGHTING = 8,
|
||||
|
||||
/// <summary>
|
||||
/// This lump contains the so-called clipnodes, which build a second
|
||||
/// BSP tree used only for collision detection.
|
||||
/// BSP tree used only for collision detection.
|
||||
/// </summary>
|
||||
/// <remarks>LUMP_OCCLUSION in VBSP</remarks>
|
||||
LUMP_CLIPNODES = 9,
|
||||
@@ -363,7 +363,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
/// <summary>
|
||||
/// The edges delimit the face and further refer to the vertices of the
|
||||
/// face. Each edge is pointing to the start and end vertex of the edge.
|
||||
/// face. Each edge is pointing to the start and end vertex of the edge.
|
||||
/// </summary>
|
||||
LUMP_EDGES = 12,
|
||||
|
||||
@@ -375,7 +375,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// or negative. If the value of the surfedge is positive, the first vertex
|
||||
/// of the edge is used as vertex for rendering the face, otherwise, the
|
||||
/// value is multiplied by -1 and the second vertex of the indexed edge is
|
||||
/// used.
|
||||
/// used.
|
||||
/// </summary>
|
||||
LUMP_SURFEDGES = 13,
|
||||
|
||||
@@ -711,7 +711,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
#endregion
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public enum PlaneType : int
|
||||
{
|
||||
// Plane is perpendicular to given axis
|
||||
@@ -725,7 +725,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
PLANE_ANYZ = 5,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)/Static_prop_flags"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)/Static_prop_flags"/>
|
||||
[Flags]
|
||||
public enum StaticPropFlags : uint
|
||||
{
|
||||
@@ -787,7 +787,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
STATIC_PROP_NO_PER_TEXEL_LIGHTING = 0x100,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)/Static_prop_flags"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)/Static_prop_flags"/>
|
||||
[Flags]
|
||||
public enum StaticPropFlagsEx : uint
|
||||
{
|
||||
@@ -807,7 +807,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
STATIC_PROP_FLAGS_EX_ENABLE_LIGHT_BOUNCE = 0x00000004,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_flags_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_flags_(Source)"/>
|
||||
[Flags]
|
||||
public enum SurfaceFlag : uint
|
||||
{
|
||||
@@ -908,12 +908,12 @@ namespace SabreTools.Data.Models.BSP
|
||||
SURF_NOCHOP = 0x4000,
|
||||
|
||||
/// <summary>
|
||||
/// Surface is part of a hitbox
|
||||
/// Surface is part of a hitbox
|
||||
/// </summary>
|
||||
SURF_HITBOX = 0x8000,
|
||||
}
|
||||
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[Flags]
|
||||
public enum TextureFlag : uint
|
||||
{
|
||||
@@ -923,4 +923,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <remarks>Used by sky and liquids</remarks>
|
||||
DisableLightmaps = 0x01,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ namespace SabreTools.Data.Models.BSP
|
||||
public int LumpCount;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="LumpCount"/>
|
||||
/// <see cref="LumpCount"/>
|
||||
/// </summary>
|
||||
public GameLumpDirectory[]? Directories;
|
||||
public GameLumpDirectory[] Directories;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,4 +37,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public int FileLength;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
public ushort FirstAmbientSample;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public byte Pad;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Map
|
||||
/// </summary>
|
||||
public ushort[]? Map { get; set; }
|
||||
public ushort[] Map { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Map
|
||||
/// </summary>
|
||||
public ushort[]? Map { get; set; }
|
||||
public ushort[] Map { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,15 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// This is one of the largest lumps in the BSP file. The lightmap
|
||||
/// lump stores all lightmaps used in the entire map. The lightmaps
|
||||
/// are arrays of triples of bytes (3 channel color, RGB) and stored
|
||||
/// continuously.
|
||||
/// continuously.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class LightmapLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Lightmap RGB values
|
||||
/// </summary>
|
||||
/// <remarks>Array of 3-byte values</remarks>
|
||||
public byte[][]? Lightmap { get; set; }
|
||||
public byte[][] Lightmap { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Represents a common Lump type
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public abstract class Lump
|
||||
{
|
||||
// No shared fields between types
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,18 +2,18 @@ namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The marksurfaces lump is a simple array of short integers.
|
||||
///
|
||||
///
|
||||
/// This lump is a simple table for redirecting the marksurfaces
|
||||
/// indexes in the leafs to the actial face indexes. A leaf inserts
|
||||
/// it's marksurface indexes into this array and gets the associated
|
||||
/// faces contained within this leaf.
|
||||
/// faces contained within this leaf.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class MarksurfacesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Marksurfaces
|
||||
/// </summary>
|
||||
public ushort[]? Marksurfaces { get; set; }
|
||||
public ushort[] Marksurfaces { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// texture lump relative to the beginning of it's BSPMIPTEX struct.
|
||||
/// </summary>
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class MipTexture
|
||||
{
|
||||
@@ -24,7 +24,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.MAXTEXTURENAME)]
|
||||
public string? Name;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Extends of the texture
|
||||
/// </summary>
|
||||
@@ -39,6 +39,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Offsets to texture mipmaps BSPMIPTEX
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MIPLEVELS)]
|
||||
public uint[]? Offsets;
|
||||
public uint[] Offsets;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,14 +27,14 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Minima of all vertices
|
||||
/// </summary>
|
||||
public Vector3D? Mins;
|
||||
public Vector3D Mins;
|
||||
|
||||
/// <summary>
|
||||
/// Maxima of all vertices
|
||||
/// </summary>
|
||||
public Vector3D? Maxs;
|
||||
public Vector3D Maxs;
|
||||
|
||||
/// <remarks>Since v1</remarks>
|
||||
public int Area;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,4 +26,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
public int PlanEnum;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Brush sides textured with tools/toolsoccluder or tools/toolstrigger
|
||||
/// are then stored together with the occluder keys and some additional
|
||||
/// info in this lump.
|
||||
///
|
||||
///
|
||||
/// The lump is divided into three parts and begins with a integer value
|
||||
/// with the total number of occluders, followed by an array of
|
||||
/// doccluderdata_t fields of the same size. The next part begins with
|
||||
@@ -27,20 +27,20 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// <see cref="Count">
|
||||
/// </summary>
|
||||
public OccluderData[]? Data;
|
||||
|
||||
public OccluderData[] Data;
|
||||
|
||||
public int PolyDataCount;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="PolyDataCount">
|
||||
/// </summary>
|
||||
public OccluderPolyData[]? PolyData;
|
||||
public OccluderPolyData[] PolyData;
|
||||
|
||||
public int VertexIndexCount;
|
||||
|
||||
/// <summary>
|
||||
/// <see cref="VertexIndexCount">
|
||||
/// </summary>
|
||||
public int[]? VertexIndicies;
|
||||
public int[] VertexIndicies;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Unlike the simpler decals (infodecal entities), info_overlays
|
||||
/// are removed from the entity lump and stored separately in the
|
||||
/// Overlay lump (Lump 45).
|
||||
///
|
||||
/// Overlay lump (Lump 45).
|
||||
///
|
||||
/// The FaceCountAndRenderOrder member is split into two parts;
|
||||
/// the lower 14 bits are the number of faces that the overlay
|
||||
/// appears on, with the top 2 bits being the render order of
|
||||
@@ -17,7 +17,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// scale, and orientation of the overlay decal. There is no
|
||||
/// enforced limit on overlays inside the engine. VBSP enforces
|
||||
/// a limit of 512 (MAX_MAP_OVERLAYS, 1024 in Counter-Strike:
|
||||
/// Global Offensive), but custom compilers can circumvent this.
|
||||
/// Global Offensive), but custom compilers can circumvent this.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
@@ -30,19 +30,19 @@ namespace SabreTools.Data.Models.BSP
|
||||
public ushort FaceCountAndRenderOrder;
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.OVERLAY_BSP_FACE_COUNT)]
|
||||
public int[]? Ofaces = new int[Constants.OVERLAY_BSP_FACE_COUNT];
|
||||
public int[] Ofaces = new int[Constants.OVERLAY_BSP_FACE_COUNT];
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public float[]? U = new float[2];
|
||||
public float[] U = new float[2];
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public float[]? V = new float[2];
|
||||
public float[] V = new float[2];
|
||||
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
||||
public Vector3D[]? UVPoints = new Vector3D[4];
|
||||
public Vector3D[] UVPoints = new Vector3D[4];
|
||||
|
||||
public Vector3D? Origin;
|
||||
public Vector3D Origin;
|
||||
|
||||
public Vector3D? BasisNormal;
|
||||
public Vector3D BasisNormal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Overlays
|
||||
/// </summary>
|
||||
public Overlay[]? Overlays { get; set; }
|
||||
public Overlay[] Overlays { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Models
|
||||
/// </summary>
|
||||
public PhysModel[]? Models { get; set; }
|
||||
public PhysModel[] Models { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Collision data of length <see cref="SolidCount"/>
|
||||
/// </summary>
|
||||
public PhysSolid[]? Solids;
|
||||
public PhysSolid[] Solids;
|
||||
|
||||
/// <summary>
|
||||
/// Key data of size <see cref="KeydataSize"/>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Each of this structures defines a plane in 3-dimensional
|
||||
/// space by using the Hesse normal form: normal * point - distance = 0
|
||||
///
|
||||
///
|
||||
/// Where vNormal is the normalized normal vector of the plane
|
||||
/// and fDist is the distance of the plane to the origin of
|
||||
/// the coord system. Additionally, the structure also saves an
|
||||
@@ -15,9 +15,9 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// to the x axis. If nType equals PLANE_ANYX, then the plane's
|
||||
/// normal is nearer to the x axis then to any other axis.
|
||||
/// This information is used by the renderer to speed up some
|
||||
/// computations.
|
||||
/// computations.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class Plane
|
||||
@@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// The planes normal vector
|
||||
/// </summary>
|
||||
public Vector3D? NormalVector;
|
||||
public Vector3D NormalVector;
|
||||
|
||||
/// <summary>
|
||||
/// Plane equation is: vNormal * X = fDist
|
||||
@@ -37,4 +37,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public PlaneType PlaneType;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class PlanesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Planes
|
||||
/// </summary>
|
||||
public Plane[]? Planes { get; set; }
|
||||
public Plane[] Planes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
public float Y;
|
||||
public float Z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// most other entities, static props are not stored in the entity lump. The
|
||||
/// gamelump formats used in Source are defined in the public/gamebspfile.h
|
||||
/// header file.
|
||||
///
|
||||
///
|
||||
/// The first element of the static prop game lump is the dictionary; this is
|
||||
/// an integer count followed by the list of model (prop) names used in the map
|
||||
/// </summary>
|
||||
@@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Model name
|
||||
/// </summary>
|
||||
/// <remarks>[dictEntries][128]</remarks>
|
||||
public char[][]? Name;
|
||||
public char[][] Name;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// <see cref="LeafEntries">
|
||||
/// </summary>
|
||||
public ushort[]? Leaf;
|
||||
public ushort[] Leaf;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Counter-Strike: Global Offensive since the addition of uniform prop scaling
|
||||
/// (before this it was version 10). After version 7, DX level options were
|
||||
/// removed. In version 11 XBox 360 flags were removed.
|
||||
///
|
||||
///
|
||||
/// Version 7* is used by games built on Source 2013 Multiplayer
|
||||
/// ( Team Fortress 2, Counter-Strike: Source, etc.) and may come across as
|
||||
/// either version 7 or 10. Specifically, Team Fortress 2 has referred to it
|
||||
@@ -29,7 +29,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// rearranged such that Flags is an int and at the bottom, above two new
|
||||
/// entries. These new entries (LightmapResX and LightmapResY) control the
|
||||
/// width and height of the prop's lightmap image and are specific to this
|
||||
/// version.
|
||||
/// version.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class StaticPropLump
|
||||
@@ -118,7 +118,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
#endregion
|
||||
|
||||
#region v7* only
|
||||
|
||||
|
||||
[MarshalAs(UnmanagedType.U4)]
|
||||
public byte FlagsV7;
|
||||
|
||||
@@ -182,4 +182,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// or negative. If the value of the surfedge is positive, the first vertex
|
||||
/// of the edge is used as vertex for rendering the face, otherwise, the
|
||||
/// value is multiplied by -1 and the second vertex of the indexed edge is
|
||||
/// used.
|
||||
/// used.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class SurfedgesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Surfedges
|
||||
/// </summary>
|
||||
public int[]? Surfedges { get; set; }
|
||||
public int[] Surfedges { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// RGB reflectivity
|
||||
/// </summary>
|
||||
public Vector3D? Reflectivity;
|
||||
public Vector3D Reflectivity;
|
||||
|
||||
/// <summary>
|
||||
/// Index into TexdataStringTable
|
||||
@@ -37,4 +37,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
public int ViewHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Texdatas
|
||||
/// </summary>
|
||||
public Texdata[]? Texdatas { get; set; }
|
||||
public Texdata[] Texdatas { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Strings
|
||||
/// </summary>
|
||||
public string[]? Strings { get; set; }
|
||||
public string[] Strings { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Offsets
|
||||
/// </summary>
|
||||
public int[]? Offsets { get; set; }
|
||||
public int[] Offsets { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://github.com/RavuAlHemio/hllib/blob/master/HLLib/BSPFile.h"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class TextureHeader
|
||||
{
|
||||
/// <summary>
|
||||
@@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Offsets
|
||||
/// </summary>
|
||||
/// <remarks><see cref="MipTextureCount"> entries</remarks>
|
||||
public int[]? Offsets { get; set; }
|
||||
public int[] Offsets { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class TextureLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Texture header data
|
||||
/// </summary>
|
||||
public TextureHeader? Header { get; set; }
|
||||
public TextureHeader Header { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Textures
|
||||
/// </summary>
|
||||
public MipTexture[]? Textures { get; set; }
|
||||
public MipTexture[] Textures { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,13 +74,13 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Texture lighting info
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public int[]? LightmapTextureMinsInLuxels = new int[2];
|
||||
public int[] LightmapTextureMinsInLuxels = new int[2];
|
||||
|
||||
/// <summary>
|
||||
/// Texture lighting info
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
|
||||
public int[]? LightmapTextureSizeInLuxels = new int[2];
|
||||
public int[] LightmapTextureSizeInLuxels = new int[2];
|
||||
|
||||
/// <summary>
|
||||
/// Original face this was split from
|
||||
|
||||
@@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Faces
|
||||
/// </summary>
|
||||
public VbspFace[]? Faces { get; set; }
|
||||
public VbspFace[] Faces { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,189 +10,189 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Header data
|
||||
/// </summary>
|
||||
public VbspHeader? Header { get; set; }
|
||||
public VbspHeader Header { get; set; }
|
||||
|
||||
#region Lumps
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_ENTITIES [0]
|
||||
/// </summary>
|
||||
public EntitiesLump? Entities { get; set; }
|
||||
public EntitiesLump Entities { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PLANES [1]
|
||||
/// </summary>
|
||||
public PlanesLump? PlanesLump { get; set; }
|
||||
public PlanesLump PlanesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXDATA [2]
|
||||
/// </summary>
|
||||
public TexdataLump? TexdataLump { get; set; }
|
||||
public TexdataLump TexdataLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VERTEXES [3]
|
||||
/// </summary>
|
||||
public VerticesLump? VerticesLump { get; set; }
|
||||
public VerticesLump VerticesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VISIBILITY [4]
|
||||
/// </summary>
|
||||
public VisibilityLump? VisibilityLump { get; set; }
|
||||
public VisibilityLump VisibilityLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_NODES [5]
|
||||
/// </summary>
|
||||
public VbspNodesLump? NodesLump { get; set; }
|
||||
public VbspNodesLump NodesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXINFO [6]
|
||||
/// </summary>
|
||||
public VbspTexinfoLump? TexinfoLump { get; set; }
|
||||
public VbspTexinfoLump TexinfoLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_FACES [7]
|
||||
/// </summary>
|
||||
public VbspFacesLump? FacesLump { get; set; }
|
||||
public VbspFacesLump FacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LIGHTING [8]
|
||||
/// </summary>
|
||||
public LightmapLump? LightmapLump { get; set; }
|
||||
public LightmapLump LightmapLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_OCCLUSION [9]
|
||||
/// </summary>s
|
||||
public OcclusionLump? OcclusionLump { get; set; }
|
||||
public OcclusionLump OcclusionLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAVES [10]
|
||||
/// </summary>
|
||||
public VbspLeavesLump? LeavesLump { get; set; }
|
||||
public VbspLeavesLump LeavesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_FACEIDS [11]
|
||||
/// </summary>
|
||||
public MarksurfacesLump? MarksurfacesLump { get; set; }
|
||||
public MarksurfacesLump MarksurfacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_EDGES [12]
|
||||
/// </summary>
|
||||
public EdgesLump? EdgesLump { get; set; }
|
||||
public EdgesLump EdgesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_SURFEDGES [13]
|
||||
/// </summary>
|
||||
public SurfedgesLump? SurfedgesLump { get; set; }
|
||||
public SurfedgesLump SurfedgesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_MODELS [14]
|
||||
/// </summary>
|
||||
public VbspModelsLump? ModelsLump { get; set; }
|
||||
public VbspModelsLump ModelsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_WORLDLIGHTS [15]
|
||||
/// </summary>
|
||||
public WorldLightsLump? LDRWorldLightsLump { get; set; }
|
||||
public WorldLightsLump LDRWorldLightsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAFFACES [16]
|
||||
/// </summary>
|
||||
public LeafFacesLump? LeafFacesLump { get; set; }
|
||||
public LeafFacesLump LeafFacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAFBRUSHES [17]
|
||||
/// </summary>
|
||||
public LeafBrushesLump? LeafBrushesLump { get; set; }
|
||||
public LeafBrushesLump LeafBrushesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_BRUSHES [18]
|
||||
/// </summary>
|
||||
public BrushesLump? BrushesLump { get; set; }
|
||||
public BrushesLump BrushesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_BRUSHSIDES [19]
|
||||
/// </summary>
|
||||
public BrushsidesLump? BrushsidesLump { get; set; }
|
||||
public BrushsidesLump BrushsidesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_AREAS [20]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public AreasLump? AreasLump { get; set; }
|
||||
// public AreasLump AreasLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_AREAPORTALS [21]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public AreaPortalsLump? AreaPortalsLump { get; set; }
|
||||
// public AreaPortalsLump AreaPortalsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PORTALS / LUMP_UNUSED0 / LUMP_PROPCOLLISION [22]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PortalsLump? PortalsLump { get; set; }
|
||||
// public PortalsLump PortalsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_CLUSTERS / LUMP_UNUSED1 / LUMP_PROPHULLS [23]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public ClustersLump? ClustersLump { get; set; }
|
||||
// public ClustersLump ClustersLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PORTALVERTS / LUMP_UNUSED2 / LUMP_FAKEENTITIES / LUMP_PROPHULLVERTS [24]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PortalVertsLump? PortalVertsLump { get; set; }
|
||||
// public PortalVertsLump PortalVertsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_CLUSTERPORTALS / LUMP_UNUSED3 / LUMP_PROPTRIS [25]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public ClusterPortalsLump? ClusterPortalsLump { get; set; }
|
||||
// public ClusterPortalsLump ClusterPortalsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_DISPINFO [26]
|
||||
/// </summary>
|
||||
public DispInfosLump? DispInfosLump { get; set; }
|
||||
public DispInfosLump DispInfosLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_ORIGINALFACES [27]
|
||||
/// </summary>
|
||||
public VbspFacesLump? OriginalFacesLump { get; set; }
|
||||
public VbspFacesLump OriginalFacesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PHYSDISP [28]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PhysDispLump? PhysDispLump { get; set; }
|
||||
// public PhysDispLump PhysDispLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PHYSCOLLIDE [29]
|
||||
/// </summary>
|
||||
public PhysCollideLump? PhysCollideLump { get; set; }
|
||||
public PhysCollideLump PhysCollideLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VERTNORMALS [30]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public VertNormalsLump? VertNormalsLump { get; set; }
|
||||
// public VertNormalsLump VertNormalsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_VERTNORMALINDICES [31]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public VertNormalIndicesLump? VertNormalIndicesLump { get; set; }
|
||||
// public VertNormalIndicesLump VertNormalIndicesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_DISP_LIGHTMAP_ALPHAS [32]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public DispLightmapAlphasLump? DispLightmapAlphasLump { get; set; }
|
||||
// public DispLightmapAlphasLump DispLightmapAlphasLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_DISP_VERTS [33]
|
||||
/// </summary>
|
||||
public DispVertsLump? DispVertsLump { get; set; }
|
||||
public DispVertsLump DispVertsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_DISP_LIGHTMAP_SAMPLE_POSITIONS [34]
|
||||
@@ -203,47 +203,47 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// LUMP_GAME_LUMP [35]
|
||||
/// </summary>
|
||||
public GameLump? GameLump { get; set; }
|
||||
public GameLump GameLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAFWATERDATA [36]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public LeafWaterDataLump? LeafWaterDataLump { get; set; }
|
||||
// public LeafWaterDataLump LeafWaterDataLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PRIMITIVES [37]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PrimitivesLump? PrimitivesLump { get; set; }
|
||||
// public PrimitivesLump PrimitivesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PRIMVERTS [38]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PrimVertsLump? PrimVertsLump { get; set; }
|
||||
// public PrimVertsLump PrimVertsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PRIMINDICES [39]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PrimIndicesLump? PrimIndicesLump { get; set; }
|
||||
// public PrimIndicesLump PrimIndicesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PAKFILE [40]
|
||||
/// </summary>
|
||||
public PakfileLump? PakfileLump { get; set; }
|
||||
public PakfileLump PakfileLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_CLIPPORTALVERTS [41]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public ClipPortalVertsLump? ClipPortalVertsLump { get; set; }
|
||||
// public ClipPortalVertsLump ClipPortalVertsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_CUBEMAPS [42]
|
||||
/// </summary>
|
||||
public CubemapsLump? CubemapsLump { get; set; }
|
||||
public CubemapsLump CubemapsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_TEXDATA_STRING_DATA [43]
|
||||
@@ -258,110 +258,110 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// LUMP_OVERLAYS [45]
|
||||
/// </summary>
|
||||
public OverlaysLump? OverlaysLump { get; set; }
|
||||
public OverlaysLump OverlaysLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAFMINDISTTOWATER [46]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public LeafMindIsToWaterLump? LeafMindIsToWaterLump { get; set; }
|
||||
// public LeafMindIsToWaterLump LeafMindIsToWaterLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_FACE_MACRO_TEXTURE_INFO [47]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public FaceMacroTextureInfoLump? FaceMacroTextureInfoLump { get; set; }
|
||||
// public FaceMacroTextureInfoLump FaceMacroTextureInfoLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_DISP_TRIS [48]
|
||||
/// </summary>
|
||||
public DispTrisLump? DispTrisLump { get; set; }
|
||||
public DispTrisLump DispTrisLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PHYSCOLLIDESURFACE / LUMP_PROP_BLOB [49]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PhysCollideSurfaceLump? PhysCollideSurfaceLump { get; set; }
|
||||
// public PhysCollideSurfaceLump PhysCollideSurfaceLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_WATEROVERLAYS [50]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public WaterOverlaysLump? WaterOverlaysLump { get; set; }
|
||||
// public WaterOverlaysLump WaterOverlaysLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LIGHTMAPPAGES / LUMP_LEAF_AMBIENT_INDEX_HDR [51]
|
||||
/// </summary>
|
||||
public AmbientIndexLump? HDRAmbientIndexLump { get; set; }
|
||||
public AmbientIndexLump HDRAmbientIndexLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LIGHTMAPPAGEINFOS / LUMP_LEAF_AMBIENT_INDEX [52]
|
||||
/// </summary>
|
||||
public AmbientIndexLump? LDRAmbientIndexLump { get; set; }
|
||||
public AmbientIndexLump LDRAmbientIndexLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LIGHTING_HDR [53]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public LightingHdrLump? LightingHdrLump { get; set; }
|
||||
// public LightingHdrLump LightingHdrLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_WORLDLIGHTS_HDR [54]
|
||||
/// </summary>
|
||||
public WorldLightsLump? HDRWorldLightsLump { get; set; }
|
||||
public WorldLightsLump HDRWorldLightsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAF_AMBIENT_LIGHTING_HDR [55]
|
||||
/// </summary>
|
||||
public AmbientLightingLump? HDRAmbientLightingLump { get; set; }
|
||||
public AmbientLightingLump HDRAmbientLightingLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_LEAF_AMBIENT_LIGHTING [56]
|
||||
/// </summary>
|
||||
public AmbientLightingLump? LDRAmbientLightingLump { get; set; }
|
||||
public AmbientLightingLump LDRAmbientLightingLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_XZIPPAKFILE [57]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public XzipPakFileLump? XzipPakFileLump { get; set; }
|
||||
// public XzipPakFileLump XzipPakFileLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_FACES_HDR [58]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public FacesHdrLump? FacesHdrLump { get; set; }
|
||||
// public FacesHdrLump FacesHdrLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_MAP_FLAGS [59]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public MapFlagsLump? MapFlagsLump { get; set; }
|
||||
// public MapFlagsLump MapFlagsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_OVERLAY_FADES [60]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public OverlayFadesLump? OverlayFadesLump { get; set; }
|
||||
// public OverlayFadesLump OverlayFadesLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_OVERLAY_SYSTEM_LEVELS [61]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public OverlaySystemLevelsLump? OverlaySystemLevelsLump { get; set; }
|
||||
// public OverlaySystemLevelsLump OverlaySystemLevelsLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_PHYSLEVEL [62]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public PhysLevelLump? PhysLevelLump { get; set; }
|
||||
// public PhysLevelLump PhysLevelLump { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// LUMP_DISP_MULTIBLEND [63]
|
||||
/// </summary>
|
||||
/// TODO: Find definition and implement
|
||||
// public DispMultiBlendLump? DispMultiBlendLump { get; set; }
|
||||
// public DispMultiBlendLump DispMultiBlendLump { get; set; }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// BSP file signature
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)]
|
||||
public string? Signature;
|
||||
public string Signature;
|
||||
|
||||
/// <summary>
|
||||
/// BSP file version
|
||||
@@ -23,7 +23,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Lump directory array
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.VBSP_HEADER_LUMPS)]
|
||||
public VbspLumpEntry[]? Lumps = new VbspLumpEntry[Constants.VBSP_HEADER_LUMPS];
|
||||
public VbspLumpEntry[] Lumps = new VbspLumpEntry[Constants.VBSP_HEADER_LUMPS];
|
||||
|
||||
/// <summary>
|
||||
/// The map's revision (iteration, version) number.
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// The leaves lump contains the leaves of the BSP tree.
|
||||
///
|
||||
///
|
||||
/// The first entry of this struct is the type of the content
|
||||
/// of this leaf. It can be one of the predefined values, found
|
||||
/// in the compiler source codes, and is litte relevant for the
|
||||
@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// specify the volume of ambient sounds in Quake, but are unused in
|
||||
/// GoldSrc.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class VbspLeaf
|
||||
{
|
||||
/// <summary>
|
||||
@@ -83,7 +83,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Precaculated light info for entities.
|
||||
/// </summary>
|
||||
public CompressedLightCube? AmbientLighting;
|
||||
public CompressedLightCube AmbientLighting;
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -96,4 +96,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
public sealed class VbspLeavesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Leaves
|
||||
/// </summary>
|
||||
public VbspLeaf[]? Leaves { get; set; }
|
||||
public VbspLeaf[] Leaves { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,24 +8,24 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// confused with the prop models used in Hammer, which are usually
|
||||
/// called "studiomodels" in the SDK source.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class VbspModel
|
||||
{
|
||||
/// <summary>
|
||||
/// Bounding box
|
||||
/// </summary>
|
||||
public Vector3D? Mins;
|
||||
public Vector3D Mins;
|
||||
|
||||
/// <summary>
|
||||
/// Bounding box
|
||||
/// </summary>
|
||||
public Vector3D? Maxs;
|
||||
public Vector3D Maxs;
|
||||
|
||||
/// <summary>
|
||||
/// For sounds or lights
|
||||
/// </summary>
|
||||
public Vector3D? OriginVector;
|
||||
public Vector3D OriginVector;
|
||||
|
||||
/// <summary>
|
||||
/// Index into nodes
|
||||
@@ -42,4 +42,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public int FacesCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class VbspModelsLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Model
|
||||
/// </summary>
|
||||
public VbspModel[]? Models { get; set; }
|
||||
public VbspModel[] Models { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// This lump is simple again and contains an array of binary
|
||||
/// structures, the nodes, which are a major part of the BSP tree.
|
||||
///
|
||||
///
|
||||
/// Every BSPNODE structure represents a node in the BSP tree and
|
||||
/// every node equals more or less a division step of the BSP algorithm.
|
||||
/// Therefore, each node has an index (iPlane) referring to a plane
|
||||
@@ -20,8 +20,8 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Finally firstFace indexes into the face lump and spezifies the
|
||||
/// first of nFaces surfaces contained in this node.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public class VbspNode : BspNode
|
||||
{
|
||||
@@ -36,4 +36,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public short Padding;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class VbspNodesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Nodes
|
||||
/// </summary>
|
||||
public VbspNode[]? Nodes { get; set; }
|
||||
public VbspNode[] Nodes { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// The texinfo lump contains informations about how textures are
|
||||
/// applied to surfaces. The lump itself is an array of binary data
|
||||
/// structures.
|
||||
///
|
||||
///
|
||||
/// This struct is mainly responsible for the calculation of the texture
|
||||
/// coordinates (vS, fSShift, vT, fTShift). This values determine the
|
||||
/// position of the texture on the surface. The iMiptex integer refers
|
||||
@@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Texture S-vector
|
||||
/// </summary>
|
||||
public Vector3D? TextureSVector;
|
||||
public Vector3D TextureSVector;
|
||||
|
||||
/// <summary>
|
||||
/// Texture shift in the S direction
|
||||
@@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Texture T-vector
|
||||
/// </summary>
|
||||
public Vector3D? TextureTVector;
|
||||
public Vector3D TextureTVector;
|
||||
|
||||
/// <summary>
|
||||
/// Texture shift in the T direction
|
||||
@@ -42,7 +42,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Lightmap S-vector
|
||||
/// </summary>
|
||||
public Vector3D? LightmapSVector;
|
||||
public Vector3D LightmapSVector;
|
||||
|
||||
/// <summary>
|
||||
/// Lightmap shift in the S direction
|
||||
@@ -52,7 +52,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// <summary>
|
||||
/// Lightmap T-vector
|
||||
/// </summary>
|
||||
public Vector3D? LightmapTVector;
|
||||
public Vector3D LightmapTVector;
|
||||
|
||||
/// <summary>
|
||||
/// Lightmap shift in the T direction
|
||||
@@ -69,4 +69,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public int TexData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class VbspTexinfoLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Texinfos
|
||||
/// </summary>
|
||||
public VbspTexinfo[]? Texinfos { get; set; }
|
||||
public VbspTexinfo[] Texinfos { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
public float Y;
|
||||
public float Z;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,15 +2,15 @@ namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <summary>
|
||||
/// This lump simply consists of all vertices of the BSP tree.
|
||||
/// They are stored as a primitve array of triples of floats.
|
||||
/// They are stored as a primitve array of triples of floats.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class VerticesLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// Vertices
|
||||
/// </summary>
|
||||
public Vector3D[]? Vertices { get; set; }
|
||||
public Vector3D[] Vertices { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,15 +8,15 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// Potentially Visible Sets (PVS) (also called VIS lists) in the
|
||||
/// same amout of leaves of the tree, the user can enter (often
|
||||
/// referred to as VisLeaves). The visiblilty lists are stored as
|
||||
/// sequences of bitfields, which are run-length encoded.
|
||||
/// sequences of bitfields, which are run-length encoded.
|
||||
/// </summary>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(GoldSrc)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class VisibilityLump
|
||||
{
|
||||
public int NumClusters { get; set; }
|
||||
|
||||
/// <remarks>[numclusters][2]</remarks>
|
||||
public int[][]? ByteOffsets { get; set; }
|
||||
public int[][] ByteOffsets { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@ namespace SabreTools.Data.Models.BSP
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public sealed class WorldLight
|
||||
{
|
||||
public Vector3D? Origin;
|
||||
public Vector3D Origin;
|
||||
|
||||
public Vector3D? Intensity;
|
||||
public Vector3D Intensity;
|
||||
|
||||
/// <summary>
|
||||
/// For surfaces and spotlights
|
||||
/// </summary>
|
||||
public Vector3D? Normal;
|
||||
public Vector3D Normal;
|
||||
|
||||
public int Cluster;
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public float Radius;
|
||||
|
||||
// falloff for emit_spotlight + emit_point:
|
||||
// falloff for emit_spotlight + emit_point:
|
||||
// 1 / (constant_attn + linear_attn * dist + quadratic_attn * dist^2)
|
||||
|
||||
public float ConstantAttn;
|
||||
@@ -67,4 +67,4 @@ namespace SabreTools.Data.Models.BSP
|
||||
/// </summary>
|
||||
public int Owner;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
namespace SabreTools.Data.Models.BSP
|
||||
{
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
/// <see href="https://developer.valvesoftware.com/wiki/BSP_(Source)"/>
|
||||
public sealed class WorldLightsLump : Lump
|
||||
{
|
||||
/// <summary>
|
||||
/// WorldLights
|
||||
/// </summary>
|
||||
public WorldLight[]? WorldLights { get; set; }
|
||||
public WorldLight[] WorldLights { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,9 +136,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
};
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, EntitiesLump? lump)
|
||||
private static void Print(StringBuilder builder, EntitiesLump lump)
|
||||
{
|
||||
if (lump?.Entities == null || lump.Entities.Length == 0)
|
||||
if (lump.Entities.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -149,7 +149,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var entity = lump.Entities[i];
|
||||
|
||||
builder.AppendLine($" Entity {i}:");
|
||||
if (entity.Attributes == null || entity.Attributes.Count == 0)
|
||||
if (entity.Attributes.Count == 0)
|
||||
{
|
||||
builder.AppendLine(" No attributes");
|
||||
continue;
|
||||
@@ -164,9 +164,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, PlanesLump? lump)
|
||||
private static void Print(StringBuilder builder, PlanesLump lump)
|
||||
{
|
||||
if (lump?.Planes == null || lump.Planes.Length == 0)
|
||||
if (lump.Planes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -177,33 +177,20 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var plane = lump.Planes[i];
|
||||
|
||||
builder.AppendLine($" Plane {i}");
|
||||
builder.AppendLine($" Normal vector: ({plane.NormalVector?.X}, {plane.NormalVector?.Y}, {plane.NormalVector?.Z})");
|
||||
builder.AppendLine($" Normal vector: ({plane.NormalVector.X}, {plane.NormalVector.Y}, {plane.NormalVector.Z})");
|
||||
builder.AppendLine(plane.Distance, " Distance");
|
||||
builder.AppendLine($" Plane type: {plane.PlaneType} (0x{plane.PlaneType:X})");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, TextureLump? lump)
|
||||
private static void Print(StringBuilder builder, TextureLump lump)
|
||||
{
|
||||
if (lump == null)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
}
|
||||
|
||||
if (lump?.Header == null)
|
||||
{
|
||||
builder.AppendLine(" No texture header");
|
||||
}
|
||||
else
|
||||
{
|
||||
builder.AppendLine(" Texture Header:");
|
||||
builder.AppendLine(lump.Header.MipTextureCount, " MipTexture count");
|
||||
builder.AppendLine(lump.Header.Offsets, " Offsets");
|
||||
}
|
||||
builder.AppendLine(" Texture Header:");
|
||||
builder.AppendLine(lump.Header.MipTextureCount, " MipTexture count");
|
||||
builder.AppendLine(lump.Header.Offsets, " Offsets");
|
||||
|
||||
builder.AppendLine(" Textures:");
|
||||
if (lump?.Textures == null || lump.Textures.Length == 0)
|
||||
if (lump.Textures.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No texture data");
|
||||
return;
|
||||
@@ -221,9 +208,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VerticesLump? lump)
|
||||
private static void Print(StringBuilder builder, VerticesLump lump)
|
||||
{
|
||||
if (lump?.Vertices == null || lump.Vertices.Length == 0)
|
||||
if (lump.Vertices.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -236,21 +223,15 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VisibilityLump? lump)
|
||||
private static void Print(StringBuilder builder, VisibilityLump lump)
|
||||
{
|
||||
if (lump == null)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(lump.NumClusters, " Cluster count");
|
||||
builder.AppendLine(" Byte offsets skipped...");
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BspNodesLump? lump)
|
||||
private static void Print(StringBuilder builder, BspNodesLump lump)
|
||||
{
|
||||
if (lump?.Nodes == null || lump.Nodes.Length == 0)
|
||||
if (lump.Nodes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -269,9 +250,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BspTexinfoLump? lump)
|
||||
private static void Print(StringBuilder builder, BspTexinfoLump lump)
|
||||
{
|
||||
if (lump?.Texinfos == null || lump.Texinfos.Length == 0)
|
||||
if (lump.Texinfos.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -291,9 +272,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BspFacesLump? lump)
|
||||
private static void Print(StringBuilder builder, BspFacesLump lump)
|
||||
{
|
||||
if (lump?.Faces == null || lump.Faces.Length == 0)
|
||||
if (lump.Faces.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -314,17 +295,17 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, LightmapLump? lump)
|
||||
private static void Print(StringBuilder builder, LightmapLump lump)
|
||||
{
|
||||
if (lump?.Lightmap == null || lump.Lightmap.Length == 0)
|
||||
if (lump.Lightmap.Length == 0)
|
||||
builder.AppendLine(" No data");
|
||||
else
|
||||
builder.AppendLine(" Lightmap data skipped...");
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, ClipnodesLump? lump)
|
||||
private static void Print(StringBuilder builder, ClipnodesLump lump)
|
||||
{
|
||||
if (lump?.Clipnodes == null || lump.Clipnodes.Length == 0)
|
||||
if (lump.Clipnodes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -340,9 +321,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BspLeavesLump? lump)
|
||||
private static void Print(StringBuilder builder, BspLeavesLump lump)
|
||||
{
|
||||
if (lump?.Leaves == null || lump.Leaves.Length == 0)
|
||||
if (lump.Leaves.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -363,9 +344,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, MarksurfacesLump? lump)
|
||||
private static void Print(StringBuilder builder, MarksurfacesLump lump)
|
||||
{
|
||||
if (lump?.Marksurfaces == null || lump.Marksurfaces.Length == 0)
|
||||
if (lump.Marksurfaces.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -378,9 +359,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, EdgesLump? lump)
|
||||
private static void Print(StringBuilder builder, EdgesLump lump)
|
||||
{
|
||||
if (lump?.Edges == null || lump.Edges.Length == 0)
|
||||
if (lump.Edges.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -394,9 +375,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, SurfedgesLump? lump)
|
||||
private static void Print(StringBuilder builder, SurfedgesLump lump)
|
||||
{
|
||||
if (lump?.Surfedges == null || lump.Surfedges.Length == 0)
|
||||
if (lump.Surfedges.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -409,9 +390,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BspModelsLump? lump)
|
||||
private static void Print(StringBuilder builder, BspModelsLump lump)
|
||||
{
|
||||
if (lump?.Models == null || lump.Models.Length == 0)
|
||||
if (lump.Models.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
#region Extension Properties
|
||||
|
||||
/// <inheritdoc cref="BspHeader.Lumps"/>
|
||||
public BspLumpEntry[]? Lumps => Model.Header?.Lumps;
|
||||
public BspLumpEntry[] Lumps => Model.Header.Lumps;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -363,9 +363,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
};
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, EntitiesLump? lump)
|
||||
private static void Print(StringBuilder builder, EntitiesLump lump)
|
||||
{
|
||||
if (lump?.Entities == null || lump.Entities.Length == 0)
|
||||
if (lump.Entities.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -380,9 +380,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, PlanesLump? lump)
|
||||
private static void Print(StringBuilder builder, PlanesLump lump)
|
||||
{
|
||||
if (lump?.Planes == null || lump.Planes.Length == 0)
|
||||
if (lump.Planes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -393,15 +393,15 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var plane = lump.Planes[i];
|
||||
|
||||
builder.AppendLine($" Plane {i}");
|
||||
builder.AppendLine($" Normal vector: ({plane.NormalVector?.X}, {plane.NormalVector?.Y}, {plane.NormalVector?.Z})");
|
||||
builder.AppendLine($" Normal vector: ({plane.NormalVector.X}, {plane.NormalVector.Y}, {plane.NormalVector.Z})");
|
||||
builder.AppendLine(plane.Distance, " Distance");
|
||||
builder.AppendLine($" Plane type: {plane.PlaneType} (0x{plane.PlaneType:X})");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, TexdataLump? lump)
|
||||
private static void Print(StringBuilder builder, TexdataLump lump)
|
||||
{
|
||||
if (lump?.Texdatas == null || lump.Texdatas.Length == 0)
|
||||
if (lump.Texdatas.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -412,7 +412,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var texdata = lump.Texdatas[i];
|
||||
|
||||
builder.AppendLine($" Texture {i}");
|
||||
builder.AppendLine($" Reflectivity: ({texdata.Reflectivity?.X}, {texdata.Reflectivity?.Y}, {texdata.Reflectivity?.Z})");
|
||||
builder.AppendLine($" Reflectivity: ({texdata.Reflectivity.X}, {texdata.Reflectivity.Y}, {texdata.Reflectivity.Z})");
|
||||
builder.AppendLine(texdata.NameStringTableID, " Name string table ID");
|
||||
builder.AppendLine(texdata.Width, " Width");
|
||||
builder.AppendLine(texdata.Height, " Height");
|
||||
@@ -421,9 +421,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VerticesLump? lump)
|
||||
private static void Print(StringBuilder builder, VerticesLump lump)
|
||||
{
|
||||
if (lump?.Vertices == null || lump.Vertices.Length == 0)
|
||||
if (lump.Vertices.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -436,21 +436,15 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VisibilityLump? lump)
|
||||
private static void Print(StringBuilder builder, VisibilityLump lump)
|
||||
{
|
||||
if (lump == null)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(lump.NumClusters, " Cluster count");
|
||||
builder.AppendLine(" Byte offsets skipped...");
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VbspNodesLump? lump)
|
||||
private static void Print(StringBuilder builder, VbspNodesLump lump)
|
||||
{
|
||||
if (lump?.Nodes == null || lump.Nodes.Length == 0)
|
||||
if (lump.Nodes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -471,9 +465,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VbspTexinfoLump? lump)
|
||||
private static void Print(StringBuilder builder, VbspTexinfoLump lump)
|
||||
{
|
||||
if (lump?.Texinfos == null || lump.Texinfos.Length == 0)
|
||||
if (lump.Texinfos.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -484,22 +478,22 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var texinfo = lump.Texinfos[i];
|
||||
|
||||
builder.AppendLine($" Texinfo {i}");
|
||||
builder.AppendLine($" Texture S-Vector: ({texinfo.TextureSVector?.X}, {texinfo.TextureSVector?.Y}, {texinfo.TextureSVector?.Z})");
|
||||
builder.AppendLine($" Texture S-Vector: ({texinfo.TextureSVector.X}, {texinfo.TextureSVector.Y}, {texinfo.TextureSVector.Z})");
|
||||
builder.AppendLine(texinfo.TextureSShift, " Texture shift in S direction");
|
||||
builder.AppendLine($" Texture T-Vector: ({texinfo.TextureTVector?.X}, {texinfo.TextureTVector?.Y}, {texinfo.TextureTVector?.Z})");
|
||||
builder.AppendLine($" Texture T-Vector: ({texinfo.TextureTVector.X}, {texinfo.TextureTVector.Y}, {texinfo.TextureTVector.Z})");
|
||||
builder.AppendLine(texinfo.TextureTShift, " Texture shift in T direction");
|
||||
builder.AppendLine($" Lightmap S-Vector: ({texinfo.LightmapSVector?.X}, {texinfo.LightmapSVector?.Y}, {texinfo.LightmapSVector?.Z})");
|
||||
builder.AppendLine($" Lightmap S-Vector: ({texinfo.LightmapSVector.X}, {texinfo.LightmapSVector.Y}, {texinfo.LightmapSVector.Z})");
|
||||
builder.AppendLine(texinfo.TextureSShift, " Lightmap shift in S direction");
|
||||
builder.AppendLine($" Lightmap T-Vector: ({texinfo.LightmapTVector?.X}, {texinfo.LightmapTVector?.Y}, {texinfo.LightmapTVector?.Z})");
|
||||
builder.AppendLine($" Lightmap T-Vector: ({texinfo.LightmapTVector.X}, {texinfo.LightmapTVector.Y}, {texinfo.LightmapTVector.Z})");
|
||||
builder.AppendLine(texinfo.TextureTShift, " Lightmap shift in T direction");
|
||||
builder.AppendLine($" Flags: {texinfo.Flags} (0x{texinfo.Flags:X})");
|
||||
builder.AppendLine(texinfo.TexData, " Pointer to texdata");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VbspFacesLump? lump)
|
||||
private static void Print(StringBuilder builder, VbspFacesLump lump)
|
||||
{
|
||||
if (lump?.Faces == null || lump.Faces.Length == 0)
|
||||
if (lump.Faces.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -530,9 +524,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, PhysCollideLump? lump)
|
||||
private static void Print(StringBuilder builder, PhysCollideLump lump)
|
||||
{
|
||||
if (lump?.Models == null || lump.Models.Length == 0)
|
||||
if (lump.Models.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -546,7 +540,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine(model.DataSize, " Data size");
|
||||
builder.AppendLine(model.KeydataSize, " Keydata size");
|
||||
builder.AppendLine(model.SolidCount, " Solid count");
|
||||
if (model.Solids == null || model.Solids.Length == 0)
|
||||
if (model.Solids.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No solids");
|
||||
}
|
||||
@@ -565,24 +559,18 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, LightmapLump? lump)
|
||||
private static void Print(StringBuilder builder, LightmapLump lump)
|
||||
{
|
||||
if (lump?.Lightmap == null || lump.Lightmap.Length == 0)
|
||||
if (lump.Lightmap.Length == 0)
|
||||
builder.AppendLine(" No data");
|
||||
else
|
||||
builder.AppendLine(" Lightmap data skipped...");
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, OcclusionLump? lump)
|
||||
private static void Print(StringBuilder builder, OcclusionLump lump)
|
||||
{
|
||||
if (lump == null)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(lump.Count, " Count");
|
||||
if (lump.Data == null || lump.Data.Length == 0)
|
||||
if (lump.Data.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No occluder data");
|
||||
}
|
||||
@@ -596,14 +584,14 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine(data.Flags, " Flags");
|
||||
builder.AppendLine(data.FirstPoly, " First poly");
|
||||
builder.AppendLine(data.PolyCount, " Poly count");
|
||||
builder.AppendLine($" Mins: {data.Mins?.X}, {data.Mins?.Y}, {data.Mins?.Z}");
|
||||
builder.AppendLine($" Maxs: {data.Maxs?.X}, {data.Maxs?.Y}, {data.Maxs?.Z}");
|
||||
builder.AppendLine($" Mins: {data.Mins.X}, {data.Mins.Y}, {data.Mins.Z}");
|
||||
builder.AppendLine($" Maxs: {data.Maxs.X}, {data.Maxs.Y}, {data.Maxs.Z}");
|
||||
builder.AppendLine(data.Area, " Area");
|
||||
}
|
||||
}
|
||||
|
||||
builder.AppendLine(lump.PolyDataCount, " Polydata count");
|
||||
if (lump.PolyData == null || lump.PolyData.Length == 0)
|
||||
if (lump.PolyData.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No occluder polydata");
|
||||
}
|
||||
@@ -621,7 +609,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
|
||||
builder.AppendLine(lump.VertexIndexCount, " Vertex index count");
|
||||
if (lump.VertexIndicies == null || lump.VertexIndicies.Length == 0)
|
||||
if (lump.VertexIndicies.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No vertex indicies");
|
||||
}
|
||||
@@ -634,9 +622,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VbspLeavesLump? lump, uint version)
|
||||
private static void Print(StringBuilder builder, VbspLeavesLump lump, uint version)
|
||||
{
|
||||
if (lump?.Leaves == null || lump.Leaves.Length == 0)
|
||||
if (lump.Leaves.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -659,7 +647,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine(leaf.LeafWaterDataID, " Leaf water data ID");
|
||||
if (version == 0)
|
||||
{
|
||||
if (leaf.AmbientLighting?.Colors == null || leaf.AmbientLighting.Colors.Length == 0)
|
||||
if (leaf.AmbientLighting.Colors.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No ambient lighting colors");
|
||||
}
|
||||
@@ -683,9 +671,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, MarksurfacesLump? lump)
|
||||
private static void Print(StringBuilder builder, MarksurfacesLump lump)
|
||||
{
|
||||
if (lump?.Marksurfaces == null || lump.Marksurfaces.Length == 0)
|
||||
if (lump.Marksurfaces.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -698,9 +686,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, EdgesLump? lump)
|
||||
private static void Print(StringBuilder builder, EdgesLump lump)
|
||||
{
|
||||
if (lump?.Edges == null || lump.Edges.Length == 0)
|
||||
if (lump.Edges.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -714,9 +702,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, SurfedgesLump? lump)
|
||||
private static void Print(StringBuilder builder, SurfedgesLump lump)
|
||||
{
|
||||
if (lump?.Surfedges == null || lump.Surfedges.Length == 0)
|
||||
if (lump.Surfedges.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -729,9 +717,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, VbspModelsLump? lump)
|
||||
private static void Print(StringBuilder builder, VbspModelsLump lump)
|
||||
{
|
||||
if (lump?.Models == null || lump.Models.Length == 0)
|
||||
if (lump.Models.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -742,18 +730,18 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var model = lump.Models[i];
|
||||
|
||||
builder.AppendLine($" Model {i}");
|
||||
builder.AppendLine($" Mins: ({model.Mins?.X}, {model.Mins?.Y}, {model.Mins?.Z})");
|
||||
builder.AppendLine($" Maxs: ({model.Maxs?.X}, {model.Maxs?.Y}, {model.Maxs?.Z})");
|
||||
builder.AppendLine($" Origin vector: ({model.OriginVector?.X}, {model.OriginVector?.Y}, {model.OriginVector?.Z})");
|
||||
builder.AppendLine($" Mins: ({model.Mins.X}, {model.Mins.Y}, {model.Mins.Z})");
|
||||
builder.AppendLine($" Maxs: ({model.Maxs.X}, {model.Maxs.Y}, {model.Maxs.Z})");
|
||||
builder.AppendLine($" Origin vector: ({model.OriginVector.X}, {model.OriginVector.Y}, {model.OriginVector.Z})");
|
||||
builder.AppendLine(model.HeadNode, " Headnode index");
|
||||
builder.AppendLine(model.FirstFaceIndex, " First face index");
|
||||
builder.AppendLine(model.FacesCount, " Faces count");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, WorldLightsLump? lump)
|
||||
private static void Print(StringBuilder builder, WorldLightsLump lump)
|
||||
{
|
||||
if (lump?.WorldLights == null || lump.WorldLights.Length == 0)
|
||||
if (lump.WorldLights.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -764,9 +752,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var worldlight = lump.WorldLights[j];
|
||||
|
||||
builder.AppendLine($" World Light {j}");
|
||||
builder.AppendLine($" Origin: ({worldlight.Origin?.X}, {worldlight.Origin?.Y}, {worldlight.Origin?.Z})");
|
||||
builder.AppendLine($" Intensity: ({worldlight.Intensity?.X}, {worldlight.Intensity?.Y}, {worldlight.Intensity?.Z})");
|
||||
builder.AppendLine($" Normal: ({worldlight.Normal?.X}, {worldlight.Normal?.Y}, {worldlight.Normal?.Z})");
|
||||
builder.AppendLine($" Origin: ({worldlight.Origin.X}, {worldlight.Origin.Y}, {worldlight.Origin.Z})");
|
||||
builder.AppendLine($" Intensity: ({worldlight.Intensity.X}, {worldlight.Intensity.Y}, {worldlight.Intensity.Z})");
|
||||
builder.AppendLine($" Normal: ({worldlight.Normal.X}, {worldlight.Normal.Y}, {worldlight.Normal.Z})");
|
||||
builder.AppendLine(worldlight.Cluster, " Cluster");
|
||||
builder.AppendLine($" Emit type: {worldlight.EmitType} (0x{worldlight.EmitType:X})");
|
||||
builder.AppendLine(worldlight.Style, " Style");
|
||||
@@ -783,9 +771,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, LeafFacesLump? lump)
|
||||
private static void Print(StringBuilder builder, LeafFacesLump lump)
|
||||
{
|
||||
if (lump?.Map == null || lump.Map.Length == 0)
|
||||
if (lump.Map.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -798,9 +786,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, LeafBrushesLump? lump)
|
||||
private static void Print(StringBuilder builder, LeafBrushesLump lump)
|
||||
{
|
||||
if (lump?.Map == null || lump.Map.Length == 0)
|
||||
if (lump.Map.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -813,9 +801,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BrushesLump? lump)
|
||||
private static void Print(StringBuilder builder, BrushesLump lump)
|
||||
{
|
||||
if (lump?.Brushes == null || lump.Brushes.Length == 0)
|
||||
if (lump.Brushes.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -832,9 +820,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, BrushsidesLump? lump)
|
||||
private static void Print(StringBuilder builder, BrushsidesLump lump)
|
||||
{
|
||||
if (lump?.Brushsides == null || lump.Brushsides.Length == 0)
|
||||
if (lump.Brushsides.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -852,9 +840,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, DispInfosLump? lump)
|
||||
private static void Print(StringBuilder builder, DispInfosLump lump)
|
||||
{
|
||||
if (lump?.Infos == null || lump.Infos.Length == 0)
|
||||
if (lump.Infos.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -865,7 +853,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var info = lump.Infos[i];
|
||||
|
||||
builder.AppendLine($" Disp Info {i}");
|
||||
builder.AppendLine($" Start position: ({info.StartPosition?.X}, {info.StartPosition?.Y}, {info.StartPosition?.Z})");
|
||||
builder.AppendLine($" Start position: ({info.StartPosition.X}, {info.StartPosition.Y}, {info.StartPosition.Z})");
|
||||
builder.AppendLine(info.DispVertStart, " Index into disp verts");
|
||||
builder.AppendLine(info.DispTriStart, " Index into disp tris");
|
||||
builder.AppendLine(info.Power, " Power");
|
||||
@@ -876,7 +864,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine(info.LightmapAlphaStart, " Lightmap alpha start");
|
||||
builder.AppendLine(info.LightmapSamplePositionStart, " Lightmap sample position start");
|
||||
builder.AppendLine($" Edge Neighbors:");
|
||||
if (info.EdgeNeighbors == null || info.EdgeNeighbors.Length == 0)
|
||||
if (info.EdgeNeighbors.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No edge neighbors");
|
||||
}
|
||||
@@ -886,7 +874,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
{
|
||||
var edgeNeighbor = info.EdgeNeighbors[j];
|
||||
builder.AppendLine($" Edge Neighbor {j}");
|
||||
if (edgeNeighbor.SubNeighbors == null || edgeNeighbor.SubNeighbors.Length == 0)
|
||||
if (edgeNeighbor.SubNeighbors.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No subneighbors");
|
||||
}
|
||||
@@ -906,7 +894,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
|
||||
builder.AppendLine($" Corner Neighbors:");
|
||||
if (info.CornerNeighbors == null || info.CornerNeighbors.Length == 0)
|
||||
if (info.CornerNeighbors.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No corner neighbors");
|
||||
}
|
||||
@@ -925,9 +913,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, DispVertsLump? lump)
|
||||
private static void Print(StringBuilder builder, DispVertsLump lump)
|
||||
{
|
||||
if (lump?.Verts == null || lump.Verts.Length == 0)
|
||||
if (lump.Verts.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -938,22 +926,16 @@ namespace SabreTools.Serialization.Wrappers
|
||||
var vert = lump.Verts[i];
|
||||
|
||||
builder.AppendLine($" Disp Vert {i}");
|
||||
builder.AppendLine($" Vec: ({vert.Vec?.X}, {vert.Vec?.Y}, {vert.Vec?.Z})");
|
||||
builder.AppendLine($" Vec: ({vert.Vec.X}, {vert.Vec.Y}, {vert.Vec.Z})");
|
||||
builder.AppendLine(vert.Dist, " Dist");
|
||||
builder.AppendLine(vert.Alpha, " Alpha");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, GameLump? lump)
|
||||
private static void Print(StringBuilder builder, GameLump lump)
|
||||
{
|
||||
if (lump == null)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
}
|
||||
|
||||
builder.AppendLine(lump.LumpCount, " Lump count");
|
||||
if (lump.Directories == null || lump.Directories.Length == 0)
|
||||
if (lump.Directories.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No directories");
|
||||
return;
|
||||
@@ -972,9 +954,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, PakfileLump? lump)
|
||||
private static void Print(StringBuilder builder, PakfileLump lump)
|
||||
{
|
||||
if (lump?.Data == null || lump.Data.Length == 0)
|
||||
if (lump.Data.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -983,9 +965,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine(" Data skipped...");
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, CubemapsLump? lump)
|
||||
private static void Print(StringBuilder builder, CubemapsLump lump)
|
||||
{
|
||||
if (lump?.Cubemaps == null || lump.Cubemaps.Length == 0)
|
||||
if (lump.Cubemaps.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -1001,9 +983,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, TexdataStringData? lump)
|
||||
private static void Print(StringBuilder builder, TexdataStringData lump)
|
||||
{
|
||||
if (lump?.Strings == null || lump.Strings.Length == 0)
|
||||
if (lump.Strings.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -1016,9 +998,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, TexdataStringTable? lump)
|
||||
private static void Print(StringBuilder builder, TexdataStringTable lump)
|
||||
{
|
||||
if (lump?.Offsets == null || lump.Offsets.Length == 0)
|
||||
if (lump.Offsets.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -1031,9 +1013,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, OverlaysLump? lump)
|
||||
private static void Print(StringBuilder builder, OverlaysLump lump)
|
||||
{
|
||||
if (lump?.Overlays == null || lump.Overlays.Length == 0)
|
||||
if (lump.Overlays.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -1050,7 +1032,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
builder.AppendLine(overlay.Ofaces, " Ofaces");
|
||||
builder.AppendLine(overlay.U, " U");
|
||||
builder.AppendLine(overlay.V, " V");
|
||||
if (overlay.UVPoints == null || overlay.UVPoints.Length == 0)
|
||||
if (overlay.UVPoints.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No UV points");
|
||||
}
|
||||
@@ -1063,14 +1045,14 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
builder.AppendLine($" Origin: ({overlay.Origin?.X}, {overlay.Origin?.Y}, {overlay.Origin?.Z})");
|
||||
builder.AppendLine($" Basis normal: ({overlay.BasisNormal?.X}, {overlay.BasisNormal?.Y}, {overlay.BasisNormal?.Z})");
|
||||
builder.AppendLine($" Origin: ({overlay.Origin.X}, {overlay.Origin.Y}, {overlay.Origin.Z})");
|
||||
builder.AppendLine($" Basis normal: ({overlay.BasisNormal.X}, {overlay.BasisNormal.Y}, {overlay.BasisNormal.Z})");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, DispTrisLump? lump)
|
||||
private static void Print(StringBuilder builder, DispTrisLump lump)
|
||||
{
|
||||
if (lump?.Tris == null || lump.Tris.Length == 0)
|
||||
if (lump.Tris.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -1085,9 +1067,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, AmbientIndexLump? lump)
|
||||
private static void Print(StringBuilder builder, AmbientIndexLump lump)
|
||||
{
|
||||
if (lump?.Indicies == null || lump.Indicies.Length == 0)
|
||||
if (lump.Indicies.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
@@ -1103,9 +1085,9 @@ namespace SabreTools.Serialization.Wrappers
|
||||
}
|
||||
}
|
||||
|
||||
private static void Print(StringBuilder builder, AmbientLightingLump? lump)
|
||||
private static void Print(StringBuilder builder, AmbientLightingLump lump)
|
||||
{
|
||||
if (lump?.Lightings == null || lump.Lightings.Length == 0)
|
||||
if (lump.Lightings.Length == 0)
|
||||
{
|
||||
builder.AppendLine(" No data");
|
||||
return;
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers
|
||||
#region Extension Properties
|
||||
|
||||
/// <inheritdoc cref="VbspHeader.Lumps"/>
|
||||
public VbspLumpEntry[]? Lumps => Model.Header?.Lumps;
|
||||
public VbspLumpEntry[] Lumps => Model.Header.Lumps;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in New Issue
Block a user