Merge branch 'deprecation_messages' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-deprecation_messages

This commit is contained in:
Wojtek Figat
2024-07-24 16:41:49 +02:00
35 changed files with 132 additions and 71 deletions

View File

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

View File

@@ -64,7 +64,7 @@ public:
/// [Deprecated in v1.9]
/// </summary>
API_FIELD(Attributes="EditorOrder(1320), DefaultValue(false), EditorDisplay(\"Quality\", \"Allow CSM Blending\")")
DEPRECATED bool AllowCSMBlending = false;
DEPRECATED() bool AllowCSMBlending = false;
/// <summary>
/// Default probes cubemap resolution (use for Environment Probes, can be overriden per-actor).

View File

@@ -171,7 +171,7 @@ namespace FlaxEngine
/// <param name="ray">The ray to test.</param>
/// <param name="distance">When the method completes, contains the distance of the intersection, or 0 if there was no intersection.</param>
/// <returns>Whether the two objects intersected.</returns>
[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);

View File

@@ -659,7 +659,7 @@ namespace FlaxEngine
/// <param name="plane">The plane to test.</param>
/// <param name="distance">When the method completes, contains the distance of the intersection, or 0 if there was no intersection.</param>
/// <returns>Whether the two objects intersect.</returns>
[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

View File

@@ -645,6 +645,7 @@ namespace FlaxEngine
/// <summary>
/// Maps the specified value from the given range into another.
/// [Deprecated on 17.04.2023, expires on 17.04.2024]
/// </summary>
/// <param name="value">The value to map from range [fromMin; fromMax].</param>
/// <param name="fromMin">The source range minimum value.</param>
@@ -652,8 +653,7 @@ namespace FlaxEngine
/// <param name="toMin">The destination range minimum value.</param>
/// <param name="toMax">The destination range maximum value.</param>
/// <returns>The mapped value in range [toMin; toMax].</returns>
// [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);

View File

@@ -808,6 +808,7 @@ namespace FlaxEngine
/// <summary>
/// Maps the specified value from the given range into another.
/// [Deprecated on 17.04.2023, expires on 17.04.2024]
/// </summary>
/// <param name="value">The value to map from range [fromMin; fromMax].</param>
/// <param name="fromMin">The source range minimum value.</param>
@@ -815,8 +816,7 @@ namespace FlaxEngine
/// <param name="toMin">The destination range minimum value.</param>
/// <param name="toMax">The destination range maximum value.</param>
/// <returns>The mapped value in range [toMin; toMax].</returns>
// [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);

View File

@@ -825,7 +825,7 @@ namespace FlaxEngine
/// <param name="rotation">When the method completes, contains the rotation component of the decomposed matrix.</param>
/// <param name="translation">When the method completes, contains the translation component of the decomposed matrix.</param>
/// <remarks>This method is designed to decompose an SRT transformation matrix only.</remarks>
[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);

View File

@@ -481,7 +481,7 @@ public:
/// <param name="translation">When the method completes, contains the translation component of the decomposed matrix.</param>
/// <remarks>This method is designed to decompose an SRT transformation matrix only.</remarks>
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

View File

@@ -149,7 +149,7 @@ namespace FlaxEngine
/// <param name="plane">The plane to test.</param>
/// <param name="distance">When the method completes, contains the distance of the intersection, or 0 if there was no intersection.</param>
/// <returns>Whether the two objects intersected.</returns>
[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
/// <param name="vertex3">The third vertex of the triangle to test.</param>
/// <param name="distance">When the method completes, contains the distance of the intersection, or 0 if there was no intersection.</param>
/// <returns>Whether the two objects intersected.</returns>
[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
/// <param name="sphere">The sphere to test.</param>
/// <param name="distance">When the method completes, contains the distance of the intersection, or 0 if there was no intersection.</param>
/// <returns>Whether the two objects intersected.</returns>
[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);

View File

@@ -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()
/// </summary>
DEPRECATED const T* GetNonTerminatedText() const
DEPRECATED("Use GetText instead") const T* GetNonTerminatedText() const
{
return _data ? _data : (const T*)TEXT("");
}