From af41821541b30b29955bd2f1521b11d6b1f407e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20H=C3=B6hne?= Date: Sun, 4 May 2025 21:26:24 +0200 Subject: [PATCH] chore: Replacing typedef with using. --- Engine/Source/Runtime/Core/Math/MathFwd.h | 307 ++++++++++++---------- 1 file changed, 172 insertions(+), 135 deletions(-) diff --git a/Engine/Source/Runtime/Core/Math/MathFwd.h b/Engine/Source/Runtime/Core/Math/MathFwd.h index a28b582..5e3567c 100644 --- a/Engine/Source/Runtime/Core/Math/MathFwd.h +++ b/Engine/Source/Runtime/Core/Math/MathFwd.h @@ -1,201 +1,238 @@ #pragma once #ifdef P_BUILD_LIB - #include "PhanesEnginePCH.h" -#else - #include +# include "PhanesEnginePCH.h" +#else +# include #endif #ifndef MATH_FWD_H -#define MATH_FWD_H +# define MATH_FWD_H -#include "Core/Math/Boilerplate.h" -#include "Core/Math/SIMD/PhanesSIMDTypes.h" +# include "Core/Math/Boilerplate.h" +# include "Core/Math/SIMD/PhanesSIMDTypes.h" /** - * Includes forward declarations, as well as certain useful typedefs. + * Includes forward declarations, as well as certain useful usings. * * @ref OSAL/PlatformTypes.h */ +namespace Phanes::Core::Math +{ -namespace Phanes::Core::Math { - - /** + /** * Template forward declarations. */ - template struct TColor; - template struct TLinearColor; - template struct TLine; - template struct TQuaternion; - template struct TTransform; - template struct TPoint2; - template struct TPoint3; - template struct TPoint4; - template struct TIntPoint2; - template struct TIntPoint3; - template struct TIntPoint4; - template struct TMatrix2; - template struct TMatrix3; - template struct TMatrix4; - template struct TVector2; - template struct TVector3; - template struct TVector4; - template struct TIntVector2; - template struct TIntVector3; - template struct TIntVector4; - template struct TPlane; - template struct TRay; + template + struct TColor; - /** + template + struct TLinearColor; + + template + struct TLine; + + template + struct TTransform; + + template + struct TPoint2; + + template + struct TPoint3; + + template + struct TPoint4; + + template + struct TIntPoint2; + + template + struct TIntPoint3; + + template + struct TIntPoint4; + + template + struct TMatrix2; + + template + struct TQuaternion; + + template + struct TMatrix3; + + template + struct TMatrix4; + + template + struct TVector2; + + template + struct TVector3; + + template + struct TVector4; + + template + struct TIntVector2; + + template + struct TIntVector3; + + template + struct TIntVector4; + + template + struct TPlane; + + template + struct TRay; + + /** * Specific instantiation of forward declarations. */ - // TPoint2 + // TPoint2 - typedef TPoint2 Point2; - typedef TPoint2 Point2f; - typedef TPoint2 Point2d; + using Point2 = TPoint2; + using Point2f = TPoint2; + using Point2d = TPoint2; - // TPoint3 + // TPoint3 - typedef TPoint3 Point3; - typedef TPoint3 Point3f; - typedef TPoint3 Point3d; + using Point3 = TPoint3; + using Point3f = TPoint3; + using Point3d = TPoint3; - // TPoint4 + // TPoint4 - typedef TPoint4 Point4; - typedef TPoint4 Point4f; - typedef TPoint4 Point4d; + using Point4 = TPoint4; + using Point4f = TPoint4; + using Point4d = TPoint4; + // TIntPoint2 - // TIntPoint2 + using IntPoint2 = TIntPoint2; + using IntPoint2i = TIntPoint2; + using IntPoint2l = TIntPoint2; - typedef TIntPoint2 IntPoint2; - typedef TIntPoint2 IntPoint2i; - typedef TIntPoint2 IntPoint2l; + // TIntPoint3 - // TIntPoint3 + using IntPoint3 = TIntPoint3; + using IntPoint3i = TIntPoint3; + using IntPoint3l = TIntPoint3; - typedef TIntPoint3 IntPoint3; - typedef TIntPoint3 IntPoint3i; - typedef TIntPoint3 IntPoint3l; + // TIntPoint4 - // TIntPoint4 + using IntPoint4 = TIntPoint4; + using IntPoint4i = TIntPoint4; + using IntPoint4l = TIntPoint4; - typedef TIntPoint4 IntPoint4; - typedef TIntPoint4 IntPoint4i; - typedef TIntPoint4 IntPoint4l; + // IntVetor2 - // IntVetor2 + using IntVector2 = TIntVector2; + using Vector2i = TIntVector2; + using LongVector2 = TIntVector2; + using Vector2l = TIntVector2; - typedef TIntVector2 IntVector2; - typedef TIntVector2 Vector2i; - typedef TIntVector2 LongVector2; - typedef TIntVector2 Vector2l; + // IntVetor3 - // IntVetor3 + using IntVector3 = TIntVector3; + using Vector3i = TIntVector3; + using LongVector3 = TIntVector3; + using Vector3l = TIntVector3; - typedef TIntVector3 IntVector3; - typedef TIntVector3 Vector3i; - typedef TIntVector3 LongVector3; - typedef TIntVector3 Vector3l; + // IntVetor4 + using IntVector4 = TIntVector4; + using Vector4i = TIntVector4; + using LongVector4 = TIntVector4; + using Vector4l = TIntVector4; - // IntVetor4 + // Vector2 - typedef TIntVector4 IntVector4; - typedef TIntVector4 Vector4i; - typedef TIntVector4 LongVector4; - typedef TIntVector4 Vector4l; + using Vector2 = TVector2; + using Vector2f = TVector2; + using Vector2d = TVector2; - // Vector2 + using Vector2Regf64 = TVector2::value>; + using Vector2Reg = TVector2::value>; + using Vector2Regd = TVector2::value>; - typedef TVector2 Vector2; - typedef TVector2 Vector2f; - typedef TVector2 Vector2d; + // Vector3 - typedef TVector2::value> Vector2Regf64; - typedef TVector2::value> Vector2Reg; - typedef TVector2::value> Vector2Regd; + using Vector3 = TVector3; + using Vector3f = TVector3; + using Vector3d = TVector3; + using Vector3Reg = TVector3::value>; + using Vector3Regf32 = TVector3::value>; + using Vector3Regd = TVector3::value>; + using Vector3Regf64 = TVector3::value>; - // Vector3 + // Vector4 - typedef TVector3 Vector3; - typedef TVector3 Vector3f; - typedef TVector3 Vector3d; + using Vector4 = TVector4; + using Vector4f = TVector4; + using Vector4d = TVector4; - typedef TVector3::value> Vector3Reg; - typedef TVector3::value> Vector3Regf32; - typedef TVector3::value> Vector3Regd; - typedef TVector3::value> Vector3Regf64; + using Vector4Reg = TVector4::value>; + using Vector4Regf32 = TVector4::value>; + using Vector4Regd = TVector4::value>; + using Vector4Regf64 = TVector4::value>; + // Matrix2 - // Vector4 + using Matrix2 = TMatrix2; + using Matrix2f = TMatrix2; + using Matrix2d = TMatrix2; - typedef TVector4 Vector4; - typedef TVector4 Vector4f; - typedef TVector4 Vector4d; + // Matrix3 - typedef TVector4::value> Vector4Reg; - typedef TVector4::value> Vector4Regf32; - typedef TVector4::value> Vector4Regd; - typedef TVector4::value> Vector4Regf64; - - // Matrix2 - - typedef TMatrix2 Matrix2; - typedef TMatrix2 Matrix2f; - typedef TMatrix2 Matrix2d; + using Matrix3 = TMatrix3; + using Matrix3f = TMatrix3; + using Matrix3d = TMatrix3; - // Matrix3 + using Matrix3Reg = TMatrix3::value>; + using Matrix3Regf = TMatrix3::value>; + using Matrix3Regd = TMatrix3::value>; + using Matrix3Regf64 = TMatrix3::value>; - typedef TMatrix3 Matrix3; - typedef TMatrix3 Matrix3f; - typedef TMatrix3 Matrix3d; + // Matrix4 - typedef TMatrix3::value> Matrix3Reg; - typedef TMatrix3::value> Matrix3Regf; - typedef TMatrix3::value> Matrix3Regd; - typedef TMatrix3::value> Matrix3Regf64; + using Matrix4 = TMatrix4; + using Matrix4f = TMatrix4; + using Matrix4d = TMatrix4; - // Matrix4 + using Matrix4Reg = TMatrix3::value>; + using Matrix4Regf = TMatrix3::value>; + using Matrix4Regd = TMatrix3::value>; + using Matrix4Regf64 = TMatrix3::value>; - typedef TMatrix4 Matrix4; - typedef TMatrix4 Matrix4f; - typedef TMatrix4 Matrix4d; + // TPlane - typedef TMatrix3::value> Matrix4Reg; - typedef TMatrix3::value> Matrix4Regf; - typedef TMatrix3::value> Matrix4Regd; - typedef TMatrix3::value> Matrix4Regf64; + using Plane = TPlane; + using Planef = TPlane; + using Planed = TPlane; + using PlaneReg = TPlane::value>; + using PlaneRegd = TPlane::value>; - - // TPlane - - typedef TPlane Plane; - typedef TPlane Planef; - typedef TPlane Planed; - - typedef TPlane::value> PlaneReg; - typedef TPlane::value> PlaneRegd; - - -} // Phanes::Core::Math::coretypes +} // namespace Phanes::Core::Math namespace Phanes::Core::Math::Internal { - // Internal types + // Internal types - template struct AVector; + template + struct AVector; - template struct AMatrix; -} + template + struct AMatrix; +} // namespace Phanes::Core::Math::Internal - -#endif // !MATH_FWD_H \ No newline at end of file +#endif // !MATH_FWD_H