From d3bc695e50c7aa60ae71c110b99705e8705fc3b9 Mon Sep 17 00:00:00 2001 From: TheNexusAvenger <13441476+TheNexusAvenger@users.noreply.github.com> Date: Thu, 22 Jul 2021 20:06:14 -0400 Subject: [PATCH 1/6] Use 1 and 0 for booleans in ToString. --- InfectedRose.Core/LegoDataDictionary.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/InfectedRose.Core/LegoDataDictionary.cs b/InfectedRose.Core/LegoDataDictionary.cs index 330aa17..939a821 100644 --- a/InfectedRose.Core/LegoDataDictionary.cs +++ b/InfectedRose.Core/LegoDataDictionary.cs @@ -191,6 +191,7 @@ public string ToString(string separator) { var val = v switch { + bool boolean => boolean ? "1" : "0", Vector2 vec2 => $"{vec2.X}{InfoSeparator}{vec2.Y}", Vector3 vec3 => $"{vec3.X}{InfoSeparator}{vec3.Z}{InfoSeparator}{vec3.Y}", Vector4 vec4 => $"{vec4.X}{InfoSeparator}{vec4.Z}{InfoSeparator}{vec4.Y}{InfoSeparator}{vec4.W}", From 3690f7acb60d82e06f225263b8dbed4882844aa3 Mon Sep 17 00:00:00 2001 From: TheNexusAvenger <13441476+TheNexusAvenger@users.noreply.github.com> Date: Fri, 23 Jul 2021 10:51:01 -0400 Subject: [PATCH 2/6] Correct SpawnRotation in LuzFile. --- InfectedRose.Luz/LuzFile.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/InfectedRose.Luz/LuzFile.cs b/InfectedRose.Luz/LuzFile.cs index b91823d..6bbac94 100644 --- a/InfectedRose.Luz/LuzFile.cs +++ b/InfectedRose.Luz/LuzFile.cs @@ -142,7 +142,8 @@ public void Deserialize(BitReader reader) if (Version >= 0x26) { SpawnPoint = reader.Read(); - SpawnRotation = reader.Read(); + var spawnRotation = reader.Read(); + SpawnRotation = new Quaternion(spawnRotation.Y, spawnRotation.Z, spawnRotation.W, spawnRotation.X); } var sceneCount = Version < 0x25 ? reader.Read() : reader.Read(); From dacb3aa13595f113130ac9cd402fbabee69cab08 Mon Sep 17 00:00:00 2001 From: Yui Date: Wed, 29 Dec 2021 09:21:06 +0100 Subject: [PATCH 3/6] free pointer in HashMap ToBytes --- InfectedRose.Core/HashMap.cs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/InfectedRose.Core/HashMap.cs b/InfectedRose.Core/HashMap.cs index 75bfba4..07f82a5 100644 --- a/InfectedRose.Core/HashMap.cs +++ b/InfectedRose.Core/HashMap.cs @@ -13,7 +13,7 @@ public void Add(object obj) { Structure.Add(obj); } - + public virtual byte[] Compile(Action onData = default) { var compiled = new List(); @@ -23,7 +23,7 @@ public virtual byte[] Compile(Action onData = default) foreach (var obj in Structure) { onData?.Invoke(++index); - + switch (obj) { case null: @@ -58,7 +58,7 @@ public virtual byte[] Compile(Action onData = default) return compiled.ToArray(); } - + private static byte[] ToBytes(object obj) { if (!obj.GetType().IsValueType) @@ -67,13 +67,14 @@ private static byte[] ToBytes(object obj) return new byte[0]; } - + var size = Marshal.SizeOf(obj); var buf = new byte[size]; var ptr = Marshal.AllocHGlobal(size); Marshal.StructureToPtr(obj, ptr, false); Marshal.Copy(ptr, buf, 0, size); + Marshal.FreeHGlobal(ptr) return buf; } @@ -81,8 +82,8 @@ private static byte[] ToBytes(object obj) public static HashMap operator +(HashMap map, object obj) { map.Add(obj); - + return map; } } -} \ No newline at end of file +} From 71e3e30f3882a555f64d4a882f2ef732866c606f Mon Sep 17 00:00:00 2001 From: TheNexusAvenger <13441476+TheNexusAvenger@users.noreply.github.com> Date: Wed, 29 Dec 2021 13:32:59 -0500 Subject: [PATCH 4/6] Add missing semicolon. --- InfectedRose.Core/HashMap.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InfectedRose.Core/HashMap.cs b/InfectedRose.Core/HashMap.cs index 07f82a5..4524349 100644 --- a/InfectedRose.Core/HashMap.cs +++ b/InfectedRose.Core/HashMap.cs @@ -74,7 +74,7 @@ private static byte[] ToBytes(object obj) Marshal.StructureToPtr(obj, ptr, false); Marshal.Copy(ptr, buf, 0, size); - Marshal.FreeHGlobal(ptr) + Marshal.FreeHGlobal(ptr); return buf; } From c83032ccd651b6fbf8e33f25e3270e5a34995ec3 Mon Sep 17 00:00:00 2001 From: TheNexusAvenger <13441476+TheNexusAvenger@users.noreply.github.com> Date: Wed, 29 Dec 2021 13:33:12 -0500 Subject: [PATCH 5/6] Add missing reference. --- InfectedRose.World/WorldObject.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/InfectedRose.World/WorldObject.cs b/InfectedRose.World/WorldObject.cs index 7e9b251..b940afd 100644 --- a/InfectedRose.World/WorldObject.cs +++ b/InfectedRose.World/WorldObject.cs @@ -1,6 +1,7 @@ using System; using System.Numerics; using System.Xml.Serialization; +using InfectedRose.Core; using InfectedRose.Lvl; namespace InfectedRose.World From cd5584f4ddde86ac948411f5c106c88023ef4594 Mon Sep 17 00:00:00 2001 From: TheNexusAvenger <13441476+TheNexusAvenger@users.noreply.github.com> Date: Wed, 29 Dec 2021 14:43:03 -0500 Subject: [PATCH 6/6] Update RakDotNet.IO to fix memory leak. Use .NET Standard 2.1. --- .../InfectedRose.Builder.Behaviors.csproj | 2 +- InfectedRose.Builder/InfectedRose.Builder.csproj | 2 +- InfectedRose.Core/InfectedRose.Core.csproj | 5 ++--- InfectedRose.Database/InfectedRose.Database.csproj | 4 ++-- InfectedRose.Geometry/InfectedRose.Geometry.csproj | 3 +-- InfectedRose.Interface/InfectedRose.Interface.csproj | 2 +- InfectedRose.Luz/InfectedRose.Luz.csproj | 3 +-- InfectedRose.Lvl/InfectedRose.Lvl.csproj | 3 +-- InfectedRose.Nif/InfectedRose.Nif.csproj | 3 +-- InfectedRose.Pipeline/InfectedRose.Pipeline.csproj | 2 +- InfectedRose.Terrain/InfectedRose.Terrain.csproj | 3 +-- InfectedRose.Triggers/InfectedRose.Triggers.csproj | 3 +-- InfectedRose.Utilities/InfectedRose.Utilities.csproj | 2 +- InfectedRose.World/InfectedRose.World.csproj | 2 +- 14 files changed, 16 insertions(+), 23 deletions(-) diff --git a/InfectedRose.Builder.Behaviors/InfectedRose.Builder.Behaviors.csproj b/InfectedRose.Builder.Behaviors/InfectedRose.Builder.Behaviors.csproj index 753f4a2..f6e07b2 100644 --- a/InfectedRose.Builder.Behaviors/InfectedRose.Builder.Behaviors.csproj +++ b/InfectedRose.Builder.Behaviors/InfectedRose.Builder.Behaviors.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netstandard2.1 diff --git a/InfectedRose.Builder/InfectedRose.Builder.csproj b/InfectedRose.Builder/InfectedRose.Builder.csproj index 753f4a2..f6e07b2 100644 --- a/InfectedRose.Builder/InfectedRose.Builder.csproj +++ b/InfectedRose.Builder/InfectedRose.Builder.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netstandard2.1 diff --git a/InfectedRose.Core/InfectedRose.Core.csproj b/InfectedRose.Core/InfectedRose.Core.csproj index a5b0f58..271f559 100644 --- a/InfectedRose.Core/InfectedRose.Core.csproj +++ b/InfectedRose.Core/InfectedRose.Core.csproj @@ -1,12 +1,11 @@  - netcoreapp3.1 - 8 + netstandard2.1 - + diff --git a/InfectedRose.Database/InfectedRose.Database.csproj b/InfectedRose.Database/InfectedRose.Database.csproj index 0a13d78..c3cf151 100644 --- a/InfectedRose.Database/InfectedRose.Database.csproj +++ b/InfectedRose.Database/InfectedRose.Database.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 @@ -15,6 +14,7 @@ + diff --git a/InfectedRose.Geometry/InfectedRose.Geometry.csproj b/InfectedRose.Geometry/InfectedRose.Geometry.csproj index 9680a34..856807e 100644 --- a/InfectedRose.Geometry/InfectedRose.Geometry.csproj +++ b/InfectedRose.Geometry/InfectedRose.Geometry.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 diff --git a/InfectedRose.Interface/InfectedRose.Interface.csproj b/InfectedRose.Interface/InfectedRose.Interface.csproj index 3190e66..1c21885 100644 --- a/InfectedRose.Interface/InfectedRose.Interface.csproj +++ b/InfectedRose.Interface/InfectedRose.Interface.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + netstandard2.1 diff --git a/InfectedRose.Luz/InfectedRose.Luz.csproj b/InfectedRose.Luz/InfectedRose.Luz.csproj index 9680a34..856807e 100644 --- a/InfectedRose.Luz/InfectedRose.Luz.csproj +++ b/InfectedRose.Luz/InfectedRose.Luz.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 diff --git a/InfectedRose.Lvl/InfectedRose.Lvl.csproj b/InfectedRose.Lvl/InfectedRose.Lvl.csproj index 9680a34..856807e 100644 --- a/InfectedRose.Lvl/InfectedRose.Lvl.csproj +++ b/InfectedRose.Lvl/InfectedRose.Lvl.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 diff --git a/InfectedRose.Nif/InfectedRose.Nif.csproj b/InfectedRose.Nif/InfectedRose.Nif.csproj index 9680a34..856807e 100644 --- a/InfectedRose.Nif/InfectedRose.Nif.csproj +++ b/InfectedRose.Nif/InfectedRose.Nif.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 diff --git a/InfectedRose.Pipeline/InfectedRose.Pipeline.csproj b/InfectedRose.Pipeline/InfectedRose.Pipeline.csproj index c0fbd7c..d489a7e 100644 --- a/InfectedRose.Pipeline/InfectedRose.Pipeline.csproj +++ b/InfectedRose.Pipeline/InfectedRose.Pipeline.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netstandard2.1 diff --git a/InfectedRose.Terrain/InfectedRose.Terrain.csproj b/InfectedRose.Terrain/InfectedRose.Terrain.csproj index 1981ce3..1307527 100644 --- a/InfectedRose.Terrain/InfectedRose.Terrain.csproj +++ b/InfectedRose.Terrain/InfectedRose.Terrain.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 diff --git a/InfectedRose.Triggers/InfectedRose.Triggers.csproj b/InfectedRose.Triggers/InfectedRose.Triggers.csproj index 9680a34..856807e 100644 --- a/InfectedRose.Triggers/InfectedRose.Triggers.csproj +++ b/InfectedRose.Triggers/InfectedRose.Triggers.csproj @@ -1,8 +1,7 @@  - netcoreapp3.1 - 8 + netstandard2.1 diff --git a/InfectedRose.Utilities/InfectedRose.Utilities.csproj b/InfectedRose.Utilities/InfectedRose.Utilities.csproj index 808ca48..bec7fd6 100644 --- a/InfectedRose.Utilities/InfectedRose.Utilities.csproj +++ b/InfectedRose.Utilities/InfectedRose.Utilities.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1 + netstandard2.1 diff --git a/InfectedRose.World/InfectedRose.World.csproj b/InfectedRose.World/InfectedRose.World.csproj index ed762b5..088f53f 100644 --- a/InfectedRose.World/InfectedRose.World.csproj +++ b/InfectedRose.World/InfectedRose.World.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netstandard2.1