This commit is contained in:
2022-11-10 17:09:37 +02:00
parent 411c341278
commit 36c09efac0
12 changed files with 24 additions and 23 deletions

View File

@@ -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;

View File

@@ -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)

View File

@@ -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())

View File

@@ -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

View File

@@ -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");
});
}
}

View File

@@ -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;

View File

@@ -52,7 +52,7 @@ namespace Game
public override void Deinit()
{
FlaxEditor.Editor.Instance.PlayModeBegin -= OnPlayModeBegin;
//FlaxEditor.Editor.Instance.PlayModeBegin -= OnPlayModeBegin;
}
private void OnPlayModeBegin()

View File

@@ -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)

View File

@@ -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)

View File

@@ -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<RayCastHit>();
hits = new RayCastHit[0];//Array.Empty<RayCastHit>();
return false;
}

View File

@@ -14,7 +14,7 @@ namespace Game
/// </summary>
public abstract class GGamePlugin : GamePlugin
{
public virtual Type[] PluginDependencies { get => Array.Empty<Type>(); }
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
/// </summary>
public abstract class GEditorPlugin : EditorPlugin
{
public virtual Type[] PluginDependencies { get => Array.Empty<Type>(); }
public virtual Type[] PluginDependencies { get => new Type[0]; }
public bool Initialized { get; private set; }
public bool Deinitialized { get; private set; }