Add default Post Process options to Graphics Settings

This commit is contained in:
Wojciech Figat
2022-06-14 12:01:16 +02:00
parent c6e909c867
commit 2522d84a21
10 changed files with 96 additions and 24 deletions

View File

@@ -8,4 +8,41 @@ namespace FlaxEditor.Content.Settings
public abstract class SettingsBase
{
}
partial class GraphicsSettings
{
/// <summary>
/// Initializes a new instance of the <see cref="GraphicsSettings"/>.
/// </summary>
public GraphicsSettings()
{
// Initialize PostFx settings with default options (C# structs doesn't support it)
PostProcessSettings = FlaxEngine.PostProcessSettings.Default;
}
}
}
namespace FlaxEngine
{
partial struct PostProcessSettings
{
private static PostProcessSettings _default;
/// <summary>
/// The default <see cref="PostProcessSettings"/>.
/// </summary>
public static PostProcessSettings Default
{
get
{
if (!_default.AmbientOcclusion.Enabled)
{
object obj = _default;
Utils.InitStructure(obj, typeof(PostProcessSettings));
_default = (PostProcessSettings)obj;
}
return _default;
}
}
}
}