matrix: init flags before tmp _translate in _look_at

In cogl_matrix_look_at we have a tmp CoglMatrix allocated on the stack
but we weren't initializing its flags before passing it to
cogl_matrix_translate which meant if we were using COGL_DEBUG=matrices
we would end up trying to print out an invalid matrix type resulting in
a crash when overrunning an array of type names.

Reviewed-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Robert Bragg 2011-10-17 10:00:13 +01:00
parent 79719347c8
commit a054b53891

View File

@ -2107,9 +2107,9 @@ cogl_matrix_look_at (CoglMatrix *matrix,
tmp.zw = 0;
tmp.ww = 1;
cogl_matrix_translate (&tmp, -eye_position_x, -eye_position_y, -eye_position_z);
tmp.flags = (MAT_FLAG_GENERAL_3D | MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE);
cogl_matrix_translate (&tmp, -eye_position_x, -eye_position_y, -eye_position_z);
cogl_matrix_multiply (matrix, matrix, &tmp);
}