Skip to content

Commit 78c7a2f

Browse files
committed
Use Matrix initializer list
1 parent 63b3beb commit 78c7a2f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

include/Matrix.hpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ namespace raylib {
1515
*/
1616
class Matrix : public ::Matrix {
1717
public:
18-
Matrix(const ::Matrix& mat) {
19-
set(mat);
18+
Matrix(const ::Matrix& mat) : ::Matrix{
19+
mat.m0, mat.m4, mat.m8, mat.m12,
20+
mat.m1, mat.m5, mat.m9, mat.m13,
21+
mat.m2, mat.m6, mat.m10, mat.m14,
22+
mat.m3, mat.m7, mat.m11, mat.m15} {
23+
// Nothing.
2024
}
2125

2226
Matrix(
@@ -28,7 +32,9 @@ class Matrix : public ::Matrix {
2832
m0, m4, m8, m12,
2933
m1, m5, m9, m13,
3034
m2, m6, m10, m14,
31-
m3, m7, m11, m15} {}
35+
m3, m7, m11, m15} {
36+
// Nothing.
37+
}
3238

3339
GETTERSETTER(float, M0, m0)
3440
GETTERSETTER(float, M1, m1)

0 commit comments

Comments
 (0)