Merge branch 'cristhofermarques-small_editor_fix'

This commit is contained in:
2022-10-12 20:40:39 +02:00
6 changed files with 47 additions and 16 deletions
@@ -24,7 +24,7 @@ namespace FlaxEditor.CustomEditors.Dedicated
public override void Initialize(LayoutElementsContainer layout)
{
string[] layerNames = LayersAndTagsSettings.GetCurrentLayers();
int layersCount = Math.Max(4, layerNames.Length);
int layersCount = layerNames.Length;
_checkBoxes = new List<CheckBox>();
_layersCount = layersCount;
+16 -1
View File
@@ -73,7 +73,7 @@ public:
/// If checked, Environment Probes will use HDR texture format. Improves quality in very bright scenes at cost of higher memory usage.
/// </summary>
API_FIELD(Attributes = "EditorOrder(1502), EditorDisplay(\"Quality\")")
bool UeeHDRProbes = false;
bool UseHDRProbes = false;
/// <summary>
/// If checked, enables Global SDF rendering. This can be used in materials, shaders, and particles.
@@ -119,6 +119,21 @@ public:
API_FIELD(Attributes="EditorOrder(10000), EditorDisplay(\"Post Process Settings\", EditorDisplayAttribute.InlineStyle)")
PostProcessSettings PostProcessSettings;
private:
/// <summary>
/// Renamed UeeHDRProbes into UseHDRProbes
/// [Deprecated on 12.10.2022, expires on 12.10.2024]
/// </summary>
API_PROPERTY(Attributes="Serialize, Obsolete, NoUndo") bool GetUeeHDRProbes() const
{
return UseHDRProbes;
}
API_PROPERTY(Attributes="Serialize, Obsolete, NoUndo") void SetUeeHDRProbes(bool value)
{
UseHDRProbes = value;
}
public:
/// <summary>
/// Gets the instance of the settings asset (default value if missing). Object returned by this method is always loaded with valid data to use.
+15 -1
View File
@@ -1,5 +1,8 @@
// Copyright (c) 2012-2022 Wojciech Figat. All rights reserved.
using System;
using FlaxEngine;
namespace FlaxEditor.Content.Settings
{
/// <summary>
@@ -11,13 +14,24 @@ namespace FlaxEditor.Content.Settings
partial class GraphicsSettings
{
/// <summary>
/// Renamed UeeHDRProbes into UseHDRProbes
/// [Deprecated on 12.10.2022, expires on 12.10.2024]
/// </summary>
[Serialize, Obsolete, NoUndo]
private bool UeeHDRProbes
{
get => UseHDRProbes;
set => UseHDRProbes = value;
}
/// <summary>
/// Initializes a new instance of the <see cref="GraphicsSettings"/>.
/// </summary>
public GraphicsSettings()
{
// Initialize PostFx settings with default options (C# structs don't support it)
PostProcessSettings = FlaxEngine.PostProcessSettings.Default;
PostProcessSettings = PostProcessSettings.Default;
}
}
}
+1 -1
View File
@@ -204,7 +204,7 @@ int32 ProbesRenderer::Entry::GetResolution() const
PixelFormat ProbesRenderer::Entry::GetFormat() const
{
return GraphicsSettings::Get()->UeeHDRProbes ? PixelFormat::R11G11B10_Float : PixelFormat::R8G8B8A8_UNorm;
return GraphicsSettings::Get()->UseHDRProbes ? PixelFormat::R11G11B10_Float : PixelFormat::R8G8B8A8_UNorm;
}
int32 ProbesRenderer::GetBakeQueueSize()
@@ -919,10 +919,8 @@ namespace Flax.Build.Bindings
// Properties
foreach (var propertyInfo in classInfo.Properties)
{
if (propertyInfo.IsHidden)
if (propertyInfo.IsHidden || !useUnmanaged)
continue;
if (!useUnmanaged)
throw new NotImplementedException("TODO: support properties inside non-static and non-scripting API class types.");
contents.AppendLine();
GenerateCSharpComment(contents, indent, propertyInfo.Comment, true);
@@ -1440,6 +1440,11 @@ namespace Flax.Build.Bindings
continue;
if (GenerateCppAutoSerializationSkip(buildData, typeInfo, propertyInfo, propertyInfo.Type))
continue;
CppAutoSerializeProperties.Add(propertyInfo);
// Skip writing deprecated properties (read-only deserialization to allow reading old data)
if (propertyInfo.HasAttribute("Obsolete"))
continue;
contents.Append(" {");
contents.Append(" const auto");
@@ -1456,7 +1461,6 @@ namespace Flax.Build.Bindings
contents.Append($"stream.JKEY(\"{propertyInfo.Name}\"); Serialization::Serialize(stream, value, nullptr);");
contents.Append(" }");
contents.Append('}').AppendLine();
CppAutoSerializeProperties.Add(propertyInfo);
}
}
else if (structureInfo != null)
@@ -1488,14 +1492,14 @@ namespace Flax.Build.Bindings
foreach (var propertyInfo in CppAutoSerializeProperties)
{
contents.Append(" {");
contents.Append($" const auto e = SERIALIZE_FIND_MEMBER(stream, \"{propertyInfo.Name}\");");
contents.Append(" if (e != stream.MemberEnd()) {");
contents.Append($" auto p = {propertyInfo.Getter.Name}();");
contents.Append(" Serialization::Deserialize(e->value, p, modifier);");
contents.Append($" {propertyInfo.Setter.Name}(p);");
contents.Append(" }");
contents.Append('}').AppendLine();
contents.AppendLine(" {");
contents.AppendLine($" const auto e = SERIALIZE_FIND_MEMBER(stream, \"{propertyInfo.Name}\");");
contents.AppendLine(" if (e != stream.MemberEnd()) {");
contents.AppendLine($" auto p = {propertyInfo.Getter.Name}();");
contents.AppendLine(" Serialization::Deserialize(e->value, p, modifier);");
contents.AppendLine($" {propertyInfo.Setter.Name}(p);");
contents.AppendLine(" }");
contents.AppendLine(" }");
}
contents.Append('}').AppendLine();