From 78c7a2fd3cef5a87eaf8fef648cb7ce60b30737f Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Tue, 27 Sep 2022 17:13:34 -0400 Subject: [PATCH] Use Matrix initializer list --- include/Matrix.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/Matrix.hpp b/include/Matrix.hpp index 5bcff80..6657862 100644 --- a/include/Matrix.hpp +++ b/include/Matrix.hpp @@ -15,8 +15,12 @@ namespace raylib { */ class Matrix : public ::Matrix { public: - Matrix(const ::Matrix& mat) { - set(mat); + Matrix(const ::Matrix& mat) : ::Matrix{ + mat.m0, mat.m4, mat.m8, mat.m12, + mat.m1, mat.m5, mat.m9, mat.m13, + mat.m2, mat.m6, mat.m10, mat.m14, + mat.m3, mat.m7, mat.m11, mat.m15} { + // Nothing. } Matrix( @@ -28,7 +32,9 @@ class Matrix : public ::Matrix { m0, m4, m8, m12, m1, m5, m9, m13, m2, m6, m10, m14, - m3, m7, m11, m15} {} + m3, m7, m11, m15} { + // Nothing. + } GETTERSETTER(float, M0, m0) GETTERSETTER(float, M1, m1)