From 3b440254daad157bf1cecead6adc93f73a56d3d5 Mon Sep 17 00:00:00 2001 From: Lynix Date: Tue, 26 May 2020 15:58:15 +0200 Subject: [PATCH] Math/Vector[I]: Set method: Replace array by pointer --- include/Nazara/Math/Vector2.hpp | 2 +- include/Nazara/Math/Vector2.inl | 3 +-- include/Nazara/Math/Vector3.hpp | 2 +- include/Nazara/Math/Vector3.inl | 2 +- include/Nazara/Math/Vector4.hpp | 2 +- include/Nazara/Math/Vector4.inl | 3 +-- 6 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/Nazara/Math/Vector2.hpp b/include/Nazara/Math/Vector2.hpp index c9dba6bfa..72c72da4c 100644 --- a/include/Nazara/Math/Vector2.hpp +++ b/include/Nazara/Math/Vector2.hpp @@ -54,7 +54,7 @@ namespace Nz Vector2& Set(T X, T Y); Vector2& Set(T scale); - Vector2& Set(const T vec[2]); + Vector2& Set(const T* vec); Vector2& Set(const Vector3& vec); Vector2& Set(const Vector4& vec); template Vector2& Set(const Vector2& vec); diff --git a/include/Nazara/Math/Vector2.inl b/include/Nazara/Math/Vector2.inl index e22e00bc2..7d2754955 100644 --- a/include/Nazara/Math/Vector2.inl +++ b/include/Nazara/Math/Vector2.inl @@ -363,9 +363,8 @@ namespace Nz * * \param vec[2] vec[0] is X component and vec[1] is Y component */ - template - Vector2& Vector2::Set(const T vec[2]) + Vector2& Vector2::Set(const T* vec) { x = vec[0]; y = vec[1]; diff --git a/include/Nazara/Math/Vector3.hpp b/include/Nazara/Math/Vector3.hpp index 99e3696df..1603f7d34 100644 --- a/include/Nazara/Math/Vector3.hpp +++ b/include/Nazara/Math/Vector3.hpp @@ -65,7 +65,7 @@ namespace Nz Vector3& Set(T X, T Y, T Z); Vector3& Set(T X, const Vector2& vec); Vector3& Set(T scale); - Vector3& Set(const T vec[3]); + Vector3& Set(const T* vec); Vector3& Set(const Vector2& vec, T Z = 0.0); template Vector3& Set(const Vector3& vec); Vector3& Set(const Vector4& vec); diff --git a/include/Nazara/Math/Vector3.inl b/include/Nazara/Math/Vector3.inl index 1dcf48fe7..a9602a248 100644 --- a/include/Nazara/Math/Vector3.inl +++ b/include/Nazara/Math/Vector3.inl @@ -498,7 +498,7 @@ namespace Nz * \param vec[3] vec[0] is X component, vec[1] is Y component and vec[2] is Z component */ template - Vector3& Vector3::Set(const T vec[3]) + Vector3& Vector3::Set(const T* vec) { x = vec[0]; y = vec[1]; diff --git a/include/Nazara/Math/Vector4.hpp b/include/Nazara/Math/Vector4.hpp index 2938df3bb..24893ee65 100644 --- a/include/Nazara/Math/Vector4.hpp +++ b/include/Nazara/Math/Vector4.hpp @@ -54,7 +54,7 @@ namespace Nz Vector4& Set(T X, const Vector2& vec, T W); Vector4& Set(T X, const Vector3& vec); Vector4& Set(T scale); - Vector4& Set(const T vec[4]); + Vector4& Set(const T* vec); Vector4& Set(const Vector2& vec, T Z = 0.0, T W = 1.0); Vector4& Set(const Vector3& vec, T W = 1.0); template Vector4& Set(const Vector4& vec); diff --git a/include/Nazara/Math/Vector4.inl b/include/Nazara/Math/Vector4.inl index 6deadf5f5..93003da9b 100644 --- a/include/Nazara/Math/Vector4.inl +++ b/include/Nazara/Math/Vector4.inl @@ -413,9 +413,8 @@ namespace Nz * * \param vec[4] vec[0] is X component, vec[1] is Y component, vec[2] is Z component and vec[3] is W component */ - template - Vector4& Vector4::Set(const T vec[4]) + Vector4& Vector4::Set(const T* vec) { x = vec[0]; y = vec[1];