From 1a7203637d947b88255e68fe5f00202571ad73ff Mon Sep 17 00:00:00 2001 From: wfowler Date: Mon, 9 Jul 2018 02:32:11 -0600 Subject: [PATCH] Add more fields to DisplacementInfo. Also fix a Unity-compile oversight. Again. --- LibBSP/Source/Structs/BSP/Cubemap.cs | 2 +- LibBSP/Source/Structs/BSP/DisplacementInfo.cs | 18 +++++++++++++++--- .../Source/Structs/BSP/DisplacementVertex.cs | 2 +- LibBSP/Source/Structs/BSP/Face.cs | 2 +- LibBSP/Source/Structs/BSP/StaticProp.cs | 2 +- LibBSP/Source/Structs/BSP/Texture.cs | 2 +- LibBSP/Source/Structs/BSP/TextureData.cs | 2 +- LibBSP/Source/Structs/BSP/TextureInfo.cs | 2 +- LibBSP/Source/Structs/Common/Entity.cs | 2 +- 9 files changed, 23 insertions(+), 11 deletions(-) diff --git a/LibBSP/Source/Structs/BSP/Cubemap.cs b/LibBSP/Source/Structs/BSP/Cubemap.cs index 2da62d1..c234f48 100644 --- a/LibBSP/Source/Structs/BSP/Cubemap.cs +++ b/LibBSP/Source/Structs/BSP/Cubemap.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/BSP/DisplacementInfo.cs b/LibBSP/Source/Structs/BSP/DisplacementInfo.cs index 0e45584..2de5719 100644 --- a/LibBSP/Source/Structs/BSP/DisplacementInfo.cs +++ b/LibBSP/Source/Structs/BSP/DisplacementInfo.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif @@ -19,8 +19,14 @@ namespace LibBSP { public Vector3 startPosition { get; private set; } public int dispVertStart { get; private set; } - //public int dispTriStart { get; private set; } + public int dispTriStart { get; private set; } public int power { get; private set; } + public int minTess { get; private set; } + public float smoothingAngle { get; private set; } + public int contents { get; private set; } + public ushort mapFace { get; private set; } + public int lightmapAlphaStart { get; private set; } + public int lightmapSamplePositionStart { get; private set; } public uint[] allowedVerts { get; private set; } /// @@ -37,8 +43,14 @@ namespace LibBSP { } startPosition = new Vector3(BitConverter.ToSingle(data, 0), BitConverter.ToSingle(data, 4), BitConverter.ToSingle(data, 8)); dispVertStart = BitConverter.ToInt32(data, 12); - //dispTriStart = BitConverter.ToInt32(in, 16); + dispTriStart = BitConverter.ToInt32(data, 16); power = BitConverter.ToInt32(data, 20); + minTess = BitConverter.ToInt32(data, 24); + smoothingAngle = BitConverter.ToSingle(data, 28); + contents = BitConverter.ToInt32(data, 32); + mapFace = BitConverter.ToUInt16(data, 36); + lightmapAlphaStart = BitConverter.ToInt32(data, 38); + lightmapSamplePositionStart = BitConverter.ToInt32(data, 42); allowedVerts = new uint[10]; int offset = 0; switch (type) { diff --git a/LibBSP/Source/Structs/BSP/DisplacementVertex.cs b/LibBSP/Source/Structs/BSP/DisplacementVertex.cs index cceab21..110c02d 100644 --- a/LibBSP/Source/Structs/BSP/DisplacementVertex.cs +++ b/LibBSP/Source/Structs/BSP/DisplacementVertex.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/BSP/Face.cs b/LibBSP/Source/Structs/BSP/Face.cs index 1cef777..a277599 100644 --- a/LibBSP/Source/Structs/BSP/Face.cs +++ b/LibBSP/Source/Structs/BSP/Face.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/BSP/StaticProp.cs b/LibBSP/Source/Structs/BSP/StaticProp.cs index 5c13ef8..0a0e67c 100644 --- a/LibBSP/Source/Structs/BSP/StaticProp.cs +++ b/LibBSP/Source/Structs/BSP/StaticProp.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/BSP/Texture.cs b/LibBSP/Source/Structs/BSP/Texture.cs index ebd1461..59a5c26 100644 --- a/LibBSP/Source/Structs/BSP/Texture.cs +++ b/LibBSP/Source/Structs/BSP/Texture.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/BSP/TextureData.cs b/LibBSP/Source/Structs/BSP/TextureData.cs index 4a2af61..af132c2 100644 --- a/LibBSP/Source/Structs/BSP/TextureData.cs +++ b/LibBSP/Source/Structs/BSP/TextureData.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/BSP/TextureInfo.cs b/LibBSP/Source/Structs/BSP/TextureInfo.cs index b35fd69..e9dad32 100644 --- a/LibBSP/Source/Structs/BSP/TextureInfo.cs +++ b/LibBSP/Source/Structs/BSP/TextureInfo.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif diff --git a/LibBSP/Source/Structs/Common/Entity.cs b/LibBSP/Source/Structs/Common/Entity.cs index 5b3857b..8f03906 100644 --- a/LibBSP/Source/Structs/Common/Entity.cs +++ b/LibBSP/Source/Structs/Common/Entity.cs @@ -1,4 +1,4 @@ -#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5_3_OR_NEWER +#if UNITY_2_6 || UNITY_2_6_1 || UNITY_3_0 || UNITY_3_0_0 || UNITY_3_1 || UNITY_3_2 || UNITY_3_3 || UNITY_3_4 || UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1 || UNITY_4_2 || UNITY_4_3 || UNITY_4_5 || UNITY_4_6 || UNITY_5 || UNITY_5_3_OR_NEWER #define UNITY #endif