From 36c09efac01fed5d213155519ace1bfde9cd58fd Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Thu, 10 Nov 2022 17:09:37 +0200 Subject: [PATCH] fixies --- GoakeFlax.flaxproj | 3 --- Source/Game/Camera/CameraRender.cs | 6 +++--- Source/Game/Console/ConfigParser.cs | 4 ++-- Source/Game/Console/ConsolePlugin.cs | 1 + Source/Game/Console/EngineSubsystem.cs | 7 ++++--- Source/Game/Level/Q3MapImporter.cs | 6 +++--- Source/Game/Network/NetworkManager.cs | 4 ++-- Source/Game/Network/NetworkManagerPlugin.cs | 2 +- Source/Game/Network/NetworkManager_Client.cs | 3 ++- Source/Game/Network/NetworkManager_Server.cs | 3 ++- Source/Game/Player/PlayerMovement.cs | 4 ++-- Source/Game/Utility/GGamePlugin.cs | 4 ++-- 12 files changed, 24 insertions(+), 23 deletions(-) diff --git a/GoakeFlax.flaxproj b/GoakeFlax.flaxproj index 71c591c..10a4e7c 100644 --- a/GoakeFlax.flaxproj +++ b/GoakeFlax.flaxproj @@ -8,9 +8,6 @@ "References": [ { "Name": "$(EnginePath)/Flax.flaxproj" - }, - { - "Name": "$(ProjectPath)/Plugins/FidelityFX-FSR/FidelityFX-FSR.flaxproj" } ], "DefaultScene": "194e05f445ece24ec5448d886e1334df", diff --git a/Source/Game/Camera/CameraRender.cs b/Source/Game/Camera/CameraRender.cs index b69e677..9821984 100644 --- a/Source/Game/Camera/CameraRender.cs +++ b/Source/Game/Camera/CameraRender.cs @@ -21,9 +21,9 @@ namespace Game private GPUTexture texture; private GPUTexture texture2; - public override PostProcessEffectLocation Location => PostProcessEffectLocation.Default; - public override int Order => 110; - public override bool CanRender => camera.IsActive; + //public override PostProcessEffectLocation Location => PostProcessEffectLocation.Default; + //public override int Order => 110; + //public override bool CanRender => camera.IsActive; private bool useMainCamera = true; public bool rescaleModel = true; diff --git a/Source/Game/Console/ConfigParser.cs b/Source/Game/Console/ConfigParser.cs index adabebb..88ec4ba 100644 --- a/Source/Game/Console/ConfigParser.cs +++ b/Source/Game/Console/ConfigParser.cs @@ -14,8 +14,8 @@ namespace Game Config config = new Config(); if (!File.Exists(path)) return config; - using FileStream file = File.OpenRead(path); - using StreamReader sr = new StreamReader(file); + /*using*/ FileStream file = File.OpenRead(path); + /*using*/ StreamReader sr = new StreamReader(file); string line; while ((line = sr.ReadLine()?.Trim()) != null) diff --git a/Source/Game/Console/ConsolePlugin.cs b/Source/Game/Console/ConsolePlugin.cs index aed4451..21b3511 100644 --- a/Source/Game/Console/ConsolePlugin.cs +++ b/Source/Game/Console/ConsolePlugin.cs @@ -78,6 +78,7 @@ namespace Game private void LoadConfig(Scene scene, Guid guid) { Console.Print("Loading config file"); + AssetManager.Globals.ResetValues(); foreach (var line in AssetManager.Config.GetLines()) diff --git a/Source/Game/Console/EngineSubsystem.cs b/Source/Game/Console/EngineSubsystem.cs index 3367a8f..493fbfe 100644 --- a/Source/Game/Console/EngineSubsystem.cs +++ b/Source/Game/Console/EngineSubsystem.cs @@ -1,7 +1,7 @@ using System; using System.IO; using System.Linq; -using FidelityFX; +//using FidelityFX; using FlaxEditor.Content.Settings; using FlaxEngine; @@ -10,7 +10,7 @@ namespace Game // Holds Console variables and commands to control engine behaviour public static class EngineSubsystem { - private static FSR _fsrPlugin; + //private static FSR _fsrPlugin; // TODO: this should manually set all postprocessing values to 0 or disabled /*[ConsoleVariable("r_postprocessing")] @@ -98,7 +98,7 @@ namespace Game } } - public static FSR FsrPlugin + /*public static FSR FsrPlugin { get { @@ -143,6 +143,7 @@ namespace Game } } } + */ [ConsoleVariable("cl_showweapon")] public static string ShowWeapon diff --git a/Source/Game/Level/Q3MapImporter.cs b/Source/Game/Level/Q3MapImporter.cs index 5aae394..7edcdeb 100644 --- a/Source/Game/Level/Q3MapImporter.cs +++ b/Source/Game/Level/Q3MapImporter.cs @@ -1070,7 +1070,7 @@ namespace Game int modelIndex = 0; // TODO: read sdf data from texture and dump it to file, and reuse it when generating sdf data - using var sha1 = new SHA1Managed(); + /*using*/ var sha1 = new SHA1Managed(); string mapHash = sha1.ComputeHash(Encoding.UTF8.GetBytes(levelScript.MapName + levelScript.MapTimestamp.Ticks.ToString())).ToString(); foreach (var model in sdfModels.ToList()) @@ -1108,7 +1108,7 @@ namespace Game var task = Task.Run(() => { - Stopwatch sw = Stopwatch.StartNew(); + Stopwatch sw2 = Stopwatch.StartNew(); FlaxEngine.Debug.Log($"Generating level SDF ({sdfModels.Count} models)..."); ParallelOptions opts = new ParallelOptions(); @@ -1143,7 +1143,7 @@ namespace Game }); - FlaxEngine.Debug.Log($"Generated level SDF in {sw.Elapsed.TotalMilliseconds}ms"); + FlaxEngine.Debug.Log($"Generated level SDF in {sw2.Elapsed.TotalMilliseconds}ms"); }); } } diff --git a/Source/Game/Network/NetworkManager.cs b/Source/Game/Network/NetworkManager.cs index 3b7de0a..15d90ce 100644 --- a/Source/Game/Network/NetworkManager.cs +++ b/Source/Game/Network/NetworkManager.cs @@ -52,7 +52,7 @@ namespace Game if (initialized) return; - if (Engine.CommandLine.Contains("-server")) + /*if (Engine.CommandLine.Contains("-server")) { StartServer(); ServerAddress = "localhost"; @@ -69,7 +69,7 @@ namespace Game StartServer(); ServerAddress = "localhost"; ConnectServer(); - } + }*/ //#endif initialized = true; diff --git a/Source/Game/Network/NetworkManagerPlugin.cs b/Source/Game/Network/NetworkManagerPlugin.cs index 5c66c20..8d9ab57 100644 --- a/Source/Game/Network/NetworkManagerPlugin.cs +++ b/Source/Game/Network/NetworkManagerPlugin.cs @@ -52,7 +52,7 @@ namespace Game public override void Deinit() { - FlaxEditor.Editor.Instance.PlayModeBegin -= OnPlayModeBegin; + //FlaxEditor.Editor.Instance.PlayModeBegin -= OnPlayModeBegin; } private void OnPlayModeBegin() diff --git a/Source/Game/Network/NetworkManager_Client.cs b/Source/Game/Network/NetworkManager_Client.cs index 3c5dc22..ac87acf 100644 --- a/Source/Game/Network/NetworkManager_Client.cs +++ b/Source/Game/Network/NetworkManager_Client.cs @@ -36,7 +36,7 @@ namespace Game private static void OnClientUpdate() { - using Utilities.ScopeProfiler _ = Utilities.ProfileScope("NetworkManager_OnClientUpdate"); + /*using*/ Utilities.ScopeProfiler _ = Utilities.ProfileScope("NetworkManager_OnClientUpdate"); while (client.PopEvent(out NetworkEvent networkEvent)) switch (networkEvent.EventType) @@ -98,6 +98,7 @@ namespace Game default: throw new ArgumentOutOfRangeException(); } + _.Dispose(); } private static void OnClientActorSpawned(Actor actor) diff --git a/Source/Game/Network/NetworkManager_Server.cs b/Source/Game/Network/NetworkManager_Server.cs index a9d97a1..df5e505 100644 --- a/Source/Game/Network/NetworkManager_Server.cs +++ b/Source/Game/Network/NetworkManager_Server.cs @@ -94,7 +94,7 @@ namespace Game private static void OnServerUpdate() { - using Utilities.ScopeProfiler _ = Utilities.ProfileScope("NetworkManager_OnServerUpdate"); + /*using*/ Utilities.ScopeProfiler _ = Utilities.ProfileScope("NetworkManager_OnServerUpdate"); while (server.PopEvent(out NetworkEvent networkEvent)) switch (networkEvent.EventType) @@ -170,6 +170,7 @@ namespace Game default: throw new ArgumentOutOfRangeException(); } + _.Dispose(); } private static void OnServerActorSpawned(Actor actor) diff --git a/Source/Game/Player/PlayerMovement.cs b/Source/Game/Player/PlayerMovement.cs index f59b5ae..79c82bd 100644 --- a/Source/Game/Player/PlayerMovement.cs +++ b/Source/Game/Player/PlayerMovement.cs @@ -166,7 +166,7 @@ namespace Game else if (playerId == NetworkManager.LocalPlayerClientId) { Console.Print("local player: " + playerId.ToString()); - string demoPath = System.IO.Path.Combine(AssetManager.DemoPath, $"{DateTimeOffset.Now.ToUnixTimeSeconds()}.gdem"); + string demoPath = System.IO.Path.Combine(AssetManager.DemoPath, $"{DateTimeOffset.Now.UtcTicks}.gdem"); input = new PlayerInputLocal(demoPath); // TODO: support recording PlayerId = playerId; } @@ -400,7 +400,7 @@ namespace Game if (distance < 0.00000001f) { - hits = Array.Empty(); + hits = new RayCastHit[0];//Array.Empty(); return false; } diff --git a/Source/Game/Utility/GGamePlugin.cs b/Source/Game/Utility/GGamePlugin.cs index f79ef38..b8503a8 100644 --- a/Source/Game/Utility/GGamePlugin.cs +++ b/Source/Game/Utility/GGamePlugin.cs @@ -14,7 +14,7 @@ namespace Game /// public abstract class GGamePlugin : GamePlugin { - public virtual Type[] PluginDependencies { get => Array.Empty(); } + public virtual Type[] PluginDependencies { get => new Type[0]; } public bool Initialized { get; private set; } public bool Deinitialized { get; private set; } @@ -91,7 +91,7 @@ namespace Game /// public abstract class GEditorPlugin : EditorPlugin { - public virtual Type[] PluginDependencies { get => Array.Empty(); } + public virtual Type[] PluginDependencies { get => new Type[0]; } public bool Initialized { get; private set; } public bool Deinitialized { get; private set; }