diff --git a/SabreTools.Serialization/Models/BSP/AmbientIndexLump.cs b/SabreTools.Serialization/Models/BSP/AmbientIndexLump.cs index 22488819..f1a49208 100644 --- a/SabreTools.Serialization/Models/BSP/AmbientIndexLump.cs +++ b/SabreTools.Serialization/Models/BSP/AmbientIndexLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Indicies /// - public LeafAmbientIndex[]? Indicies { get; set; } + public LeafAmbientIndex[] Indicies { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/AmbientLightingLump.cs b/SabreTools.Serialization/Models/BSP/AmbientLightingLump.cs index a37403a5..c7004194 100644 --- a/SabreTools.Serialization/Models/BSP/AmbientLightingLump.cs +++ b/SabreTools.Serialization/Models/BSP/AmbientLightingLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Lightings /// - public LeafAmbientLighting[]? Lightings { get; set; } + public LeafAmbientLighting[] Lightings { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Brush.cs b/SabreTools.Serialization/Models/BSP/Brush.cs index 02ae81bb..dfd0967f 100644 --- a/SabreTools.Serialization/Models/BSP/Brush.cs +++ b/SabreTools.Serialization/Models/BSP/Brush.cs @@ -30,4 +30,4 @@ namespace SabreTools.Data.Models.BSP /// public VbspContents Contents; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BrushesLump.cs b/SabreTools.Serialization/Models/BSP/BrushesLump.cs index a0633a09..abc10f16 100644 --- a/SabreTools.Serialization/Models/BSP/BrushesLump.cs +++ b/SabreTools.Serialization/Models/BSP/BrushesLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Brushes /// - public Brush[]? Brushes { get; set; } + public Brush[] Brushes { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Brushside.cs b/SabreTools.Serialization/Models/BSP/Brushside.cs index a3864009..f82c8117 100644 --- a/SabreTools.Serialization/Models/BSP/Brushside.cs +++ b/SabreTools.Serialization/Models/BSP/Brushside.cs @@ -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). /// @@ -45,4 +45,4 @@ namespace SabreTools.Data.Models.BSP /// public short Bevel; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BrushsidesLump.cs b/SabreTools.Serialization/Models/BSP/BrushsidesLump.cs index a9324c60..c156f689 100644 --- a/SabreTools.Serialization/Models/BSP/BrushsidesLump.cs +++ b/SabreTools.Serialization/Models/BSP/BrushsidesLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Brushsides /// - public Brushside[]? Brushsides { get; set; } + public Brushside[] Brushsides { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspFacesLump.cs b/SabreTools.Serialization/Models/BSP/BspFacesLump.cs index d6787e1d..5620435e 100644 --- a/SabreTools.Serialization/Models/BSP/BspFacesLump.cs +++ b/SabreTools.Serialization/Models/BSP/BspFacesLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class BspFacesLump : Lump { /// /// Faces /// - public BspFace[]? Faces { get; set; } + public BspFace[] Faces { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspFile.cs b/SabreTools.Serialization/Models/BSP/BspFile.cs index f15fb81f..0649fe31 100644 --- a/SabreTools.Serialization/Models/BSP/BspFile.cs +++ b/SabreTools.Serialization/Models/BSP/BspFile.cs @@ -10,85 +10,85 @@ namespace SabreTools.Data.Models.BSP /// /// Header data /// - public BspHeader? Header { get; set; } + public BspHeader Header { get; set; } #region Lumps /// /// LUMP_ENTITIES [0] /// - public EntitiesLump? Entities { get; set; } + public EntitiesLump Entities { get; set; } /// /// LUMP_PLANES [1] /// - public PlanesLump? PlanesLump { get; set; } + public PlanesLump PlanesLump { get; set; } /// /// LUMP_TEXTURES [2] /// - public TextureLump? TextureLump { get; set; } + public TextureLump TextureLump { get; set; } /// /// LUMP_VERTICES [3] /// - public VerticesLump? VerticesLump { get; set; } + public VerticesLump VerticesLump { get; set; } /// /// LUMP_VISIBILITY [4] /// - public VisibilityLump? VisibilityLump { get; set; } + public VisibilityLump VisibilityLump { get; set; } /// /// LUMP_NODES [5] /// - public BspNodesLump? NodesLump { get; set; } + public BspNodesLump NodesLump { get; set; } /// /// LUMP_TEXINFO [6] /// - public BspTexinfoLump? TexinfoLump { get; set; } + public BspTexinfoLump TexinfoLump { get; set; } /// /// LUMP_FACES [7] /// - public BspFacesLump? FacesLump { get; set; } + public BspFacesLump FacesLump { get; set; } /// /// LUMP_LIGHTING [8] /// - public LightmapLump? LightmapLump { get; set; } + public LightmapLump LightmapLump { get; set; } /// /// LUMP_CLIPNODES [9] /// s - public ClipnodesLump? ClipnodesLump { get; set; } + public ClipnodesLump ClipnodesLump { get; set; } /// /// LUMP_LEAVES [10] /// - public BspLeavesLump? LeavesLump { get; set; } + public BspLeavesLump LeavesLump { get; set; } /// /// LUMP_MARKSURFACES [11] /// - public MarksurfacesLump? MarksurfacesLump { get; set; } + public MarksurfacesLump MarksurfacesLump { get; set; } /// /// LUMP_EDGES [12] /// - public EdgesLump? EdgesLump { get; set; } + public EdgesLump EdgesLump { get; set; } /// /// LUMP_SURFEDGES [13] /// - public SurfedgesLump? SurfedgesLump { get; set; } + public SurfedgesLump SurfedgesLump { get; set; } /// /// LUMP_MODELS [14] /// - public BspModelsLump? ModelsLump { get; set; } + public BspModelsLump ModelsLump { get; set; } #endregion } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspHeader.cs b/SabreTools.Serialization/Models/BSP/BspHeader.cs index 493a2b64..4754e9d9 100644 --- a/SabreTools.Serialization/Models/BSP/BspHeader.cs +++ b/SabreTools.Serialization/Models/BSP/BspHeader.cs @@ -18,6 +18,6 @@ namespace SabreTools.Data.Models.BSP /// /// 15 entries [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.BSP_HEADER_LUMPS)] - public BspLumpEntry[]? Lumps; + public BspLumpEntry[] Lumps = new BspLumpEntry[Constants.BSP_HEADER_LUMPS]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspLeavesLump.cs b/SabreTools.Serialization/Models/BSP/BspLeavesLump.cs index fe52ca5f..18755b9f 100644 --- a/SabreTools.Serialization/Models/BSP/BspLeavesLump.cs +++ b/SabreTools.Serialization/Models/BSP/BspLeavesLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class BspLeavesLump : Lump { /// /// Leaves /// - public BspLeaf[]? Leaves { get; set; } + public BspLeaf[] Leaves { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspLumpEntry.cs b/SabreTools.Serialization/Models/BSP/BspLumpEntry.cs index 6d41f19f..3c4db37b 100644 --- a/SabreTools.Serialization/Models/BSP/BspLumpEntry.cs +++ b/SabreTools.Serialization/Models/BSP/BspLumpEntry.cs @@ -17,4 +17,4 @@ namespace SabreTools.Data.Models.BSP /// public int Length; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspModel.cs b/SabreTools.Serialization/Models/BSP/BspModel.cs index f21b8bf1..496e1879 100644 --- a/SabreTools.Serialization/Models/BSP/BspModel.cs +++ b/SabreTools.Serialization/Models/BSP/BspModel.cs @@ -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. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class BspModel { /// /// Defines bounding box /// - public Vector3D? Mins; + public Vector3D Mins; /// /// Defines bounding box /// - public Vector3D? Maxs; + public Vector3D Maxs; /// /// Coordinates to move the coordinate system /// - public Vector3D? OriginVector; + public Vector3D OriginVector; /// /// Index into nodes array /// [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]; /// /// ??? @@ -60,4 +60,4 @@ namespace SabreTools.Data.Models.BSP /// public int FacesCount; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspModelsLump.cs b/SabreTools.Serialization/Models/BSP/BspModelsLump.cs index 0c0f28c5..ffb68c50 100644 --- a/SabreTools.Serialization/Models/BSP/BspModelsLump.cs +++ b/SabreTools.Serialization/Models/BSP/BspModelsLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class BspModelsLump : Lump { /// /// Model /// - public BspModel[]? Models { get; set; } + public BspModel[] Models { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspNode.cs b/SabreTools.Serialization/Models/BSP/BspNode.cs index 3bf529e8..3b4c5c22 100644 --- a/SabreTools.Serialization/Models/BSP/BspNode.cs +++ b/SabreTools.Serialization/Models/BSP/BspNode.cs @@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP /// /// 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. /// - /// - /// + /// + /// [StructLayout(LayoutKind.Sequential)] public class BspNode { @@ -59,4 +59,4 @@ namespace SabreTools.Data.Models.BSP /// public ushort FaceCount; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspNodesLump.cs b/SabreTools.Serialization/Models/BSP/BspNodesLump.cs index 827c31c9..c3494ad8 100644 --- a/SabreTools.Serialization/Models/BSP/BspNodesLump.cs +++ b/SabreTools.Serialization/Models/BSP/BspNodesLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class BspNodesLump : Lump { /// /// Nodes /// - public BspNode[]? Nodes { get; set; } + public BspNode[] Nodes { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspTexinfo.cs b/SabreTools.Serialization/Models/BSP/BspTexinfo.cs index e829ef9f..dd70cc2e 100644 --- a/SabreTools.Serialization/Models/BSP/BspTexinfo.cs +++ b/SabreTools.Serialization/Models/BSP/BspTexinfo.cs @@ -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 /// /// S-vector /// - public Vector3D? SVector; + public Vector3D SVector; /// /// Texture shift in the S direction @@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP /// /// T-vector /// - public Vector3D? TVector; + public Vector3D TVector; /// /// Texture shift in the T direction @@ -49,4 +49,4 @@ namespace SabreTools.Data.Models.BSP /// public TextureFlag Flags; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/BspTexinfoLump.cs b/SabreTools.Serialization/Models/BSP/BspTexinfoLump.cs index 1b58fc72..daec0cdd 100644 --- a/SabreTools.Serialization/Models/BSP/BspTexinfoLump.cs +++ b/SabreTools.Serialization/Models/BSP/BspTexinfoLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class BspTexinfoLump : Lump { /// /// Texinfos /// - public BspTexinfo[]? Texinfos { get; set; } + public BspTexinfo[] Texinfos { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/CDispCornerNeighbors.cs b/SabreTools.Serialization/Models/BSP/CDispCornerNeighbors.cs index ce392308..23b21141 100644 --- a/SabreTools.Serialization/Models/BSP/CDispCornerNeighbors.cs +++ b/SabreTools.Serialization/Models/BSP/CDispCornerNeighbors.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; namespace SabreTools.Data.Models.BSP { - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class CDispCornerNeighbors { @@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP public byte NeighborCount; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/CDispNeighbor.cs b/SabreTools.Serialization/Models/BSP/CDispNeighbor.cs index abb4f30e..2f1307df 100644 --- a/SabreTools.Serialization/Models/BSP/CDispNeighbor.cs +++ b/SabreTools.Serialization/Models/BSP/CDispNeighbor.cs @@ -2,11 +2,11 @@ using System.Runtime.InteropServices; namespace SabreTools.Data.Models.BSP { - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class CDispNeighbor { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public CDispSubNeighbor[]? SubNeighbors = new CDispSubNeighbor[2]; + public CDispSubNeighbor[] SubNeighbors = new CDispSubNeighbor[2]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/CDispSubNeighbor.cs b/SabreTools.Serialization/Models/BSP/CDispSubNeighbor.cs index b0dd103a..e0ef3337 100644 --- a/SabreTools.Serialization/Models/BSP/CDispSubNeighbor.cs +++ b/SabreTools.Serialization/Models/BSP/CDispSubNeighbor.cs @@ -2,7 +2,7 @@ using System.Runtime.InteropServices; namespace SabreTools.Data.Models.BSP { - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class CDispSubNeighbor { @@ -29,4 +29,4 @@ namespace SabreTools.Data.Models.BSP /// public byte NeighborSpan; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Clipnode.cs b/SabreTools.Serialization/Models/BSP/Clipnode.cs index 5ff7d2e9..e7a002fb 100644 --- a/SabreTools.Serialization/Models/BSP/Clipnode.cs +++ b/SabreTools.Serialization/Models/BSP/Clipnode.cs @@ -5,12 +5,12 @@ namespace SabreTools.Data.Models.BSP /// /// 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. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class Clipnode { @@ -23,6 +23,6 @@ namespace SabreTools.Data.Models.BSP /// Negative numbers are contents /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public short[]? ChildrenIndices = new short[2]; + public short[] ChildrenIndices = new short[2]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/ClipnodesLump.cs b/SabreTools.Serialization/Models/BSP/ClipnodesLump.cs index e83b5c9f..d14f3fdb 100644 --- a/SabreTools.Serialization/Models/BSP/ClipnodesLump.cs +++ b/SabreTools.Serialization/Models/BSP/ClipnodesLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class ClipnodesLump : Lump { /// /// Clipnodes /// - public Clipnode[]? Clipnodes { get; set; } + public Clipnode[] Clipnodes { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/ColorRGBExp32.cs b/SabreTools.Serialization/Models/BSP/ColorRGBExp32.cs index 6bbb2abe..ac58b204 100644 --- a/SabreTools.Serialization/Models/BSP/ColorRGBExp32.cs +++ b/SabreTools.Serialization/Models/BSP/ColorRGBExp32.cs @@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP /// /// 4-byte lightmap structure /// - /// + /// [StructLayout(LayoutKind.Sequential)] public class ColorRGBExp32 { @@ -17,4 +17,4 @@ namespace SabreTools.Data.Models.BSP public sbyte Exponent; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/CompressedLightCube.cs b/SabreTools.Serialization/Models/BSP/CompressedLightCube.cs index 14225db0..68a30625 100644 --- a/SabreTools.Serialization/Models/BSP/CompressedLightCube.cs +++ b/SabreTools.Serialization/Models/BSP/CompressedLightCube.cs @@ -6,11 +6,11 @@ namespace SabreTools.Data.Models.BSP /// The lighting data for each sample is represented by an array /// of 6 ColorRGBExp32 /// - /// + /// [StructLayout(LayoutKind.Sequential)] public class CompressedLightCube { [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] - public ColorRGBExp32[]? Colors; + public ColorRGBExp32[] Colors; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Constants.cs b/SabreTools.Serialization/Models/BSP/Constants.cs index 199f2d0c..58257abd 100644 --- a/SabreTools.Serialization/Models/BSP/Constants.cs +++ b/SabreTools.Serialization/Models/BSP/Constants.cs @@ -1,7 +1,7 @@ namespace SabreTools.Data.Models.BSP { - /// - /// + /// + /// 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 /// @@ -97,4 +97,4 @@ namespace SabreTools.Data.Models.BSP #endregion } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Cubemap.cs b/SabreTools.Serialization/Models/BSP/Cubemap.cs index 27082cca..615fa7a7 100644 --- a/SabreTools.Serialization/Models/BSP/Cubemap.cs +++ b/SabreTools.Serialization/Models/BSP/Cubemap.cs @@ -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. /// /// [StructLayout(LayoutKind.Sequential)] @@ -40,11 +40,11 @@ namespace SabreTools.Data.Models.BSP /// Position of light snapped to the nearest integer /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] - public int[]? Origin = new int[3]; + public int[] Origin = new int[3]; /// /// Resolution of cubemap, 0 - default /// public int Size; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/CubemapsLump.cs b/SabreTools.Serialization/Models/BSP/CubemapsLump.cs index 6a2275fa..c33e86f7 100644 --- a/SabreTools.Serialization/Models/BSP/CubemapsLump.cs +++ b/SabreTools.Serialization/Models/BSP/CubemapsLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Cubemaps /// - public Cubemap[]? Cubemaps { get; set; } + public Cubemap[] Cubemaps { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/DispInfo.cs b/SabreTools.Serialization/Models/BSP/DispInfo.cs index 577d3b83..25bcdd87 100644 --- a/SabreTools.Serialization/Models/BSP/DispInfo.cs +++ b/SabreTools.Serialization/Models/BSP/DispInfo.cs @@ -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. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class DispInfo { /// /// Start position used for orientation /// - public Vector3D? StartPosition; + public Vector3D StartPosition; /// /// Index into LUMP_DISP_VERTS. @@ -76,18 +76,18 @@ namespace SabreTools.Data.Models.BSP /// Indexed by NEIGHBOREDGE_ defines. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public CDispNeighbor[]? EdgeNeighbors = new CDispNeighbor[4]; + public CDispNeighbor[] EdgeNeighbors = new CDispNeighbor[4]; /// /// Indexed by CORNER_ defines. /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public CDispCornerNeighbors[]? CornerNeighbors = new CDispCornerNeighbors[4]; + public CDispCornerNeighbors[] CornerNeighbors = new CDispCornerNeighbors[4]; /// /// Active verticies /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] - public uint[]? AllowedVerts = new uint[10]; + public uint[] AllowedVerts = new uint[10]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/DispInfosLump.cs b/SabreTools.Serialization/Models/BSP/DispInfosLump.cs index 34c5f631..d442c9cb 100644 --- a/SabreTools.Serialization/Models/BSP/DispInfosLump.cs +++ b/SabreTools.Serialization/Models/BSP/DispInfosLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Infos /// - public DispInfo[]? Infos { get; set; } + public DispInfo[] Infos { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/DispTrisLump.cs b/SabreTools.Serialization/Models/BSP/DispTrisLump.cs index 2dd1fee4..7ed90805 100644 --- a/SabreTools.Serialization/Models/BSP/DispTrisLump.cs +++ b/SabreTools.Serialization/Models/BSP/DispTrisLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Tris /// - public DispTri[]? Tris { get; set; } + public DispTri[] Tris { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/DispVert.cs b/SabreTools.Serialization/Models/BSP/DispVert.cs index bbce56a8..76c2fcd3 100644 --- a/SabreTools.Serialization/Models/BSP/DispVert.cs +++ b/SabreTools.Serialization/Models/BSP/DispVert.cs @@ -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. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class DispVert { /// /// Vector field defining displacement volume. /// - public Vector3D? Vec; + public Vector3D Vec; /// /// Displacement distances. @@ -30,4 +30,4 @@ namespace SabreTools.Data.Models.BSP /// public float Alpha; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/DispVertsLump.cs b/SabreTools.Serialization/Models/BSP/DispVertsLump.cs index f25a6e37..96923400 100644 --- a/SabreTools.Serialization/Models/BSP/DispVertsLump.cs +++ b/SabreTools.Serialization/Models/BSP/DispVertsLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Verts /// - public DispVert[]? Verts { get; set; } + public DispVert[] Verts { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Edge.cs b/SabreTools.Serialization/Models/BSP/Edge.cs index dbd3d2f4..8bbbd78e 100644 --- a/SabreTools.Serialization/Models/BSP/Edge.cs +++ b/SabreTools.Serialization/Models/BSP/Edge.cs @@ -4,9 +4,9 @@ namespace SabreTools.Data.Models.BSP { /// /// 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. /// - /// + /// /// [StructLayout(LayoutKind.Sequential)] public sealed class Edge @@ -15,6 +15,6 @@ namespace SabreTools.Data.Models.BSP /// Indices into vertex array /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public ushort[]? VertexIndices = new ushort[2]; + public ushort[] VertexIndices = new ushort[2]; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/EdgesLump.cs b/SabreTools.Serialization/Models/BSP/EdgesLump.cs index 7214756d..1b137c03 100644 --- a/SabreTools.Serialization/Models/BSP/EdgesLump.cs +++ b/SabreTools.Serialization/Models/BSP/EdgesLump.cs @@ -1,12 +1,12 @@ namespace SabreTools.Data.Models.BSP { - /// + /// /// public sealed class EdgesLump : Lump { /// /// Edge /// - public Edge[]? Edges { get; set; } + public Edge[] Edges { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/EntitiesLump.cs b/SabreTools.Serialization/Models/BSP/EntitiesLump.cs index 8b48402b..7cbeec0e 100644 --- a/SabreTools.Serialization/Models/BSP/EntitiesLump.cs +++ b/SabreTools.Serialization/Models/BSP/EntitiesLump.cs @@ -1,12 +1,12 @@ namespace SabreTools.Data.Models.BSP { - /// + /// /// public sealed class EntitiesLump : Lump { /// /// Entities /// - public Entity[]? Entities { get; set; } + public Entity[] Entities { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Entity.cs b/SabreTools.Serialization/Models/BSP/Entity.cs index 0556ad27..563b6e1f 100644 --- a/SabreTools.Serialization/Models/BSP/Entity.cs +++ b/SabreTools.Serialization/Models/BSP/Entity.cs @@ -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. /// - /// + /// /// public sealed class Entity { /// /// Entity attributes /// - public List>? Attributes { get; set; } + public List> Attributes { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Enums.cs b/SabreTools.Serialization/Models/BSP/Enums.cs index 02fc77f8..4a2b3721 100644 --- a/SabreTools.Serialization/Models/BSP/Enums.cs +++ b/SabreTools.Serialization/Models/BSP/Enums.cs @@ -2,7 +2,7 @@ using System; namespace SabreTools.Data.Models.BSP { - /// + /// public enum BspContents : int { CONTENTS_EMPTY = -1, @@ -22,7 +22,7 @@ namespace SabreTools.Data.Models.BSP CONTENTS_TRANSLUCENT = -15, } - /// + /// [Flags] public enum VbspContents : uint { @@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP CONTENTS_EMPTY = 0x00000000, /// - /// An eye is never valid in a solid + /// An eye is never valid in a solid /// CONTENTS_SOLID = 0x00000001, @@ -69,7 +69,7 @@ namespace SabreTools.Data.Models.BSP CONTENTS_MIST = 0x00000040, /// - /// Block AI line of sight + /// Block AI line of sight /// CONTENTS_BLOCKLOS = 0x00000040, @@ -101,13 +101,13 @@ namespace SabreTools.Data.Models.BSP /// /// Per team contents used to differentiate collisions - /// between players and objects on different teams + /// between players and objects on different teams /// CONTENTS_TEAM1 = 0x00000800, /// /// Per team contents used to differentiate collisions - /// between players and objects on different teams + /// between players and objects on different teams /// CONTENTS_TEAM2 = 0x00001000, @@ -215,12 +215,12 @@ namespace SabreTools.Data.Models.BSP CONTENTS_LADDER = 0x20000000, /// - /// Use accurate hitboxes on trace + /// Use accurate hitboxes on trace /// CONTENTS_HITBOX = 0x40000000, } - /// + /// [Flags] public enum DispTriTag : ushort { @@ -231,7 +231,7 @@ namespace SabreTools.Data.Models.BSP DISPTRI_FLAG_SURFPROP2 = 0x10, } - /// + /// public enum EmitType { /// @@ -267,8 +267,8 @@ namespace SabreTools.Data.Models.BSP EMIT_SKYAMBIENT, } - /// - /// + /// + /// 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. /// /// LUMP_TEXDATA in VBSP LUMP_TEXTURES = 2, /// /// 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. /// /// LUMP_VERTEXES in VBSP 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. /// LUMP_VISIBILITY = 4, /// /// 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. /// LUMP_NODES = 5, /// /// The texinfo lump contains informations about how textures are /// applied to surfaces. The lump itself is an array of binary data - /// structures. + /// structures. /// 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. /// LUMP_LIGHTING = 8, /// /// 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. /// /// LUMP_OCCLUSION in VBSP LUMP_CLIPNODES = 9, @@ -363,7 +363,7 @@ namespace SabreTools.Data.Models.BSP /// /// 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. /// 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. /// LUMP_SURFEDGES = 13, @@ -711,7 +711,7 @@ namespace SabreTools.Data.Models.BSP #endregion } - /// + /// public enum PlaneType : int { // Plane is perpendicular to given axis @@ -725,7 +725,7 @@ namespace SabreTools.Data.Models.BSP PLANE_ANYZ = 5, } - /// + /// [Flags] public enum StaticPropFlags : uint { @@ -787,7 +787,7 @@ namespace SabreTools.Data.Models.BSP STATIC_PROP_NO_PER_TEXEL_LIGHTING = 0x100, } - /// + /// [Flags] public enum StaticPropFlagsEx : uint { @@ -807,7 +807,7 @@ namespace SabreTools.Data.Models.BSP STATIC_PROP_FLAGS_EX_ENABLE_LIGHT_BOUNCE = 0x00000004, } - /// + /// [Flags] public enum SurfaceFlag : uint { @@ -908,12 +908,12 @@ namespace SabreTools.Data.Models.BSP SURF_NOCHOP = 0x4000, /// - /// Surface is part of a hitbox + /// Surface is part of a hitbox /// SURF_HITBOX = 0x8000, } - /// + /// [Flags] public enum TextureFlag : uint { @@ -923,4 +923,4 @@ namespace SabreTools.Data.Models.BSP /// Used by sky and liquids DisableLightmaps = 0x01, } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/GameLump.cs b/SabreTools.Serialization/Models/BSP/GameLump.cs index 614135c6..fb833140 100644 --- a/SabreTools.Serialization/Models/BSP/GameLump.cs +++ b/SabreTools.Serialization/Models/BSP/GameLump.cs @@ -15,8 +15,8 @@ namespace SabreTools.Data.Models.BSP public int LumpCount; /// - /// + /// /// - public GameLumpDirectory[]? Directories; + public GameLumpDirectory[] Directories; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/GameLumpDirectory.cs b/SabreTools.Serialization/Models/BSP/GameLumpDirectory.cs index 4b0b6108..5b11bf63 100644 --- a/SabreTools.Serialization/Models/BSP/GameLumpDirectory.cs +++ b/SabreTools.Serialization/Models/BSP/GameLumpDirectory.cs @@ -37,4 +37,4 @@ namespace SabreTools.Data.Models.BSP /// public int FileLength; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/LeafAmbientIndex.cs b/SabreTools.Serialization/Models/BSP/LeafAmbientIndex.cs index 7f644bc6..2547e99b 100644 --- a/SabreTools.Serialization/Models/BSP/LeafAmbientIndex.cs +++ b/SabreTools.Serialization/Models/BSP/LeafAmbientIndex.cs @@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP public ushort FirstAmbientSample; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/LeafAmbientLighting.cs b/SabreTools.Serialization/Models/BSP/LeafAmbientLighting.cs index e2c626f1..bc96a9d8 100644 --- a/SabreTools.Serialization/Models/BSP/LeafAmbientLighting.cs +++ b/SabreTools.Serialization/Models/BSP/LeafAmbientLighting.cs @@ -38,4 +38,4 @@ namespace SabreTools.Data.Models.BSP /// public byte Pad; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/LeafBrushesLump.cs b/SabreTools.Serialization/Models/BSP/LeafBrushesLump.cs index 5aa455cb..fe75c234 100644 --- a/SabreTools.Serialization/Models/BSP/LeafBrushesLump.cs +++ b/SabreTools.Serialization/Models/BSP/LeafBrushesLump.cs @@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP /// /// Map /// - public ushort[]? Map { get; set; } + public ushort[] Map { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/LeafFacesLump.cs b/SabreTools.Serialization/Models/BSP/LeafFacesLump.cs index 854b6d34..94b45fad 100644 --- a/SabreTools.Serialization/Models/BSP/LeafFacesLump.cs +++ b/SabreTools.Serialization/Models/BSP/LeafFacesLump.cs @@ -11,6 +11,6 @@ namespace SabreTools.Data.Models.BSP /// /// Map /// - public ushort[]? Map { get; set; } + public ushort[] Map { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/LightmapLump.cs b/SabreTools.Serialization/Models/BSP/LightmapLump.cs index 61d4c5fb..afd1808a 100644 --- a/SabreTools.Serialization/Models/BSP/LightmapLump.cs +++ b/SabreTools.Serialization/Models/BSP/LightmapLump.cs @@ -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. /// - /// + /// public sealed class LightmapLump : Lump { /// /// Lightmap RGB values /// /// Array of 3-byte values - public byte[][]? Lightmap { get; set; } + public byte[][] Lightmap { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Lump.cs b/SabreTools.Serialization/Models/BSP/Lump.cs index 7a02eed4..12179662 100644 --- a/SabreTools.Serialization/Models/BSP/Lump.cs +++ b/SabreTools.Serialization/Models/BSP/Lump.cs @@ -3,10 +3,10 @@ namespace SabreTools.Data.Models.BSP /// /// Represents a common Lump type /// - /// + /// /// public abstract class Lump { // No shared fields between types } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/MarksurfacesLump.cs b/SabreTools.Serialization/Models/BSP/MarksurfacesLump.cs index ae270960..fffcd030 100644 --- a/SabreTools.Serialization/Models/BSP/MarksurfacesLump.cs +++ b/SabreTools.Serialization/Models/BSP/MarksurfacesLump.cs @@ -2,18 +2,18 @@ namespace SabreTools.Data.Models.BSP { /// /// 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. /// - /// + /// public sealed class MarksurfacesLump : Lump { /// /// Marksurfaces /// - public ushort[]? Marksurfaces { get; set; } + public ushort[] Marksurfaces { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/MipTexture.cs b/SabreTools.Serialization/Models/BSP/MipTexture.cs index c4b9246a..91e5e0f9 100644 --- a/SabreTools.Serialization/Models/BSP/MipTexture.cs +++ b/SabreTools.Serialization/Models/BSP/MipTexture.cs @@ -15,7 +15,7 @@ namespace SabreTools.Data.Models.BSP /// texture lump relative to the beginning of it's BSPMIPTEX struct. /// /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class MipTexture { @@ -24,7 +24,7 @@ namespace SabreTools.Data.Models.BSP /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = Constants.MAXTEXTURENAME)] public string? Name; - + /// /// Extends of the texture /// @@ -39,6 +39,6 @@ namespace SabreTools.Data.Models.BSP /// Offsets to texture mipmaps BSPMIPTEX /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = Constants.MIPLEVELS)] - public uint[]? Offsets; + public uint[] Offsets; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/OccluderData.cs b/SabreTools.Serialization/Models/BSP/OccluderData.cs index 33f0f356..50d6754c 100644 --- a/SabreTools.Serialization/Models/BSP/OccluderData.cs +++ b/SabreTools.Serialization/Models/BSP/OccluderData.cs @@ -27,14 +27,14 @@ namespace SabreTools.Data.Models.BSP /// /// Minima of all vertices /// - public Vector3D? Mins; + public Vector3D Mins; /// /// Maxima of all vertices /// - public Vector3D? Maxs; + public Vector3D Maxs; /// Since v1 public int Area; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/OccluderPolyData.cs b/SabreTools.Serialization/Models/BSP/OccluderPolyData.cs index 3fb0d1ab..38368b8e 100644 --- a/SabreTools.Serialization/Models/BSP/OccluderPolyData.cs +++ b/SabreTools.Serialization/Models/BSP/OccluderPolyData.cs @@ -26,4 +26,4 @@ namespace SabreTools.Data.Models.BSP public int PlanEnum; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/OcclusionLump.cs b/SabreTools.Serialization/Models/BSP/OcclusionLump.cs index a8d30eb5..6cc41550 100644 --- a/SabreTools.Serialization/Models/BSP/OcclusionLump.cs +++ b/SabreTools.Serialization/Models/BSP/OcclusionLump.cs @@ -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 /// /// /// - public OccluderData[]? Data; - + public OccluderData[] Data; + public int PolyDataCount; /// /// /// - public OccluderPolyData[]? PolyData; + public OccluderPolyData[] PolyData; public int VertexIndexCount; /// /// /// - public int[]? VertexIndicies; + public int[] VertexIndicies; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Overlay.cs b/SabreTools.Serialization/Models/BSP/Overlay.cs index c9b8be6d..85e3032c 100644 --- a/SabreTools.Serialization/Models/BSP/Overlay.cs +++ b/SabreTools.Serialization/Models/BSP/Overlay.cs @@ -5,8 +5,8 @@ namespace SabreTools.Data.Models.BSP /// /// 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. /// /// [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; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/OverlaysLump.cs b/SabreTools.Serialization/Models/BSP/OverlaysLump.cs index 705b06ee..8274312b 100644 --- a/SabreTools.Serialization/Models/BSP/OverlaysLump.cs +++ b/SabreTools.Serialization/Models/BSP/OverlaysLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Overlays /// - public Overlay[]? Overlays { get; set; } + public Overlay[] Overlays { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/PhysCollideLump.cs b/SabreTools.Serialization/Models/BSP/PhysCollideLump.cs index 62c0b92c..b3ba97ad 100644 --- a/SabreTools.Serialization/Models/BSP/PhysCollideLump.cs +++ b/SabreTools.Serialization/Models/BSP/PhysCollideLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Models /// - public PhysModel[]? Models { get; set; } + public PhysModel[] Models { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/PhysModel.cs b/SabreTools.Serialization/Models/BSP/PhysModel.cs index 6d855b29..1f7238a2 100644 --- a/SabreTools.Serialization/Models/BSP/PhysModel.cs +++ b/SabreTools.Serialization/Models/BSP/PhysModel.cs @@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP /// /// Collision data of length /// - public PhysSolid[]? Solids; + public PhysSolid[] Solids; /// /// Key data of size diff --git a/SabreTools.Serialization/Models/BSP/Plane.cs b/SabreTools.Serialization/Models/BSP/Plane.cs index c7f3f6bd..9fb94663 100644 --- a/SabreTools.Serialization/Models/BSP/Plane.cs +++ b/SabreTools.Serialization/Models/BSP/Plane.cs @@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP /// /// 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. /// - /// + /// /// [StructLayout(LayoutKind.Sequential)] public sealed class Plane @@ -25,7 +25,7 @@ namespace SabreTools.Data.Models.BSP /// /// The planes normal vector /// - public Vector3D? NormalVector; + public Vector3D NormalVector; /// /// Plane equation is: vNormal * X = fDist @@ -37,4 +37,4 @@ namespace SabreTools.Data.Models.BSP /// public PlaneType PlaneType; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/PlanesLump.cs b/SabreTools.Serialization/Models/BSP/PlanesLump.cs index 66032c38..ff0eb4a7 100644 --- a/SabreTools.Serialization/Models/BSP/PlanesLump.cs +++ b/SabreTools.Serialization/Models/BSP/PlanesLump.cs @@ -1,12 +1,12 @@ namespace SabreTools.Data.Models.BSP { - /// + /// /// public sealed class PlanesLump : Lump { /// /// Planes /// - public Plane[]? Planes { get; set; } + public Plane[] Planes { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/QAngle.cs b/SabreTools.Serialization/Models/BSP/QAngle.cs index 1fa42d06..ac841523 100644 --- a/SabreTools.Serialization/Models/BSP/QAngle.cs +++ b/SabreTools.Serialization/Models/BSP/QAngle.cs @@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP public float Y; public float Z; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/StaticPropDictLump.cs b/SabreTools.Serialization/Models/BSP/StaticPropDictLump.cs index 4e181b2e..606deb95 100644 --- a/SabreTools.Serialization/Models/BSP/StaticPropDictLump.cs +++ b/SabreTools.Serialization/Models/BSP/StaticPropDictLump.cs @@ -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 /// @@ -19,6 +19,6 @@ namespace SabreTools.Data.Models.BSP /// Model name /// /// [dictEntries][128] - public char[][]? Name; + public char[][] Name; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/StaticPropLeafLump.cs b/SabreTools.Serialization/Models/BSP/StaticPropLeafLump.cs index 8c92aa4a..4f94776d 100644 --- a/SabreTools.Serialization/Models/BSP/StaticPropLeafLump.cs +++ b/SabreTools.Serialization/Models/BSP/StaticPropLeafLump.cs @@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP /// /// /// - public ushort[]? Leaf; + public ushort[] Leaf; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/StaticPropLump.cs b/SabreTools.Serialization/Models/BSP/StaticPropLump.cs index 40dc0c62..ae3e8239 100644 --- a/SabreTools.Serialization/Models/BSP/StaticPropLump.cs +++ b/SabreTools.Serialization/Models/BSP/StaticPropLump.cs @@ -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. /// /// 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 } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/SurfedgesLump.cs b/SabreTools.Serialization/Models/BSP/SurfedgesLump.cs index ab65a024..78624400 100644 --- a/SabreTools.Serialization/Models/BSP/SurfedgesLump.cs +++ b/SabreTools.Serialization/Models/BSP/SurfedgesLump.cs @@ -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. /// - /// + /// /// public sealed class SurfedgesLump : Lump { /// /// Surfedges /// - public int[]? Surfedges { get; set; } + public int[] Surfedges { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Texdata.cs b/SabreTools.Serialization/Models/BSP/Texdata.cs index 47ad304c..320c5b45 100644 --- a/SabreTools.Serialization/Models/BSP/Texdata.cs +++ b/SabreTools.Serialization/Models/BSP/Texdata.cs @@ -16,7 +16,7 @@ namespace SabreTools.Data.Models.BSP /// /// RGB reflectivity /// - public Vector3D? Reflectivity; + public Vector3D Reflectivity; /// /// Index into TexdataStringTable @@ -37,4 +37,4 @@ namespace SabreTools.Data.Models.BSP public int ViewHeight; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/TexdataLump.cs b/SabreTools.Serialization/Models/BSP/TexdataLump.cs index a274fd40..724135d2 100644 --- a/SabreTools.Serialization/Models/BSP/TexdataLump.cs +++ b/SabreTools.Serialization/Models/BSP/TexdataLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Texdatas /// - public Texdata[]? Texdatas { get; set; } + public Texdata[] Texdatas { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/TexdataStringData.cs b/SabreTools.Serialization/Models/BSP/TexdataStringData.cs index 30d511fc..beab755e 100644 --- a/SabreTools.Serialization/Models/BSP/TexdataStringData.cs +++ b/SabreTools.Serialization/Models/BSP/TexdataStringData.cs @@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.BSP /// /// Strings /// - public string[]? Strings { get; set; } + public string[] Strings { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/TexdataStringTable.cs b/SabreTools.Serialization/Models/BSP/TexdataStringTable.cs index 68644f7b..70e8a781 100644 --- a/SabreTools.Serialization/Models/BSP/TexdataStringTable.cs +++ b/SabreTools.Serialization/Models/BSP/TexdataStringTable.cs @@ -10,6 +10,6 @@ namespace SabreTools.Data.Models.BSP /// /// Offsets /// - public int[]? Offsets { get; set; } + public int[] Offsets { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/TextureHeader.cs b/SabreTools.Serialization/Models/BSP/TextureHeader.cs index 2e69a4d2..c571ed86 100644 --- a/SabreTools.Serialization/Models/BSP/TextureHeader.cs +++ b/SabreTools.Serialization/Models/BSP/TextureHeader.cs @@ -1,7 +1,7 @@ namespace SabreTools.Data.Models.BSP { /// - /// + /// public sealed class TextureHeader { /// @@ -13,6 +13,6 @@ namespace SabreTools.Data.Models.BSP /// Offsets /// /// entries - public int[]? Offsets { get; set; } + public int[] Offsets { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/TextureLump.cs b/SabreTools.Serialization/Models/BSP/TextureLump.cs index 6bdb0c9a..bb350d95 100644 --- a/SabreTools.Serialization/Models/BSP/TextureLump.cs +++ b/SabreTools.Serialization/Models/BSP/TextureLump.cs @@ -1,16 +1,16 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class TextureLump : Lump { /// /// Texture header data /// - public TextureHeader? Header { get; set; } + public TextureHeader Header { get; set; } /// /// Textures /// - public MipTexture[]? Textures { get; set; } + public MipTexture[] Textures { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspFace.cs b/SabreTools.Serialization/Models/BSP/VbspFace.cs index 7fc457b0..eb952f27 100644 --- a/SabreTools.Serialization/Models/BSP/VbspFace.cs +++ b/SabreTools.Serialization/Models/BSP/VbspFace.cs @@ -74,13 +74,13 @@ namespace SabreTools.Data.Models.BSP /// Texture lighting info /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public int[]? LightmapTextureMinsInLuxels = new int[2]; + public int[] LightmapTextureMinsInLuxels = new int[2]; /// /// Texture lighting info /// [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] - public int[]? LightmapTextureSizeInLuxels = new int[2]; + public int[] LightmapTextureSizeInLuxels = new int[2]; /// /// Original face this was split from diff --git a/SabreTools.Serialization/Models/BSP/VbspFacesLump.cs b/SabreTools.Serialization/Models/BSP/VbspFacesLump.cs index d51f72ea..896a99e5 100644 --- a/SabreTools.Serialization/Models/BSP/VbspFacesLump.cs +++ b/SabreTools.Serialization/Models/BSP/VbspFacesLump.cs @@ -6,6 +6,6 @@ namespace SabreTools.Data.Models.BSP /// /// Faces /// - public VbspFace[]? Faces { get; set; } + public VbspFace[] Faces { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspFile.cs b/SabreTools.Serialization/Models/BSP/VbspFile.cs index 2f092a1a..bbb7cd50 100644 --- a/SabreTools.Serialization/Models/BSP/VbspFile.cs +++ b/SabreTools.Serialization/Models/BSP/VbspFile.cs @@ -10,189 +10,189 @@ namespace SabreTools.Data.Models.BSP /// /// Header data /// - public VbspHeader? Header { get; set; } + public VbspHeader Header { get; set; } #region Lumps /// /// LUMP_ENTITIES [0] /// - public EntitiesLump? Entities { get; set; } + public EntitiesLump Entities { get; set; } /// /// LUMP_PLANES [1] /// - public PlanesLump? PlanesLump { get; set; } + public PlanesLump PlanesLump { get; set; } /// /// LUMP_TEXDATA [2] /// - public TexdataLump? TexdataLump { get; set; } + public TexdataLump TexdataLump { get; set; } /// /// LUMP_VERTEXES [3] /// - public VerticesLump? VerticesLump { get; set; } + public VerticesLump VerticesLump { get; set; } /// /// LUMP_VISIBILITY [4] /// - public VisibilityLump? VisibilityLump { get; set; } + public VisibilityLump VisibilityLump { get; set; } /// /// LUMP_NODES [5] /// - public VbspNodesLump? NodesLump { get; set; } + public VbspNodesLump NodesLump { get; set; } /// /// LUMP_TEXINFO [6] /// - public VbspTexinfoLump? TexinfoLump { get; set; } + public VbspTexinfoLump TexinfoLump { get; set; } /// /// LUMP_FACES [7] /// - public VbspFacesLump? FacesLump { get; set; } + public VbspFacesLump FacesLump { get; set; } /// /// LUMP_LIGHTING [8] /// - public LightmapLump? LightmapLump { get; set; } + public LightmapLump LightmapLump { get; set; } /// /// LUMP_OCCLUSION [9] /// s - public OcclusionLump? OcclusionLump { get; set; } + public OcclusionLump OcclusionLump { get; set; } /// /// LUMP_LEAVES [10] /// - public VbspLeavesLump? LeavesLump { get; set; } + public VbspLeavesLump LeavesLump { get; set; } /// /// LUMP_FACEIDS [11] /// - public MarksurfacesLump? MarksurfacesLump { get; set; } + public MarksurfacesLump MarksurfacesLump { get; set; } /// /// LUMP_EDGES [12] /// - public EdgesLump? EdgesLump { get; set; } + public EdgesLump EdgesLump { get; set; } /// /// LUMP_SURFEDGES [13] /// - public SurfedgesLump? SurfedgesLump { get; set; } + public SurfedgesLump SurfedgesLump { get; set; } /// /// LUMP_MODELS [14] /// - public VbspModelsLump? ModelsLump { get; set; } + public VbspModelsLump ModelsLump { get; set; } /// /// LUMP_WORLDLIGHTS [15] /// - public WorldLightsLump? LDRWorldLightsLump { get; set; } + public WorldLightsLump LDRWorldLightsLump { get; set; } /// /// LUMP_LEAFFACES [16] /// - public LeafFacesLump? LeafFacesLump { get; set; } + public LeafFacesLump LeafFacesLump { get; set; } /// /// LUMP_LEAFBRUSHES [17] /// - public LeafBrushesLump? LeafBrushesLump { get; set; } + public LeafBrushesLump LeafBrushesLump { get; set; } /// /// LUMP_BRUSHES [18] /// - public BrushesLump? BrushesLump { get; set; } + public BrushesLump BrushesLump { get; set; } /// /// LUMP_BRUSHSIDES [19] /// - public BrushsidesLump? BrushsidesLump { get; set; } + public BrushsidesLump BrushsidesLump { get; set; } /// /// LUMP_AREAS [20] /// /// TODO: Find definition and implement - // public AreasLump? AreasLump { get; set; } + // public AreasLump AreasLump { get; set; } /// /// LUMP_AREAPORTALS [21] /// /// TODO: Find definition and implement - // public AreaPortalsLump? AreaPortalsLump { get; set; } + // public AreaPortalsLump AreaPortalsLump { get; set; } /// /// LUMP_PORTALS / LUMP_UNUSED0 / LUMP_PROPCOLLISION [22] /// /// TODO: Find definition and implement - // public PortalsLump? PortalsLump { get; set; } + // public PortalsLump PortalsLump { get; set; } /// /// LUMP_CLUSTERS / LUMP_UNUSED1 / LUMP_PROPHULLS [23] /// /// TODO: Find definition and implement - // public ClustersLump? ClustersLump { get; set; } + // public ClustersLump ClustersLump { get; set; } /// /// LUMP_PORTALVERTS / LUMP_UNUSED2 / LUMP_FAKEENTITIES / LUMP_PROPHULLVERTS [24] /// /// TODO: Find definition and implement - // public PortalVertsLump? PortalVertsLump { get; set; } + // public PortalVertsLump PortalVertsLump { get; set; } /// /// LUMP_CLUSTERPORTALS / LUMP_UNUSED3 / LUMP_PROPTRIS [25] /// /// TODO: Find definition and implement - // public ClusterPortalsLump? ClusterPortalsLump { get; set; } + // public ClusterPortalsLump ClusterPortalsLump { get; set; } /// /// LUMP_DISPINFO [26] /// - public DispInfosLump? DispInfosLump { get; set; } + public DispInfosLump DispInfosLump { get; set; } /// /// LUMP_ORIGINALFACES [27] /// - public VbspFacesLump? OriginalFacesLump { get; set; } + public VbspFacesLump OriginalFacesLump { get; set; } /// /// LUMP_PHYSDISP [28] /// /// TODO: Find definition and implement - // public PhysDispLump? PhysDispLump { get; set; } + // public PhysDispLump PhysDispLump { get; set; } /// /// LUMP_PHYSCOLLIDE [29] /// - public PhysCollideLump? PhysCollideLump { get; set; } + public PhysCollideLump PhysCollideLump { get; set; } /// /// LUMP_VERTNORMALS [30] /// /// TODO: Find definition and implement - // public VertNormalsLump? VertNormalsLump { get; set; } + // public VertNormalsLump VertNormalsLump { get; set; } /// /// LUMP_VERTNORMALINDICES [31] /// /// TODO: Find definition and implement - // public VertNormalIndicesLump? VertNormalIndicesLump { get; set; } + // public VertNormalIndicesLump VertNormalIndicesLump { get; set; } /// /// LUMP_DISP_LIGHTMAP_ALPHAS [32] /// /// TODO: Find definition and implement - // public DispLightmapAlphasLump? DispLightmapAlphasLump { get; set; } + // public DispLightmapAlphasLump DispLightmapAlphasLump { get; set; } /// /// LUMP_DISP_VERTS [33] /// - public DispVertsLump? DispVertsLump { get; set; } + public DispVertsLump DispVertsLump { get; set; } /// /// LUMP_DISP_LIGHTMAP_SAMPLE_POSITIONS [34] @@ -203,47 +203,47 @@ namespace SabreTools.Data.Models.BSP /// /// LUMP_GAME_LUMP [35] /// - public GameLump? GameLump { get; set; } + public GameLump GameLump { get; set; } /// /// LUMP_LEAFWATERDATA [36] /// /// TODO: Find definition and implement - // public LeafWaterDataLump? LeafWaterDataLump { get; set; } + // public LeafWaterDataLump LeafWaterDataLump { get; set; } /// /// LUMP_PRIMITIVES [37] /// /// TODO: Find definition and implement - // public PrimitivesLump? PrimitivesLump { get; set; } + // public PrimitivesLump PrimitivesLump { get; set; } /// /// LUMP_PRIMVERTS [38] /// /// TODO: Find definition and implement - // public PrimVertsLump? PrimVertsLump { get; set; } + // public PrimVertsLump PrimVertsLump { get; set; } /// /// LUMP_PRIMINDICES [39] /// /// TODO: Find definition and implement - // public PrimIndicesLump? PrimIndicesLump { get; set; } + // public PrimIndicesLump PrimIndicesLump { get; set; } /// /// LUMP_PAKFILE [40] /// - public PakfileLump? PakfileLump { get; set; } + public PakfileLump PakfileLump { get; set; } /// /// LUMP_CLIPPORTALVERTS [41] /// /// TODO: Find definition and implement - // public ClipPortalVertsLump? ClipPortalVertsLump { get; set; } + // public ClipPortalVertsLump ClipPortalVertsLump { get; set; } /// /// LUMP_CUBEMAPS [42] /// - public CubemapsLump? CubemapsLump { get; set; } + public CubemapsLump CubemapsLump { get; set; } /// /// LUMP_TEXDATA_STRING_DATA [43] @@ -258,110 +258,110 @@ namespace SabreTools.Data.Models.BSP /// /// LUMP_OVERLAYS [45] /// - public OverlaysLump? OverlaysLump { get; set; } + public OverlaysLump OverlaysLump { get; set; } /// /// LUMP_LEAFMINDISTTOWATER [46] /// /// TODO: Find definition and implement - // public LeafMindIsToWaterLump? LeafMindIsToWaterLump { get; set; } + // public LeafMindIsToWaterLump LeafMindIsToWaterLump { get; set; } /// /// LUMP_FACE_MACRO_TEXTURE_INFO [47] /// /// TODO: Find definition and implement - // public FaceMacroTextureInfoLump? FaceMacroTextureInfoLump { get; set; } + // public FaceMacroTextureInfoLump FaceMacroTextureInfoLump { get; set; } /// /// LUMP_DISP_TRIS [48] /// - public DispTrisLump? DispTrisLump { get; set; } + public DispTrisLump DispTrisLump { get; set; } /// /// LUMP_PHYSCOLLIDESURFACE / LUMP_PROP_BLOB [49] /// /// TODO: Find definition and implement - // public PhysCollideSurfaceLump? PhysCollideSurfaceLump { get; set; } + // public PhysCollideSurfaceLump PhysCollideSurfaceLump { get; set; } /// /// LUMP_WATEROVERLAYS [50] /// /// TODO: Find definition and implement - // public WaterOverlaysLump? WaterOverlaysLump { get; set; } + // public WaterOverlaysLump WaterOverlaysLump { get; set; } /// /// LUMP_LIGHTMAPPAGES / LUMP_LEAF_AMBIENT_INDEX_HDR [51] /// - public AmbientIndexLump? HDRAmbientIndexLump { get; set; } + public AmbientIndexLump HDRAmbientIndexLump { get; set; } /// /// LUMP_LIGHTMAPPAGEINFOS / LUMP_LEAF_AMBIENT_INDEX [52] /// - public AmbientIndexLump? LDRAmbientIndexLump { get; set; } + public AmbientIndexLump LDRAmbientIndexLump { get; set; } /// /// LUMP_LIGHTING_HDR [53] /// /// TODO: Find definition and implement - // public LightingHdrLump? LightingHdrLump { get; set; } + // public LightingHdrLump LightingHdrLump { get; set; } /// /// LUMP_WORLDLIGHTS_HDR [54] /// - public WorldLightsLump? HDRWorldLightsLump { get; set; } + public WorldLightsLump HDRWorldLightsLump { get; set; } /// /// LUMP_LEAF_AMBIENT_LIGHTING_HDR [55] /// - public AmbientLightingLump? HDRAmbientLightingLump { get; set; } + public AmbientLightingLump HDRAmbientLightingLump { get; set; } /// /// LUMP_LEAF_AMBIENT_LIGHTING [56] /// - public AmbientLightingLump? LDRAmbientLightingLump { get; set; } + public AmbientLightingLump LDRAmbientLightingLump { get; set; } /// /// LUMP_XZIPPAKFILE [57] /// /// TODO: Find definition and implement - // public XzipPakFileLump? XzipPakFileLump { get; set; } + // public XzipPakFileLump XzipPakFileLump { get; set; } /// /// LUMP_FACES_HDR [58] /// /// TODO: Find definition and implement - // public FacesHdrLump? FacesHdrLump { get; set; } + // public FacesHdrLump FacesHdrLump { get; set; } /// /// LUMP_MAP_FLAGS [59] /// /// TODO: Find definition and implement - // public MapFlagsLump? MapFlagsLump { get; set; } + // public MapFlagsLump MapFlagsLump { get; set; } /// /// LUMP_OVERLAY_FADES [60] /// /// TODO: Find definition and implement - // public OverlayFadesLump? OverlayFadesLump { get; set; } + // public OverlayFadesLump OverlayFadesLump { get; set; } /// /// LUMP_OVERLAY_SYSTEM_LEVELS [61] /// /// TODO: Find definition and implement - // public OverlaySystemLevelsLump? OverlaySystemLevelsLump { get; set; } + // public OverlaySystemLevelsLump OverlaySystemLevelsLump { get; set; } /// /// LUMP_PHYSLEVEL [62] /// /// TODO: Find definition and implement - // public PhysLevelLump? PhysLevelLump { get; set; } + // public PhysLevelLump PhysLevelLump { get; set; } /// /// LUMP_DISP_MULTIBLEND [63] /// /// TODO: Find definition and implement - // public DispMultiBlendLump? DispMultiBlendLump { get; set; } + // public DispMultiBlendLump DispMultiBlendLump { get; set; } #endregion } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspHeader.cs b/SabreTools.Serialization/Models/BSP/VbspHeader.cs index ba83b5ef..7a3d7e1e 100644 --- a/SabreTools.Serialization/Models/BSP/VbspHeader.cs +++ b/SabreTools.Serialization/Models/BSP/VbspHeader.cs @@ -11,7 +11,7 @@ namespace SabreTools.Data.Models.BSP /// BSP file signature /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - public string? Signature; + public string Signature; /// /// BSP file version @@ -23,7 +23,7 @@ namespace SabreTools.Data.Models.BSP /// Lump directory array /// [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]; /// /// The map's revision (iteration, version) number. diff --git a/SabreTools.Serialization/Models/BSP/VbspLeaf.cs b/SabreTools.Serialization/Models/BSP/VbspLeaf.cs index 14c24a28..4004cf3a 100644 --- a/SabreTools.Serialization/Models/BSP/VbspLeaf.cs +++ b/SabreTools.Serialization/Models/BSP/VbspLeaf.cs @@ -4,7 +4,7 @@ namespace SabreTools.Data.Models.BSP { /// /// 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. /// - /// + /// public sealed class VbspLeaf { /// @@ -83,7 +83,7 @@ namespace SabreTools.Data.Models.BSP /// /// Precaculated light info for entities. /// - public CompressedLightCube? AmbientLighting; + public CompressedLightCube AmbientLighting; #endregion @@ -96,4 +96,4 @@ namespace SabreTools.Data.Models.BSP #endregion } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspLeavesLump.cs b/SabreTools.Serialization/Models/BSP/VbspLeavesLump.cs index b2a9ac74..56752e9d 100644 --- a/SabreTools.Serialization/Models/BSP/VbspLeavesLump.cs +++ b/SabreTools.Serialization/Models/BSP/VbspLeavesLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class VbspLeavesLump : Lump { /// /// Leaves /// - public VbspLeaf[]? Leaves { get; set; } + public VbspLeaf[] Leaves { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspModel.cs b/SabreTools.Serialization/Models/BSP/VbspModel.cs index d3cbb7ca..2f38ccad 100644 --- a/SabreTools.Serialization/Models/BSP/VbspModel.cs +++ b/SabreTools.Serialization/Models/BSP/VbspModel.cs @@ -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. /// - /// + /// [StructLayout(LayoutKind.Sequential)] public sealed class VbspModel { /// /// Bounding box /// - public Vector3D? Mins; + public Vector3D Mins; /// /// Bounding box /// - public Vector3D? Maxs; + public Vector3D Maxs; /// /// For sounds or lights /// - public Vector3D? OriginVector; + public Vector3D OriginVector; /// /// Index into nodes @@ -42,4 +42,4 @@ namespace SabreTools.Data.Models.BSP /// public int FacesCount; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspModelsLump.cs b/SabreTools.Serialization/Models/BSP/VbspModelsLump.cs index e95b3a71..9a3fa034 100644 --- a/SabreTools.Serialization/Models/BSP/VbspModelsLump.cs +++ b/SabreTools.Serialization/Models/BSP/VbspModelsLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class VbspModelsLump : Lump { /// /// Model /// - public VbspModel[]? Models { get; set; } + public VbspModel[] Models { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspNode.cs b/SabreTools.Serialization/Models/BSP/VbspNode.cs index 867b0a2b..e91b2498 100644 --- a/SabreTools.Serialization/Models/BSP/VbspNode.cs +++ b/SabreTools.Serialization/Models/BSP/VbspNode.cs @@ -5,7 +5,7 @@ namespace SabreTools.Data.Models.BSP /// /// 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. /// - /// - /// + /// + /// [StructLayout(LayoutKind.Sequential)] public class VbspNode : BspNode { @@ -36,4 +36,4 @@ namespace SabreTools.Data.Models.BSP /// public short Padding; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspNodesLump.cs b/SabreTools.Serialization/Models/BSP/VbspNodesLump.cs index bc483aaf..e07a6360 100644 --- a/SabreTools.Serialization/Models/BSP/VbspNodesLump.cs +++ b/SabreTools.Serialization/Models/BSP/VbspNodesLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class VbspNodesLump : Lump { /// /// Nodes /// - public VbspNode[]? Nodes { get; set; } + public VbspNode[] Nodes { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspTexinfo.cs b/SabreTools.Serialization/Models/BSP/VbspTexinfo.cs index 2a74ceee..1ce0a6ec 100644 --- a/SabreTools.Serialization/Models/BSP/VbspTexinfo.cs +++ b/SabreTools.Serialization/Models/BSP/VbspTexinfo.cs @@ -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 /// /// Texture S-vector /// - public Vector3D? TextureSVector; + public Vector3D TextureSVector; /// /// Texture shift in the S direction @@ -32,7 +32,7 @@ namespace SabreTools.Data.Models.BSP /// /// Texture T-vector /// - public Vector3D? TextureTVector; + public Vector3D TextureTVector; /// /// Texture shift in the T direction @@ -42,7 +42,7 @@ namespace SabreTools.Data.Models.BSP /// /// Lightmap S-vector /// - public Vector3D? LightmapSVector; + public Vector3D LightmapSVector; /// /// Lightmap shift in the S direction @@ -52,7 +52,7 @@ namespace SabreTools.Data.Models.BSP /// /// Lightmap T-vector /// - public Vector3D? LightmapTVector; + public Vector3D LightmapTVector; /// /// Lightmap shift in the T direction @@ -69,4 +69,4 @@ namespace SabreTools.Data.Models.BSP /// public int TexData; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VbspTexinfoLump.cs b/SabreTools.Serialization/Models/BSP/VbspTexinfoLump.cs index 3f4e8e38..243f6854 100644 --- a/SabreTools.Serialization/Models/BSP/VbspTexinfoLump.cs +++ b/SabreTools.Serialization/Models/BSP/VbspTexinfoLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class VbspTexinfoLump : Lump { /// /// Texinfos /// - public VbspTexinfo[]? Texinfos { get; set; } + public VbspTexinfo[] Texinfos { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/Vector3D.cs b/SabreTools.Serialization/Models/BSP/Vector3D.cs index 4f8fcfd9..317a92fb 100644 --- a/SabreTools.Serialization/Models/BSP/Vector3D.cs +++ b/SabreTools.Serialization/Models/BSP/Vector3D.cs @@ -14,4 +14,4 @@ namespace SabreTools.Data.Models.BSP public float Y; public float Z; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VerticesLump.cs b/SabreTools.Serialization/Models/BSP/VerticesLump.cs index b0272753..f0e69f07 100644 --- a/SabreTools.Serialization/Models/BSP/VerticesLump.cs +++ b/SabreTools.Serialization/Models/BSP/VerticesLump.cs @@ -2,15 +2,15 @@ namespace SabreTools.Data.Models.BSP { /// /// 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. /// - /// + /// /// public sealed class VerticesLump : Lump { /// /// Vertices /// - public Vector3D[]? Vertices { get; set; } + public Vector3D[] Vertices { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/VisibilityLump.cs b/SabreTools.Serialization/Models/BSP/VisibilityLump.cs index 61783a0a..cd95f15f 100644 --- a/SabreTools.Serialization/Models/BSP/VisibilityLump.cs +++ b/SabreTools.Serialization/Models/BSP/VisibilityLump.cs @@ -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. /// - /// - /// + /// + /// public sealed class VisibilityLump { public int NumClusters { get; set; } /// [numclusters][2] - public int[][]? ByteOffsets { get; set; } + public int[][] ByteOffsets { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/WorldLight.cs b/SabreTools.Serialization/Models/BSP/WorldLight.cs index 5eb2c313..96ced2c4 100644 --- a/SabreTools.Serialization/Models/BSP/WorldLight.cs +++ b/SabreTools.Serialization/Models/BSP/WorldLight.cs @@ -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; /// /// For surfaces and spotlights /// - public Vector3D? Normal; + public Vector3D Normal; public int Cluster; @@ -46,7 +46,7 @@ namespace SabreTools.Data.Models.BSP /// 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 /// public int Owner; } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Models/BSP/WorldLightsLump.cs b/SabreTools.Serialization/Models/BSP/WorldLightsLump.cs index 48fd4c63..7d85d8f2 100644 --- a/SabreTools.Serialization/Models/BSP/WorldLightsLump.cs +++ b/SabreTools.Serialization/Models/BSP/WorldLightsLump.cs @@ -1,11 +1,11 @@ namespace SabreTools.Data.Models.BSP { - /// + /// public sealed class WorldLightsLump : Lump { /// /// WorldLights /// - public WorldLight[]? WorldLights { get; set; } + public WorldLight[] WorldLights { get; set; } } -} \ No newline at end of file +} diff --git a/SabreTools.Serialization/Wrappers/BSP.Printing.cs b/SabreTools.Serialization/Wrappers/BSP.Printing.cs index c55d8aec..e3a6a362 100644 --- a/SabreTools.Serialization/Wrappers/BSP.Printing.cs +++ b/SabreTools.Serialization/Wrappers/BSP.Printing.cs @@ -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; diff --git a/SabreTools.Serialization/Wrappers/BSP.cs b/SabreTools.Serialization/Wrappers/BSP.cs index 2b5ce734..9b55f6cd 100644 --- a/SabreTools.Serialization/Wrappers/BSP.cs +++ b/SabreTools.Serialization/Wrappers/BSP.cs @@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers #region Extension Properties /// - public BspLumpEntry[]? Lumps => Model.Header?.Lumps; + public BspLumpEntry[] Lumps => Model.Header.Lumps; #endregion diff --git a/SabreTools.Serialization/Wrappers/VBSP.Printing.cs b/SabreTools.Serialization/Wrappers/VBSP.Printing.cs index a1ed6619..e965da81 100644 --- a/SabreTools.Serialization/Wrappers/VBSP.Printing.cs +++ b/SabreTools.Serialization/Wrappers/VBSP.Printing.cs @@ -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; diff --git a/SabreTools.Serialization/Wrappers/VBSP.cs b/SabreTools.Serialization/Wrappers/VBSP.cs index 92028b64..85f9cd6e 100644 --- a/SabreTools.Serialization/Wrappers/VBSP.cs +++ b/SabreTools.Serialization/Wrappers/VBSP.cs @@ -15,7 +15,7 @@ namespace SabreTools.Serialization.Wrappers #region Extension Properties /// - public VbspLumpEntry[]? Lumps => Model.Header?.Lumps; + public VbspLumpEntry[] Lumps => Model.Header.Lumps; #endregion