From e08b57e814682c4d8bafab992db3aa513b562662 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Mon, 17 Jun 2024 20:00:30 +0300 Subject: [PATCH 1/3] Support custom deprecation messages in bindings generator --- Source/Engine/Content/Asset.h | 16 ++++++- Source/Engine/Core/Compiler.h | 8 ++-- Source/Engine/Core/Config/GraphicsSettings.h | 2 +- Source/Engine/Core/Math/Matrix.h | 2 +- Source/Engine/Core/Types/StringView.h | 2 +- Source/Engine/Debug/DebugDraw.h | 2 +- Source/Engine/Graphics/Graphics.h | 2 +- Source/Engine/Graphics/RenderView.h | 4 +- Source/Engine/Level/Actor.h | 4 +- Source/Engine/Level/Actors/AnimatedModel.h | 2 +- Source/Engine/Navigation/NavMeshRuntime.h | 2 +- Source/Engine/Navigation/Navigation.h | 2 +- Source/Engine/Networking/NetworkConfig.h | 4 +- Source/Engine/Platform/Base/PlatformBase.h | 6 +-- .../Tools/Flax.Build/Bindings/ApiTypeInfo.cs | 7 +-- .../Bindings/BindingsGenerator.CSharp.cs | 15 ++++-- .../Bindings/BindingsGenerator.Cache.cs | 2 +- .../Bindings/BindingsGenerator.Parsing.cs | 46 +++++++++++++++---- .../Tools/Flax.Build/Bindings/MemberInfo.cs | 8 ++-- .../Tools/Flax.Build/Bindings/TypedefInfo.cs | 2 +- .../Platforms/Windows/WindowsToolchainBase.cs | 3 ++ 21 files changed, 98 insertions(+), 43 deletions(-) diff --git a/Source/Engine/Content/Asset.h b/Source/Engine/Content/Asset.h index 15c5cae6f..125abdda2 100644 --- a/Source/Engine/Content/Asset.h +++ b/Source/Engine/Content/Asset.h @@ -184,8 +184,20 @@ public: /// The output collection of the asset ids referenced by this asset. /// The output list of file paths referenced by this asset. Files might come from project Content folder (relative path is preserved in cooked game), or external location (copied into Content root folder of cooked game). virtual void GetReferences(Array& assets, Array& files) const; - // [Deprecated in v1.9] - DEPRECATED virtual void GetReferences(Array& output) const; + + + /// + /// Gets the asset references. Supported only in Editor. + /// [Deprecated in v1.9] + /// + /// + /// For some asset types (e.g. scene or prefab) it may contain invalid asset ids due to not perfect gather method, + /// which is optimized to perform scan very quickly. Before using those ids perform simple validation via Content cache API. + /// The result collection contains only 1-level-deep references (only direct ones) and is invalid if asset is not loaded. + /// Also, the output data may have duplicated asset ids or even invalid ids (Guid::Empty). + /// + /// The output collection of the asset ids referenced by this asset. + DEPRECATED("Use GetReferences with assets and files parameter instead") virtual void GetReferences(Array& output) const; /// /// Gets the asset references. Supported only in Editor. diff --git a/Source/Engine/Core/Compiler.h b/Source/Engine/Core/Compiler.h index 9c736aa14..3e178143a 100644 --- a/Source/Engine/Core/Compiler.h +++ b/Source/Engine/Core/Compiler.h @@ -21,7 +21,6 @@ #define ALIGN_BEGIN(_align) #define ALIGN_END(_align) __attribute__( (aligned(_align) ) ) #define OFFSET_OF(X, Y) __builtin_offsetof(X, Y) -#define DEPRECATED [[deprecated]] #define PRAGMA_DISABLE_DEPRECATION_WARNINGS \ _Pragma("clang diagnostic push") \ _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") @@ -53,7 +52,6 @@ #define ALIGN_BEGIN(_align) #define ALIGN_END(_align) __attribute__( (aligned(_align) ) ) #define OFFSET_OF(X, Y) __builtin_offsetof(X, Y) -#define DEPRECATED [[deprecated]] #define PRAGMA_DISABLE_DEPRECATION_WARNINGS #define PRAGMA_ENABLE_DEPRECATION_WARNINGS @@ -80,7 +78,6 @@ #define ALIGN_BEGIN(_align) __declspec(align(_align)) #define ALIGN_END(_align) #define OFFSET_OF(X, Y) offsetof(X, Y) -#define DEPRECATED __declspec(deprecated) #undef __PRETTY_FUNCTION__ #define __PRETTY_FUNCTION__ __FUNCSIG__ #define PRAGMA_DISABLE_DEPRECATION_WARNINGS \ @@ -100,6 +97,11 @@ #define PACK_STRUCT(_declaration) PACK_BEGIN() _declaration PACK_END() +#define _DEPRECATED_0() [[deprecated]] +#define _DEPRECATED_1(msg) [[deprecated(msg)]] +#define _DEPRECATED(_0, _1, LASTARG, ...) LASTARG +#define DEPRECATED(...) _DEPRECATED(, ##__VA_ARGS__, _DEPRECATED_1(__VA_ARGS__), _DEPRECATED_0()) + // C++ 17 #if __cplusplus >= 201703L #define IF_CONSTEXPR constexpr diff --git a/Source/Engine/Core/Config/GraphicsSettings.h b/Source/Engine/Core/Config/GraphicsSettings.h index 9fef78f74..4f837fd52 100644 --- a/Source/Engine/Core/Config/GraphicsSettings.h +++ b/Source/Engine/Core/Config/GraphicsSettings.h @@ -64,7 +64,7 @@ public: /// [Deprecated in v1.9] /// API_FIELD(Attributes="EditorOrder(1320), DefaultValue(false), EditorDisplay(\"Quality\", \"Allow CSM Blending\")") - DEPRECATED bool AllowCSMBlending = false; + DEPRECATED() bool AllowCSMBlending = false; /// /// Default probes cubemap resolution (use for Environment Probes, can be overriden per-actor). diff --git a/Source/Engine/Core/Math/Matrix.h b/Source/Engine/Core/Math/Matrix.h index b7f5ef8cf..0ee31df4f 100644 --- a/Source/Engine/Core/Math/Matrix.h +++ b/Source/Engine/Core/Math/Matrix.h @@ -481,7 +481,7 @@ public: /// When the method completes, contains the translation component of the decomposed matrix. /// This method is designed to decompose an SRT transformation matrix only. void Decompose(Float3& scale, Matrix3x3& rotation, Float3& translation) const; - DEPRECATED void Decompose(Float3& scale, Matrix& rotation, Float3& translation) const; + DEPRECATED("Use Decompose with 'Matrix3x3& rotation' parameter instead") void Decompose(Float3& scale, Matrix& rotation, Float3& translation) const; public: Matrix operator*(const float scale) const diff --git a/Source/Engine/Core/Types/StringView.h b/Source/Engine/Core/Types/StringView.h index 052bc1d54..2e9e9aaf5 100644 --- a/Source/Engine/Core/Types/StringView.h +++ b/Source/Engine/Core/Types/StringView.h @@ -115,7 +115,7 @@ public: /// Gets the pointer to the string or to the static empty text if string is null. Returned pointer is always non-null, but is not null-terminated. /// [Deprecated on 26.10.2022, expires on 26.10.2024] Use GetText() /// - DEPRECATED const T* GetNonTerminatedText() const + DEPRECATED("Use GetText instead") const T* GetNonTerminatedText() const { return _data ? _data : (const T*)TEXT(""); } diff --git a/Source/Engine/Debug/DebugDraw.h b/Source/Engine/Debug/DebugDraw.h index 30e4c905f..93718abe0 100644 --- a/Source/Engine/Debug/DebugDraw.h +++ b/Source/Engine/Debug/DebugDraw.h @@ -96,7 +96,7 @@ API_CLASS(Static) class FLAXENGINE_API DebugDraw /// The color. /// The duration (in seconds). Use 0 to draw it only once. /// If set to true depth test will be performed, otherwise depth will be ignored. - API_FUNCTION() DEPRECATED static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color = Color::White, float duration = 0.0f, bool depthTest = true); + API_FUNCTION() DEPRECATED("Use DrawRay with length parameter instead") static void DrawRay(const Vector3& origin, const Vector3& direction, const Color& color, float duration, bool depthTest); /// /// Draws the line in a direction. diff --git a/Source/Engine/Graphics/Graphics.h b/Source/Engine/Graphics/Graphics.h index 55ded56e5..be9ec9ac3 100644 --- a/Source/Engine/Graphics/Graphics.h +++ b/Source/Engine/Graphics/Graphics.h @@ -52,7 +52,7 @@ public: /// Enables cascades splits blending for directional light shadows. /// [Deprecated in v1.9] /// - API_FIELD() DEPRECATED static bool AllowCSMBlending; + API_FIELD() DEPRECATED() static bool AllowCSMBlending; /// /// The Global SDF quality. Controls the volume texture resolution and amount of cascades to use. diff --git a/Source/Engine/Graphics/RenderView.h b/Source/Engine/Graphics/RenderView.h index f2411ae2a..0b9f931e7 100644 --- a/Source/Engine/Graphics/RenderView.h +++ b/Source/Engine/Graphics/RenderView.h @@ -161,13 +161,13 @@ public: /// The model LOD bias. Default is 0. Applied to all the objects in the shadow maps render views. Can be used to improve shadows rendering performance or increase quality. /// [Deprecated on 26.10.2022, expires on 26.10.2024] /// - API_FIELD() DEPRECATED int32 ShadowModelLODBias = 0; + API_FIELD() DEPRECATED() int32 ShadowModelLODBias = 0; /// /// The model LOD distance scale factor. Default is 1. Applied to all the objects in the shadow maps render views. Higher values increase LODs quality. Can be used to improve shadows rendering performance or increase quality. /// [Deprecated on 26.10.2022, expires on 26.10.2024] /// - API_FIELD() DEPRECATED float ShadowModelLODDistanceFactor = 1.0f; + API_FIELD() DEPRECATED() float ShadowModelLODDistanceFactor = 1.0f; /// /// Temporal Anti-Aliasing jitter frame index. diff --git a/Source/Engine/Level/Actor.h b/Source/Engine/Level/Actor.h index dc77cdbee..5a792858d 100644 --- a/Source/Engine/Level/Actor.h +++ b/Source/Engine/Level/Actor.h @@ -164,13 +164,13 @@ public: /// [Deprecated in v1.5] /// API_PROPERTY(Attributes="HideInEditor, NoSerialize, NoAnimate") - DEPRECATED const String& GetTag() const; + DEPRECATED("Use HasTag instead") const String& GetTag() const; /// /// Sets the name of the tag. /// [Deprecated in v1.5] /// - API_PROPERTY() DEPRECATED void SetTag(const StringView& value); + API_PROPERTY() DEPRECATED("Use AddTag instead") void SetTag(const StringView& value); /// /// Gets the actor name. diff --git a/Source/Engine/Level/Actors/AnimatedModel.h b/Source/Engine/Level/Actors/AnimatedModel.h index bb4b3a8f0..cf70ec220 100644 --- a/Source/Engine/Level/Actors/AnimatedModel.h +++ b/Source/Engine/Level/Actors/AnimatedModel.h @@ -160,7 +160,7 @@ public: /// [Deprecated on 26.10.2022, expires on 26.10.2024] /// API_FIELD(Attributes="EditorOrder(110), DefaultValue(ShadowsCastingMode.All), EditorDisplay(\"Skinned Model\")") - DEPRECATED ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All; + DEPRECATED() ShadowsCastingMode ShadowsMode = ShadowsCastingMode::All; /// /// The animation root motion apply target. If not specified the animated model will apply it itself. diff --git a/Source/Engine/Navigation/NavMeshRuntime.h b/Source/Engine/Navigation/NavMeshRuntime.h index 40ea0959e..a3d7d9d53 100644 --- a/Source/Engine/Navigation/NavMeshRuntime.h +++ b/Source/Engine/Navigation/NavMeshRuntime.h @@ -160,7 +160,7 @@ public: /// The source point. /// The result position on the navmesh (valid only if method returns true). /// True if found valid location on the navmesh, otherwise false. - API_FUNCTION() DEPRECATED bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result) const + API_FUNCTION() DEPRECATED("Use FindClosestPoint instead") bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result) const { return FindClosestPoint(point, result); } diff --git a/Source/Engine/Navigation/Navigation.h b/Source/Engine/Navigation/Navigation.h index 7628aa59a..4f920b673 100644 --- a/Source/Engine/Navigation/Navigation.h +++ b/Source/Engine/Navigation/Navigation.h @@ -54,7 +54,7 @@ public: /// The source point. /// The result position on the navmesh (valid only if method returns true). /// True if found valid location on the navmesh, otherwise false. - API_FUNCTION() DEPRECATED static bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result) + API_FUNCTION() DEPRECATED("Use FindClosestPoint instead") static bool ProjectPoint(const Vector3& point, API_PARAM(Out) Vector3& result) { return FindClosestPoint(point, result); } diff --git a/Source/Engine/Networking/NetworkConfig.h b/Source/Engine/Networking/NetworkConfig.h index e9827e536..0559dd34b 100644 --- a/Source/Engine/Networking/NetworkConfig.h +++ b/Source/Engine/Networking/NetworkConfig.h @@ -10,7 +10,7 @@ class ScriptingObject; /// Network driver implementations enum. /// [Deprecated in v1.3] /// -API_ENUM(Namespace="FlaxEngine.Networking") enum class DEPRECATED NetworkDriverType +API_ENUM(Namespace="FlaxEngine.Networking") enum class DEPRECATED() NetworkDriverType { /// /// Invalid network driver implementation. @@ -36,7 +36,7 @@ API_STRUCT(Namespace="FlaxEngine.Networking") struct FLAXENGINE_API NetworkConfi /// [Deprecated in v1.3] /// API_FIELD() - DEPRECATED NetworkDriverType NetworkDriverType; + DEPRECATED("Use NetworkDriver field instead") NetworkDriverType NetworkDriverType; /// /// The network driver instance (implements INetworkDriver) that will be used to create and manage the peer, send and receive messages. diff --git a/Source/Engine/Platform/Base/PlatformBase.h b/Source/Engine/Platform/Base/PlatformBase.h index 35cfd8d17..d5ff4c59f 100644 --- a/Source/Engine/Platform/Base/PlatformBase.h +++ b/Source/Engine/Platform/Base/PlatformBase.h @@ -753,7 +753,7 @@ public: /// True if start process with hidden window /// True if wait for process competition /// Retrieves the termination status of the specified process. Valid only if processed ended. - API_FUNCTION() DEPRECATED static int32 StartProcess(const StringView& filename, const StringView& args, const StringView& workingDir, bool hiddenWindow = false, bool waitForEnd = false); + API_FUNCTION() DEPRECATED("Use CreateProcess instead") static int32 StartProcess(const StringView& filename, const StringView& args, const StringView& workingDir, bool hiddenWindow = false, bool waitForEnd = false); /// /// Starts a new process (runs commandline). Waits for it's end and captures its output. @@ -763,7 +763,7 @@ public: /// The custom path of the working directory. /// True if start process with hidden window. /// Retrieves the termination status of the specified process. Valid only if processed ended. - API_FUNCTION() DEPRECATED static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, bool hiddenWindow = true); + API_FUNCTION() DEPRECATED("Use CreateProcess instead") static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, bool hiddenWindow = true); /// /// Starts a new process (runs commandline). Waits for it's end and captures its output. @@ -774,7 +774,7 @@ public: /// The process environment variables. If null the current process environment is used. /// True if start process with hidden window. /// Retrieves the termination status of the specified process. Valid only if processed ended. - API_FUNCTION() DEPRECATED static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, const Dictionary& environment, bool hiddenWindow = true); + API_FUNCTION() DEPRECATED("Use CreateProcess instead") static int32 RunProcess(const StringView& cmdLine, const StringView& workingDir, const Dictionary& environment, bool hiddenWindow = true); /// /// Creates a new process. diff --git a/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs b/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs index ee1004213..9c3fe6dd8 100644 --- a/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs +++ b/Source/Tools/Flax.Build/Bindings/ApiTypeInfo.cs @@ -21,7 +21,7 @@ namespace Flax.Build.Bindings public string Attributes; public string[] Comment; public bool IsInBuild; - public bool IsDeprecated; + public string DeprecatedMessage; public TypeInfo MarshalAs; internal bool IsInited; internal TypedefInfo Instigator; @@ -34,6 +34,7 @@ namespace Flax.Build.Bindings public virtual bool IsScriptingObject => false; public virtual bool IsPod => false; public virtual bool SkipGeneration => IsInBuild; + public virtual bool IsDeprecated => DeprecatedMessage != null; public FileInfo File { @@ -154,7 +155,7 @@ namespace Flax.Build.Bindings BindingsGenerator.Write(writer, Comment); BindingsGenerator.Write(writer, MarshalAs); writer.Write(IsInBuild); - writer.Write(IsDeprecated); + BindingsGenerator.Write(writer, DeprecatedMessage); BindingsGenerator.Write(writer, Tags); BindingsGenerator.Write(writer, Children); } @@ -168,7 +169,7 @@ namespace Flax.Build.Bindings Comment = BindingsGenerator.Read(reader, Comment); MarshalAs = BindingsGenerator.Read(reader, MarshalAs); IsInBuild = reader.ReadBoolean(); - IsDeprecated = reader.ReadBoolean(); + DeprecatedMessage = BindingsGenerator.Read(reader, DeprecatedMessage); Tags = BindingsGenerator.Read(reader, Tags); Children = BindingsGenerator.Read(reader, Children); diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs index 70b23502b..5274ad43b 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs @@ -829,7 +829,7 @@ namespace Flax.Build.Bindings } } - private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, string attributes = null, string[] comment = null, bool canUseTooltip = false, bool useUnmanaged = false, string defaultValue = null, bool isDeprecated = false, TypeInfo defaultValueType = null) + private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, string attributes = null, string[] comment = null, bool canUseTooltip = false, bool useUnmanaged = false, string defaultValue = null, string deprecatedMessage = null, TypeInfo defaultValueType = null) { #if AUTO_DOC_TOOLTIPS var writeTooltip = true; @@ -853,10 +853,15 @@ namespace Flax.Build.Bindings // Skip boilerplate code when using debugger //contents.Append(indent).AppendLine("[System.Diagnostics.DebuggerStepThrough]"); } - if (isDeprecated || apiTypeInfo.IsDeprecated) + if (deprecatedMessage != null || apiTypeInfo.IsDeprecated) { // Deprecated type - contents.Append(indent).AppendLine("[Obsolete]"); + if (!string.IsNullOrEmpty(apiTypeInfo.DeprecatedMessage)) + contents.Append(indent).AppendLine($"[Obsolete(\"{apiTypeInfo.DeprecatedMessage}\")]"); + else if (!string.IsNullOrEmpty(deprecatedMessage)) + contents.Append(indent).AppendLine($"[Obsolete(\"{deprecatedMessage}\")]"); + else + contents.Append(indent).AppendLine("[Obsolete]"); } #if AUTO_DOC_TOOLTIPS @@ -901,12 +906,12 @@ namespace Flax.Build.Bindings private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, bool useUnmanaged, string defaultValue = null, TypeInfo defaultValueType = null) { - GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, apiTypeInfo.Attributes, apiTypeInfo.Comment, true, useUnmanaged, defaultValue, false, defaultValueType); + GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, apiTypeInfo.Attributes, apiTypeInfo.Comment, true, useUnmanaged, defaultValue, null, defaultValueType); } private static void GenerateCSharpAttributes(BuildData buildData, StringBuilder contents, string indent, ApiTypeInfo apiTypeInfo, MemberInfo memberInfo, bool useUnmanaged, string defaultValue = null, TypeInfo defaultValueType = null) { - GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, memberInfo.Attributes, memberInfo.Comment, true, useUnmanaged, defaultValue, memberInfo.IsDeprecated, defaultValueType); + GenerateCSharpAttributes(buildData, contents, indent, apiTypeInfo, memberInfo.Attributes, memberInfo.Comment, true, useUnmanaged, defaultValue, memberInfo.DeprecatedMessage, defaultValueType); } private static bool GenerateCSharpStructureUseDefaultInitialize(BuildData buildData, StructureInfo structureInfo) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs index d9fca9fca..a94307ed6 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Cache.cs @@ -19,7 +19,7 @@ namespace Flax.Build.Bindings partial class BindingsGenerator { private static readonly Dictionary TypeCache = new Dictionary(); - private const int CacheVersion = 22; + private const int CacheVersion = 23; internal static void Write(BinaryWriter writer, string e) { diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs index 46eeeb572..15fe42bfd 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.Parsing.cs @@ -589,7 +589,13 @@ namespace Flax.Build.Bindings token = context.Tokenizer.NextToken(); if (!desc.IsDeprecated && token.Value == "DEPRECATED") { - desc.IsDeprecated = true; + token = context.Tokenizer.NextToken(); + string message = ""; + if (token.Type == TokenType.LeftParent) + context.Tokenizer.SkipUntil(TokenType.RightParent, out message); + else + context.Tokenizer.PreviousToken(); + desc.DeprecatedMessage = message.Trim('"'); } else { @@ -698,7 +704,13 @@ namespace Flax.Build.Bindings token = context.Tokenizer.NextToken(); if (!desc.IsDeprecated && token.Value == "DEPRECATED") { - desc.IsDeprecated = true; + token = context.Tokenizer.NextToken(); + string message = ""; + if (token.Type == TokenType.LeftParent) + context.Tokenizer.SkipUntil(TokenType.RightParent, out message); + else + context.Tokenizer.PreviousToken(); + desc.DeprecatedMessage = message.Trim('"'); } else { @@ -797,8 +809,14 @@ namespace Flax.Build.Bindings } else if (!desc.IsDeprecated && token.Value == "DEPRECATED") { - desc.IsDeprecated = true; - context.Tokenizer.NextToken(); + token = context.Tokenizer.NextToken(); + string message = ""; + if (token.Type == TokenType.LeftParent) + { + context.Tokenizer.SkipUntil(TokenType.RightParent, out message); + context.Tokenizer.NextToken(); + } + desc.DeprecatedMessage = message.Trim('"'); } else { @@ -960,7 +978,7 @@ namespace Flax.Build.Bindings propertyInfo.Getter = functionInfo; else propertyInfo.Setter = functionInfo; - propertyInfo.IsDeprecated |= functionInfo.IsDeprecated; + propertyInfo.DeprecatedMessage = functionInfo.DeprecatedMessage; propertyInfo.IsHidden |= functionInfo.IsHidden; if (propertyInfo.Getter != null && propertyInfo.Setter != null) @@ -1025,7 +1043,13 @@ namespace Flax.Build.Bindings token = context.Tokenizer.NextToken(); if (!desc.IsDeprecated && token.Value == "DEPRECATED") { - desc.IsDeprecated = true; + token = context.Tokenizer.NextToken(); + string message = ""; + if (token.Type == TokenType.LeftParent) + context.Tokenizer.SkipUntil(TokenType.RightParent, out message); + else + context.Tokenizer.PreviousToken(); + desc.DeprecatedMessage = message.Trim('"'); } else { @@ -1300,8 +1324,14 @@ namespace Flax.Build.Bindings } else if (!desc.IsDeprecated && token.Value == "DEPRECATED") { - desc.IsDeprecated = true; - context.Tokenizer.NextToken(); + token = context.Tokenizer.NextToken(); + string message = ""; + if (token.Type == TokenType.LeftParent) + { + context.Tokenizer.SkipUntil(TokenType.RightParent, out message); + context.Tokenizer.NextToken(); + } + desc.DeprecatedMessage = message.Trim('"'); } else { diff --git a/Source/Tools/Flax.Build/Bindings/MemberInfo.cs b/Source/Tools/Flax.Build/Bindings/MemberInfo.cs index b0eb00313..5d2a5644d 100644 --- a/Source/Tools/Flax.Build/Bindings/MemberInfo.cs +++ b/Source/Tools/Flax.Build/Bindings/MemberInfo.cs @@ -14,12 +14,14 @@ namespace Flax.Build.Bindings public string[] Comment; public bool IsStatic; public bool IsConstexpr; - public bool IsDeprecated; + public string DeprecatedMessage; public bool IsHidden; public AccessLevel Access; public string Attributes; public Dictionary Tags; + public virtual bool IsDeprecated => DeprecatedMessage != null; + public bool HasAttribute(string name) { return Attributes != null && Attributes.Contains(name); @@ -46,7 +48,7 @@ namespace Flax.Build.Bindings BindingsGenerator.Write(writer, Comment); writer.Write(IsStatic); writer.Write(IsConstexpr); - writer.Write(IsDeprecated); + BindingsGenerator.Write(writer, DeprecatedMessage); writer.Write(IsHidden); writer.Write((byte)Access); BindingsGenerator.Write(writer, Attributes); @@ -59,7 +61,7 @@ namespace Flax.Build.Bindings Comment = BindingsGenerator.Read(reader, Comment); IsStatic = reader.ReadBoolean(); IsConstexpr = reader.ReadBoolean(); - IsDeprecated = reader.ReadBoolean(); + DeprecatedMessage = BindingsGenerator.Read(reader, DeprecatedMessage); IsHidden = reader.ReadBoolean(); Access = (AccessLevel)reader.ReadByte(); Attributes = BindingsGenerator.Read(reader, Attributes); diff --git a/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs b/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs index 661ca51a4..3d85fb1b3 100644 --- a/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs +++ b/Source/Tools/Flax.Build/Bindings/TypedefInfo.cs @@ -76,7 +76,7 @@ namespace Flax.Build.Bindings if (Comment != null && Comment.Length != 0) typedef.Comment = Comment; typedef.IsInBuild |= IsInBuild; - typedef.IsDeprecated |= IsDeprecated; + typedef.DeprecatedMessage = DeprecatedMessage; if (typedef is ClassStructInfo typedefClassStruct && typedefClassStruct.IsTemplate) { // Inflate template type diff --git a/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs b/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs index 252d9134d..adda38e93 100644 --- a/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs +++ b/Source/Tools/Flax.Build/Platforms/Windows/WindowsToolchainBase.cs @@ -617,6 +617,9 @@ namespace Flax.Build.Platforms commonArgs.Add(string.Format("/FU\"{0}\\platform.winmd\"", dir)); } } + + // Preprocessor conformance mode + commonArgs.Add("/Zc:preprocessor"); } // Add preprocessor definitions From 6c8288f38a1ba40897799af50793c84e78be8d97 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Mon, 17 Jun 2024 20:13:53 +0300 Subject: [PATCH 2/3] Fix deprecation warnings in generated bindings code --- .../Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs index 5274ad43b..2b97a7168 100644 --- a/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs +++ b/Source/Tools/Flax.Build/Bindings/BindingsGenerator.CSharp.cs @@ -1431,6 +1431,7 @@ namespace Flax.Build.Bindings {{GenerateCSharpAccessLevel(classInfo.Access)}}static class {{marshallerName}} { #pragma warning disable 1591 + #pragma warning disable 618 #if FLAX_EDITOR [HideInEditor] #endif @@ -1467,6 +1468,7 @@ namespace Flax.Build.Bindings internal static {{classInfo.Name}} ToManaged(IntPtr managed) => Unsafe.As<{{classInfo.Name}}>(ManagedHandleMarshaller.ToManaged(managed)); internal static IntPtr ToNative({{classInfo.Name}} managed) => ManagedHandleMarshaller.ToNative(managed); + #pragma warning restore 618 #pragma warning restore 1591 } """).Split(new char[] { '\n' }))); @@ -1764,6 +1766,7 @@ namespace Flax.Build.Bindings {{GenerateCSharpAccessLevel(structureInfo.Access)}}static unsafe class {{marshallerName}} { #pragma warning disable 1591 + #pragma warning disable 618 {{structContents.Replace("\n", "\n" + " ").ToString().TrimEnd()}} {{InsertHideInEditorSection()}} @@ -1810,6 +1813,7 @@ namespace Flax.Build.Bindings { {{toNativeContent.Replace("\n", "\n" + " ").ToString().TrimEnd()}} } + #pragma warning restore 618 #pragma warning restore 1591 } """).Split(new char[] { '\n' }))); @@ -2170,8 +2174,10 @@ namespace Flax.Build.Bindings contents.Append(indent).AppendLine($"public static class {marshallerName}"); contents.Append(indent).AppendLine("{"); contents.AppendLine("#pragma warning disable 1591"); + contents.AppendLine("#pragma warning disable 618"); contents.Append(indent).Append(" ").AppendLine($"internal static {interfaceInfo.Name} ConvertToManaged(IntPtr unmanaged) => ({interfaceInfo.Name})ManagedHandleMarshaller.ConvertToManaged(unmanaged);"); contents.Append(indent).Append(" ").AppendLine($"internal static IntPtr ConvertToUnmanaged({interfaceInfo.Name} managed) => ManagedHandleMarshaller.ConvertToUnmanaged(managed);"); + contents.AppendLine("#pragma warning restore 618"); contents.AppendLine("#pragma warning restore 1591"); contents.Append(indent).AppendLine("}"); } From 22b4f33984953070a700f0ec0bf77792dfb7b4e0 Mon Sep 17 00:00:00 2001 From: Ari Vuollet Date: Mon, 17 Jun 2024 20:35:24 +0300 Subject: [PATCH 3/3] Use consistent and less verbose deprecation messages --- .../CustomEditors/Elements/DoubleValueElement.cs | 2 +- .../CustomEditors/Elements/FloatValueElement.cs | 2 +- Source/Editor/Editor.cs | 4 ++-- Source/Engine/Core/Math/BoundingBox.cs | 2 +- Source/Engine/Core/Math/CollisionsHelper.cs | 2 +- Source/Engine/Core/Math/Mathd.cs | 4 ++-- Source/Engine/Core/Math/Mathf.cs | 4 ++-- Source/Engine/Core/Math/Matrix.cs | 2 +- Source/Engine/Core/Math/Ray.cs | 6 +++--- Source/Engine/Engine/InputEvent.cs | 2 +- Source/Engine/Graphics/Mesh.cs | 12 ++++++------ Source/Engine/Graphics/SkinnedMesh.cs | 6 +++--- Source/Engine/Physics/CollisionData.cs | 6 +++--- Source/Engine/Utilities/Utils.cs | 2 +- 14 files changed, 28 insertions(+), 28 deletions(-) diff --git a/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs b/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs index cf16a1194..eb0bdd823 100644 --- a/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs +++ b/Source/Editor/CustomEditors/Elements/DoubleValueElement.cs @@ -22,7 +22,7 @@ namespace FlaxEditor.CustomEditors.Elements /// /// [Deprecated on 26.05.2022, expires on 26.05.2024] /// - [System.Obsolete("Deprecated in 1.4, use ValueBox instead")] + [System.Obsolete("Use ValueBox instead")] public DoubleValueBox DoubleValue => ValueBox; /// diff --git a/Source/Editor/CustomEditors/Elements/FloatValueElement.cs b/Source/Editor/CustomEditors/Elements/FloatValueElement.cs index aabdb79e4..32a8b42c3 100644 --- a/Source/Editor/CustomEditors/Elements/FloatValueElement.cs +++ b/Source/Editor/CustomEditors/Elements/FloatValueElement.cs @@ -22,7 +22,7 @@ namespace FlaxEditor.CustomEditors.Elements /// /// [Deprecated on 26.05.2022, expires on 26.05.2024] /// - [System.Obsolete("Deprecated in 1.4, use ValueBox instead")] + [System.Obsolete("Use ValueBox instead")] public FloatValueBox FloatValue => ValueBox; /// diff --git a/Source/Editor/Editor.cs b/Source/Editor/Editor.cs index 6a1e804b8..e64be977b 100644 --- a/Source/Editor/Editor.cs +++ b/Source/Editor/Editor.cs @@ -850,7 +850,7 @@ namespace FlaxEditor /// New asset types allowed to create. /// [Deprecated in v1.8] /// - [Obsolete("Use CreateAsset with named tag.")] + [Obsolete("Use CreateAsset with named tag instead")] public enum NewAssetType { /// @@ -1031,7 +1031,7 @@ namespace FlaxEditor /// /// New asset type. /// Output asset path. - [Obsolete("Use CreateAsset with named tag.")] + [Obsolete("Use CreateAsset with named tag instead")] public static bool CreateAsset(NewAssetType type, string outputPath) { // [Deprecated on 18.02.2024, expires on 18.02.2025] diff --git a/Source/Engine/Core/Math/BoundingBox.cs b/Source/Engine/Core/Math/BoundingBox.cs index d6c3a54b1..7f871a8a1 100644 --- a/Source/Engine/Core/Math/BoundingBox.cs +++ b/Source/Engine/Core/Math/BoundingBox.cs @@ -171,7 +171,7 @@ namespace FlaxEngine /// The ray to test. /// When the method completes, contains the distance of the intersection, or 0 if there was no intersection. /// Whether the two objects intersected. - [Obsolete("Deprecated in v1.4")] + [Obsolete("Use Intersects with 'out Real distance' parameter instead")] public bool Intersects(ref Ray ray, out float distance) { var result = CollisionsHelper.RayIntersectsBox(ref ray, ref this, out Real dst); diff --git a/Source/Engine/Core/Math/CollisionsHelper.cs b/Source/Engine/Core/Math/CollisionsHelper.cs index d8393a507..e51aaf7f3 100644 --- a/Source/Engine/Core/Math/CollisionsHelper.cs +++ b/Source/Engine/Core/Math/CollisionsHelper.cs @@ -659,7 +659,7 @@ namespace FlaxEngine /// The plane to test. /// When the method completes, contains the distance of the intersection, or 0 if there was no intersection. /// Whether the two objects intersect. - [Obsolete("Deprecated in 1.4")] + [Obsolete("Use RayIntersectsPlane with 'out Real distance' parameter instead")] public static bool RayIntersectsPlane(ref Ray ray, ref Plane plane, out float distance) { //Source: Real-Time Collision Detection by Christer Ericson diff --git a/Source/Engine/Core/Math/Mathd.cs b/Source/Engine/Core/Math/Mathd.cs index 98f215cdf..556300451 100644 --- a/Source/Engine/Core/Math/Mathd.cs +++ b/Source/Engine/Core/Math/Mathd.cs @@ -645,6 +645,7 @@ namespace FlaxEngine /// /// Maps the specified value from the given range into another. + /// [Deprecated on 17.04.2023, expires on 17.04.2024] /// /// The value to map from range [fromMin; fromMax]. /// The source range minimum value. @@ -652,8 +653,7 @@ namespace FlaxEngine /// The destination range minimum value. /// The destination range maximum value. /// The mapped value in range [toMin; toMax]. - // [Deprecated on 17.04.2023, expires on 17.04.2024] - [Obsolete("Please use Remap to upkeep the API consistency")] + [Obsolete("Use Remap instead")] public static double Map(double value, double fromMin, double fromMax, double toMin, double toMax) { double t = (value - fromMin) / (fromMax - fromMin); diff --git a/Source/Engine/Core/Math/Mathf.cs b/Source/Engine/Core/Math/Mathf.cs index 2ea80cbb3..31f1e4569 100644 --- a/Source/Engine/Core/Math/Mathf.cs +++ b/Source/Engine/Core/Math/Mathf.cs @@ -808,6 +808,7 @@ namespace FlaxEngine /// /// Maps the specified value from the given range into another. + /// [Deprecated on 17.04.2023, expires on 17.04.2024] /// /// The value to map from range [fromMin; fromMax]. /// The source range minimum value. @@ -815,8 +816,7 @@ namespace FlaxEngine /// The destination range minimum value. /// The destination range maximum value. /// The mapped value in range [toMin; toMax]. - // [Deprecated on 17.04.2023, expires on 17.04.2024] - [Obsolete("Please use Remap to upkeep the API consistency")] + [Obsolete("Use Remap instead")] public static float Map(float value, float fromMin, float fromMax, float toMin, float toMax) { float t = (value - fromMin) / (fromMax - fromMin); diff --git a/Source/Engine/Core/Math/Matrix.cs b/Source/Engine/Core/Math/Matrix.cs index 34e6b4bec..c065379d3 100644 --- a/Source/Engine/Core/Math/Matrix.cs +++ b/Source/Engine/Core/Math/Matrix.cs @@ -825,7 +825,7 @@ namespace FlaxEngine /// When the method completes, contains the rotation component of the decomposed matrix. /// When the method completes, contains the translation component of the decomposed matrix. /// This method is designed to decompose an SRT transformation matrix only. - [Obsolete("Deprecated in v1.8")] + [Obsolete("Use Decompose with 'out Matrix3x3 rotation' parameter instead")] public void Decompose(out Float3 scale, out Matrix rotation, out Float3 translation) { Decompose(out scale, out Matrix3x3 r, out translation); diff --git a/Source/Engine/Core/Math/Ray.cs b/Source/Engine/Core/Math/Ray.cs index 3ed5e8257..268bfddcf 100644 --- a/Source/Engine/Core/Math/Ray.cs +++ b/Source/Engine/Core/Math/Ray.cs @@ -149,7 +149,7 @@ namespace FlaxEngine /// The plane to test. /// When the method completes, contains the distance of the intersection, or 0 if there was no intersection. /// Whether the two objects intersected. - [Obsolete("Deprecated in 1.4")] + [Obsolete("Use Intersects with 'out Real distance' parameter instead")] public bool Intersects(ref Plane plane, out float distance) { return CollisionsHelper.RayIntersectsPlane(ref this, ref plane, out distance); @@ -202,7 +202,7 @@ namespace FlaxEngine /// The third vertex of the triangle to test. /// When the method completes, contains the distance of the intersection, or 0 if there was no intersection. /// Whether the two objects intersected. - [Obsolete("Deprecated in 1.4")] + [Obsolete("Use Intersects with 'out Real distance' parameter instead")] public bool Intersects(ref Vector3 vertex1, ref Vector3 vertex2, ref Vector3 vertex3, out float distance) { var result = CollisionsHelper.RayIntersectsTriangle(ref this, ref vertex1, ref vertex2, ref vertex3, out Real dst); @@ -305,7 +305,7 @@ namespace FlaxEngine /// The sphere to test. /// When the method completes, contains the distance of the intersection, or 0 if there was no intersection. /// Whether the two objects intersected. - [Obsolete("Deprecated in 1.4")] + [Obsolete("Use Intersects with 'out Real distance' parameter instead")] public bool Intersects(ref BoundingSphere sphere, out float distance) { var result = CollisionsHelper.RayIntersectsSphere(ref this, ref sphere, out Real dst); diff --git a/Source/Engine/Engine/InputEvent.cs b/Source/Engine/Engine/InputEvent.cs index e5653631f..287e044f1 100644 --- a/Source/Engine/Engine/InputEvent.cs +++ b/Source/Engine/Engine/InputEvent.cs @@ -28,7 +28,7 @@ namespace FlaxEngine /// /// Occurs when event is triggered (e.g. user pressed a key). Called before scripts update. /// - [System.Obsolete("Depreciated in 1.7, use Pressed Action.")] + [System.Obsolete("Use Pressed instead")] public event Action Triggered; /// diff --git a/Source/Engine/Graphics/Mesh.cs b/Source/Engine/Graphics/Mesh.cs index 384bb5d4f..42604c872 100644 --- a/Source/Engine/Graphics/Mesh.cs +++ b/Source/Engine/Graphics/Mesh.cs @@ -339,7 +339,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). /// The vertex colors (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(Vector3[] vertices, int[] triangles, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null, Color32[] colors = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors); @@ -357,7 +357,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). /// The vertex colors (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(List vertices, List triangles, List normals = null, List tangents = null, List uv = null, List colors = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors); @@ -375,7 +375,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). /// The vertex colors (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(Vector3[] vertices, uint[] triangles, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null, Color32[] colors = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors); @@ -393,7 +393,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). /// The vertex colors (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(List vertices, List triangles, List normals = null, List tangents = null, List uv = null, List colors = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors); @@ -411,7 +411,7 @@ namespace FlaxEngine /// The tangent vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). /// The vertex colors (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(Vector3[] vertices, ushort[] triangles, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null, Color32[] colors = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors); @@ -429,7 +429,7 @@ namespace FlaxEngine /// The tangent vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). /// The vertex colors (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(List vertices, List triangles, List normals = null, List tangents = null, List uv = null, List colors = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv), colors); diff --git a/Source/Engine/Graphics/SkinnedMesh.cs b/Source/Engine/Graphics/SkinnedMesh.cs index 6c9594bed..0381622b2 100644 --- a/Source/Engine/Graphics/SkinnedMesh.cs +++ b/Source/Engine/Graphics/SkinnedMesh.cs @@ -216,7 +216,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). /// The normal vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(Vector3[] vertices, int[] triangles, Int4[] blendIndices, Vector4[] blendWeights, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, blendIndices, Utils.ConvertCollection(blendWeights), Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv)); @@ -235,7 +235,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). /// The normal vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(Vector3[] vertices, uint[] triangles, Int4[] blendIndices, Vector4[] blendWeights, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, blendIndices, Utils.ConvertCollection(blendWeights), Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv)); @@ -254,7 +254,7 @@ namespace FlaxEngine /// The normal vectors (per vertex). /// The tangent vectors (per vertex). Use null to compute them from normal vectors. /// The texture coordinates (per vertex). - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use UpdateMesh with Float3 and Float2 parameters instead")] public void UpdateMesh(Vector3[] vertices, ushort[] triangles, Int4[] blendIndices, Vector4[] blendWeights, Vector3[] normals = null, Vector3[] tangents = null, Vector2[] uv = null) { UpdateMesh(Utils.ConvertCollection(vertices), triangles, blendIndices, Utils.ConvertCollection(blendWeights), Utils.ConvertCollection(normals), Utils.ConvertCollection(tangents), Utils.ConvertCollection(uv)); diff --git a/Source/Engine/Physics/CollisionData.cs b/Source/Engine/Physics/CollisionData.cs index 3eb5543be..c17e452e4 100644 --- a/Source/Engine/Physics/CollisionData.cs +++ b/Source/Engine/Physics/CollisionData.cs @@ -19,7 +19,7 @@ namespace FlaxEngine /// The convex mesh generation flags. /// The convex mesh vertex limit. Use values in range [8;255] /// True if failed, otherwise false. - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use CookCollision with Float3 and Float2 parameters instead")] public bool CookCollision(CollisionDataType type, Vector3[] vertices, uint[] triangles, ConvexMeshGenerationFlags convexFlags = ConvexMeshGenerationFlags.None, int convexVertexLimit = 255) { if (vertices == null) @@ -43,7 +43,7 @@ namespace FlaxEngine /// The convex mesh generation flags. /// The convex mesh vertex limit. Use values in range [8;255] /// True if failed, otherwise false. - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use CookCollision with Float3 and Float2 parameters instead")] public bool CookCollision(CollisionDataType type, Vector3[] vertices, int[] triangles, ConvexMeshGenerationFlags convexFlags = ConvexMeshGenerationFlags.None, int convexVertexLimit = 255) { if (vertices == null) @@ -60,7 +60,7 @@ namespace FlaxEngine /// /// The output vertex buffer. /// The output index buffer. - [Obsolete("Deprecated in 1.4, use overload with Float3 and Float2 parameters")] + [Obsolete("Use ExtractGeometry with Float3 and Float2 parameters instead")] public void ExtractGeometry(out Vector3[] vertexBuffer, out int[] indexBuffer) { ExtractGeometry(out Float3[] tmp, out indexBuffer); diff --git a/Source/Engine/Utilities/Utils.cs b/Source/Engine/Utilities/Utils.cs index 0767ab8f4..890bbcfb9 100644 --- a/Source/Engine/Utilities/Utils.cs +++ b/Source/Engine/Utilities/Utils.cs @@ -23,7 +23,7 @@ namespace FlaxEngine /// The source location. /// The destination location. /// The length (amount of bytes to copy). - [Obsolete("Use MemoryCopy with long length and source/destination swapped to match C++ API.")] + [Obsolete("Use MemoryCopy with long length and source/destination parameters swapped instead")] public static void MemoryCopy(IntPtr source, IntPtr destination, int length) { // [Deprecated on 30.05.2021, expires on 30.05.2022]