aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic
diff options
context:
space:
mode:
authorDavid Fioramonti2017-09-01 16:25:35 -0700
committerDavid Fioramonti2017-09-02 06:39:57 -0700
commit8ab7ececbaa78a34ace07dade864b24d91669e20 (patch)
tree98f31438208993607ed1f94debfeb080da714b69 /engines/titanic
parentf01115f450861be6b251a472f0d9074aa39e62c7 (diff)
downloadscummvm-rg350-8ab7ececbaa78a34ace07dade864b24d91669e20.tar.gz
scummvm-rg350-8ab7ececbaa78a34ace07dade864b24d91669e20.tar.bz2
scummvm-rg350-8ab7ececbaa78a34ace07dade864b24d91669e20.zip
TITANIC: Templatize matrix_inv
This allows DAffine and FPose to use a double version and a float version of matrix4Inv.
Diffstat (limited to 'engines/titanic')
-rw-r--r--engines/titanic/star_control/matrix_inv.h9
1 files changed, 5 insertions, 4 deletions
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 <typename T>
+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] -