From 411c341278915ff27ff030c2d999591f7d2c8f7b Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Sat, 20 Aug 2022 14:24:53 +0300 Subject: [PATCH] dotnet6 compat and 1.4 fixes --- Plugins/FidelityFX-FSR | 2 +- Source/Game/Console/ConsolePlugin.cs | 6 +++++- Source/Game/Console/EngineSubsystem.cs | 6 +++--- Source/Game/Level/Q3MapImporter.cs | 18 +++++++++++------- Source/Game/Network/NetworkManagerPlugin.cs | 6 +++++- 5 files changed, 25 insertions(+), 13 deletions(-) diff --git a/Plugins/FidelityFX-FSR b/Plugins/FidelityFX-FSR index ee085aa..c230092 160000 --- a/Plugins/FidelityFX-FSR +++ b/Plugins/FidelityFX-FSR @@ -1 +1 @@ -Subproject commit ee085aae6b851e8a2ec63a93e7520bdc5c132d80 +Subproject commit c230092c5df12804c6352868f7b7de1cb52df6de diff --git a/Source/Game/Console/ConsolePlugin.cs b/Source/Game/Console/ConsolePlugin.cs index 8c30c2a..aed4451 100644 --- a/Source/Game/Console/ConsolePlugin.cs +++ b/Source/Game/Console/ConsolePlugin.cs @@ -47,9 +47,13 @@ namespace Game #if FLAX_EDITOR public class ConsoleEditorPlugin : GEditorPlugin { - public override PluginDescription Description => ConsolePlugin.DescriptionInternal; public override Type GamePluginType => typeof(ConsolePlugin); + public ConsoleEditorPlugin() + { + _description = ConsolePlugin.DescriptionInternal; + } + public override void Init() { //FlaxEngine.Debug.Log("ConsolePlugin initialized"); diff --git a/Source/Game/Console/EngineSubsystem.cs b/Source/Game/Console/EngineSubsystem.cs index e0c8be2..3367a8f 100644 --- a/Source/Game/Console/EngineSubsystem.cs +++ b/Source/Game/Console/EngineSubsystem.cs @@ -278,7 +278,7 @@ namespace Game Graphics.PostProcessSettings = postProcessSettings; - Graphics.EnableGlobalSDF = boolValue; + //Graphics.EnableGlobalSDF = boolValue; } } @@ -306,7 +306,7 @@ namespace Game } } - [ConsoleVariable("r_gi_spacing")] + /*[ConsoleVariable("r_gi_spacing")] public static string GlobalIlluminationProbeSpacing { get @@ -322,7 +322,7 @@ namespace Game Graphics.GIProbesSpacing = valueFloat; } } - } + }*/ [ConsoleVariable("r_gi_time")] public static string GlobalIlluminationTime diff --git a/Source/Game/Level/Q3MapImporter.cs b/Source/Game/Level/Q3MapImporter.cs index 20ba284..5aae394 100644 --- a/Source/Game/Level/Q3MapImporter.cs +++ b/Source/Game/Level/Q3MapImporter.cs @@ -2,6 +2,7 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; +using System.Globalization; using System.IO; using System.Linq; using System.Runtime.InteropServices; @@ -414,7 +415,7 @@ namespace Game if (worldSpawnActor == null) { - worldSpawnActor = Actor.AddChild(); + worldSpawnActor = Actor.AddChild(); worldSpawnActor.Name = "WorldSpawn"; worldSpawnActor.HideFlags &= ~HideFlags.DontSave; //worldSpawnActor.HideFlags |= HideFlags.DontSave; @@ -663,6 +664,9 @@ namespace Game for (uint i = 0; i < indices.Length; i++) indices[i] = i; + if (brushIndex == 84) + brushIndex = brushIndex; + bool isClipMaterial = false; bool isMissingMaterial = false; if (geom.meshes.Length == 1) @@ -724,7 +728,7 @@ namespace Game brushIndex = 0; foreach (BrushGeometry geom in brushGeometries) { - Actor childModel = worldSpawnActor.AddChild(); + Actor childModel = worldSpawnActor.AddChild(); childModel.Name = "Brush_" + brushIndex; //childModel.Model = geom.model; childModel.Position = geom.offset; @@ -1296,7 +1300,7 @@ namespace Game private void ParsePlayerSpawn(MapEntity entity, ref int playerSpawnIndex) { - Actor spawn = worldSpawnActor.AddChild(); + Actor spawn = worldSpawnActor.AddChild(); spawn.Name = "PlayerSpawn_" + playerSpawnIndex; spawn.LocalPosition = ParseOrigin(entity.properties["origin"]); @@ -1311,26 +1315,26 @@ namespace Game private static Float3 ParseOrigin(string origin) { string[] points = origin.Split(' '); - return new Float3(float.Parse(points[0]), float.Parse(points[2]), float.Parse(points[1])); + return new Float3(float.Parse(points[0], CultureInfo.InvariantCulture), float.Parse(points[2], CultureInfo.InvariantCulture), float.Parse(points[1], CultureInfo.InvariantCulture)); } private static Color ParseColor(string origin) { string[] points = origin.Split(' '); - return new Color(float.Parse(points[0]), float.Parse(points[1]), float.Parse(points[2])); + return new Color(float.Parse(points[0], CultureInfo.InvariantCulture), float.Parse(points[1], CultureInfo.InvariantCulture), float.Parse(points[2], CultureInfo.InvariantCulture)); } private static Quaternion ParseAngle(string origin) { string[] angles = origin.Split(' '); //Console.Print("parseangle: " + new Float3(0f, float.Parse(angles[0]) + 45f, 0f).ToString()); - return Quaternion.Euler(new Float3(0f, float.Parse(angles[0]) + 90f, 0f)); + return Quaternion.Euler(new Float3(0f, float.Parse(angles[0], CultureInfo.InvariantCulture) + 90f, 0f)); } private static Float3 ParseAngleEuler(string origin) { string[] angles = origin.Split(' '); - return new Float3(0f, float.Parse(angles[0]) + 45f, 0f); + return new Float3(0f, float.Parse(angles[0], CultureInfo.InvariantCulture) + 45f, 0f); } public override void OnDestroy() diff --git a/Source/Game/Network/NetworkManagerPlugin.cs b/Source/Game/Network/NetworkManagerPlugin.cs index f083f03..5c66c20 100644 --- a/Source/Game/Network/NetworkManagerPlugin.cs +++ b/Source/Game/Network/NetworkManagerPlugin.cs @@ -34,9 +34,13 @@ namespace Game { public override Type[] PluginDependencies { get => new Type[] { typeof(ConsoleEditorPlugin) }; } - public override PluginDescription Description => NetworkManagerPlugin.DescriptionInternal; public override Type GamePluginType => typeof(NetworkManagerPlugin); + public NetworkManagerEditorPlugin() + { + _description = NetworkManagerPlugin.DescriptionInternal; + } + public override void Init() { //FlaxEngine.Debug.Log("NetworkManagerPlugin initialized");