]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderer.cpp
Adapt to the new vector/matrix slicing API in mspmath
[libs/gl.git] / source / renderer.cpp
index bc49b0f802941f3ae2a7509ae86351dc51a67ca8..184d326928381722e5766eed46e030b572278771 100644 (file)
@@ -257,10 +257,7 @@ void Renderer::apply_state()
                        {
                                const Matrix &m = mtx_stack.top();
                                standard_shdata.uniform("eye_obj_matrix", mtx_stack.top());
-                               LinAl::SquareMatrix<float, 3> nm;
-                               for(unsigned i=0; i<3; ++i)
-                                       for(unsigned j=0; j<3; ++j)
-                                               nm(i, j) = m(i, j);
+                               LinAl::SquareMatrix<float, 3> nm = m.block<3, 3>(0, 0);
                                nm = transpose(invert(nm));
                                standard_shdata.uniform_matrix3("eye_obj_normal_matrix", &nm(0, 0));
                                changed &= ~MODERN_MATRIX;