From 8ab7ececbaa78a34ace07dade864b24d91669e20 Mon Sep 17 00:00:00 2001 From: David Fioramonti Date: Fri, 1 Sep 2017 16:25:35 -0700 Subject: TITANIC: Templatize matrix_inv This allows DAffine and FPose to use a double version and a float version of matrix4Inv. --- engines/titanic/star_control/matrix_inv.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'engines/titanic') diff --git a/engines/titanic/star_control/matrix_inv.h b/engines/titanic/star_control/matrix_inv.h index 21eb1d3a6f..642c414717 100644 --- a/engines/titanic/star_control/matrix_inv.h +++ b/engines/titanic/star_control/matrix_inv.h @@ -52,11 +52,12 @@ namespace Titanic { // 4x4 Matrix m is column major, e.x., m[3] is the row 4 column 1 element // Modified version of MESA 3D library function (MIT license) -bool matrix4Inverse(const double m[16], double invOut[16]) +template +bool matrix4Inverse(const T m[16], T invOut[16]) { - double temp_inv[16]; - double determinant; - double determinant_inv; + T temp_inv[16]; + T determinant; + T determinant_inv; int i; temp_inv[0] = m[5] * m[10] * m[15] - -- cgit v1.2.3