diff --git a/libs/mathlib/m4x4.c b/libs/mathlib/m4x4.c index 5dfdd10d..6f3e75ab 100644 --- a/libs/mathlib/m4x4.c +++ b/libs/mathlib/m4x4.c @@ -702,27 +702,31 @@ void m4_submat( m4x4_t mr, m3x3_t mb, int i, int j ){ idst = 0; for ( ti = 0; ti < 4; ti++ ) { + if ( ti == i ) { + continue; + } if ( ti < i ) { idst = ti; } else - if ( ti > i ) { + { idst = ti - 1; } for ( tj = 0; tj < 4; tj++ ) { + if ( tj == j ) { + continue; + } if ( tj < j ) { jdst = tj; } else - if ( tj > j ) { + { jdst = tj - 1; } - if ( ti != i && tj != j ) { - mb[idst * 3 + jdst] = mr[ti * 4 + tj ]; - } + mb[idst * 3 + jdst] = mr[ti * 4 + tj ]; } } } diff --git a/libs/splines/math_matrix.h b/libs/splines/math_matrix.h index 41216ee0..a6dabb89 100644 --- a/libs/splines/math_matrix.h +++ b/libs/splines/math_matrix.h @@ -84,7 +84,11 @@ ID_INLINE mat3_t::mat3_t() { } ID_INLINE mat3_t::mat3_t( float src[ 3 ][ 3 ] ) { - memcpy( mat, src, sizeof( src ) ); + for( unsigned int i = 0; i < 3; i++ ) { + mat[i].x = src[i][0]; + mat[i].y = src[i][1]; + mat[i].z = src[i][2]; + } } ID_INLINE mat3_t::mat3_t( idVec3 const &x, idVec3 const &y, idVec3 const &z ) {