From 2948bfbed069d6b5265812d418b18ec278a63464 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Perrier Date: Thu, 12 Aug 2021 14:15:26 +0200 Subject: [PATCH] Backward compatibility (Mathd -> Math), fix and remove warnings. --- Source/Engine/Core/Math/Math.h | 1 + Source/Engine/Core/Math/Mathd.h | 2 +- Source/Engine/Core/Types/Variant.cpp | 6 +++--- Source/Engine/Tools/ModelTool/ModelTool.OpenFBX.cpp | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Engine/Core/Math/Math.h b/Source/Engine/Core/Math/Math.h index 462f71678..f138fadb3 100644 --- a/Source/Engine/Core/Math/Math.h +++ b/Source/Engine/Core/Math/Math.h @@ -2,6 +2,7 @@ #pragma once +#include "Engine/Core/Core.h" #include "Engine/Core/Types/BaseTypes.h" #include diff --git a/Source/Engine/Core/Math/Mathd.h b/Source/Engine/Core/Math/Mathd.h index 8da6f0330..6806ad0a9 100644 --- a/Source/Engine/Core/Math/Mathd.h +++ b/Source/Engine/Core/Math/Mathd.h @@ -5,7 +5,7 @@ #include #include "Engine/Core/Types/BaseTypes.h" -namespace Mathd +namespace Math { /// /// Computes the sine and cosine of a scalar float. diff --git a/Source/Engine/Core/Types/Variant.cpp b/Source/Engine/Core/Types/Variant.cpp index af3118858..683b195be 100644 --- a/Source/Engine/Core/Types/Variant.cpp +++ b/Source/Engine/Core/Types/Variant.cpp @@ -951,7 +951,7 @@ bool Variant::operator==(const Variant& other) const case VariantType::Float: return Math::NearEqual(AsFloat, other.AsFloat); case VariantType::Double: - return Mathd::Abs(AsDouble - other.AsDouble) < ZeroTolerance; + return Math::Abs(AsDouble - other.AsDouble) < ZeroTolerance; case VariantType::Pointer: return AsPointer == other.AsPointer; case VariantType::String: @@ -1104,7 +1104,7 @@ Variant::operator bool() const case VariantType::Float: return !Math::IsZero(AsFloat); case VariantType::Double: - return !Mathd::IsZero(AsDouble); + return !Math::IsZero(AsDouble); case VariantType::Pointer: return AsPointer != nullptr; case VariantType::String: @@ -2851,7 +2851,7 @@ Variant Variant::Cast(const Variant& v, const VariantType& to) switch (to.Type) { case VariantType::Bool: - return Variant(Mathd::Abs(v.AsDouble) > ZeroTolerance); + return Variant(Math::Abs(v.AsDouble) > ZeroTolerance); case VariantType::Int16: return Variant((int16)v.AsDouble); case VariantType::Int: diff --git a/Source/Engine/Tools/ModelTool/ModelTool.OpenFBX.cpp b/Source/Engine/Tools/ModelTool/ModelTool.OpenFBX.cpp index dd1873bab..80dadd8c7 100644 --- a/Source/Engine/Tools/ModelTool/ModelTool.OpenFBX.cpp +++ b/Source/Engine/Tools/ModelTool/ModelTool.OpenFBX.cpp @@ -4,6 +4,7 @@ #include "ModelTool.h" #include "Engine/Core/Log.h" +#include "Engine/Core/Math/Mathd.h" #include "Engine/Core/Math/Matrix.h" #include "Engine/Core/Collections/Sorting.h" #include "Engine/Platform/FileSystem.h"