From d2a55a1ee3a7334003e0d478a6f78a2ee07fad51 Mon Sep 17 00:00:00 2001 From: mogemimi Date: Sun, 28 Jan 2018 08:42:31 +0900 Subject: [PATCH] Replace std::array with raw arrays in matrices --- include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp | 3 +-- include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp | 3 +-- include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp | 3 +-- include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp | 9 +-------- src/Math/detail/FloatingPointMatrix2x2.cpp | 4 ++-- src/Math/detail/FloatingPointMatrix3x2.cpp | 4 ++-- src/Math/detail/FloatingPointMatrix3x3.cpp | 4 ++-- src/Math/detail/FloatingPointMatrix4x4.cpp | 4 ++-- 8 files changed, 12 insertions(+), 22 deletions(-) diff --git a/include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp b/include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp index 99a828069..4f190aef5 100644 --- a/include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp +++ b/include/Pomdog/Math/detail/FloatingPointMatrix2x2.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace Pomdog { namespace Detail { @@ -18,7 +17,7 @@ class POMDOG_EXPORT FloatingPointMatrix2x2 { static_assert(std::is_floating_point::value, "T is floating point."); typedef T value_type; - std::array, 2> m; + T m[2][2]; private: static constexpr std::size_t RowSize = 2; diff --git a/include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp b/include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp index 133625515..fa196fffa 100644 --- a/include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp +++ b/include/Pomdog/Math/detail/FloatingPointMatrix3x2.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace Pomdog { namespace Detail { @@ -18,7 +17,7 @@ class POMDOG_EXPORT FloatingPointMatrix3x2 { static_assert(std::is_floating_point::value, "T is floating point."); typedef T value_type; - std::array, 3> m; + T m[3][2]; private: static constexpr std::size_t RowSize = 3; diff --git a/include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp b/include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp index 7dc8a7c5d..d4c4ea3ae 100644 --- a/include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp +++ b/include/Pomdog/Math/detail/FloatingPointMatrix3x3.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace Pomdog { namespace Detail { @@ -18,7 +17,7 @@ class POMDOG_EXPORT FloatingPointMatrix3x3 { static_assert(std::is_floating_point::value, "T is floating point."); typedef T value_type; - std::array, 3> m; + T m[3][3]; private: static constexpr std::size_t RowSize = 3; diff --git a/include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp b/include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp index ea6502712..a366aa01a 100644 --- a/include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp +++ b/include/Pomdog/Math/detail/FloatingPointMatrix4x4.hpp @@ -7,7 +7,6 @@ #include #include #include -#include namespace Pomdog { namespace Detail { @@ -18,13 +17,7 @@ class POMDOG_EXPORT FloatingPointMatrix4x4 { static_assert(std::is_floating_point::value, "T is floating point."); typedef T value_type; - //union { - // std::array, 4> m; - //#if defined __i386__ || defined __x86_64__ - // std::array<__m128, 4> - //#endif - //}; - std::array, 4> m; + T m[4][4]; private: static constexpr std::size_t RowSize = 4; diff --git a/src/Math/detail/FloatingPointMatrix2x2.cpp b/src/Math/detail/FloatingPointMatrix2x2.cpp index 10aabb2da..543342c0e 100644 --- a/src/Math/detail/FloatingPointMatrix2x2.cpp +++ b/src/Math/detail/FloatingPointMatrix2x2.cpp @@ -191,14 +191,14 @@ template const T* FloatingPointMatrix2x2::Data() const noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template T* FloatingPointMatrix2x2::Data() noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template diff --git a/src/Math/detail/FloatingPointMatrix3x2.cpp b/src/Math/detail/FloatingPointMatrix3x2.cpp index 0d6b04345..33cf5c2cd 100644 --- a/src/Math/detail/FloatingPointMatrix3x2.cpp +++ b/src/Math/detail/FloatingPointMatrix3x2.cpp @@ -381,14 +381,14 @@ template const T* FloatingPointMatrix3x2::Data() const noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template T* FloatingPointMatrix3x2::Data() noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template diff --git a/src/Math/detail/FloatingPointMatrix3x3.cpp b/src/Math/detail/FloatingPointMatrix3x3.cpp index fa8a46ed5..a2a023265 100644 --- a/src/Math/detail/FloatingPointMatrix3x3.cpp +++ b/src/Math/detail/FloatingPointMatrix3x3.cpp @@ -626,14 +626,14 @@ template const T* FloatingPointMatrix3x3::Data() const noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template T* FloatingPointMatrix3x3::Data() noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template diff --git a/src/Math/detail/FloatingPointMatrix4x4.cpp b/src/Math/detail/FloatingPointMatrix4x4.cpp index a59277925..d8fc77167 100644 --- a/src/Math/detail/FloatingPointMatrix4x4.cpp +++ b/src/Math/detail/FloatingPointMatrix4x4.cpp @@ -1231,14 +1231,14 @@ template const T* FloatingPointMatrix4x4::Data() const noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template T* FloatingPointMatrix4x4::Data() noexcept { static_assert(std::is_floating_point::value, "T is floating point number"); - return m[0].data(); + return m[0]; } template