From 535d87ca41c2667766ca137d530a34125959b74f Mon Sep 17 00:00:00 2001
From: divverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Date: Tue, 3 Mar 2009 09:05:48 +0000
Subject: [PATCH] bring back the stupid Matrix4x4_Invert call as it breaks on
 my gcc in release builds (but is fine in debug builds).

Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu11' --with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3 --program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11)


git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8773 d7cf8633-e32d-0410-b094-e92efae38249
---
 clvm_cmds.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/clvm_cmds.c b/clvm_cmds.c
index 6642e533..7849ffe2 100644
--- a/clvm_cmds.c
+++ b/clvm_cmds.c
@@ -942,10 +942,12 @@ static void VM_CL_project (void)
 {
 	float	*f;
 	vec3_t	v;
+	matrix4x4_t m;
 
 	VM_SAFEPARMCOUNT(1, VM_CL_project);
 	f = PRVM_G_VECTOR(OFS_PARM0);
-	Matrix4x4_Transform(&r_refdef.view.inverse_matrix, f, v);
+	Matrix4x4_Invert_Simple(&m, &r_refdef.view.matrix);
+	Matrix4x4_Transform(&m, f, v);
 	if(v_flipped.integer)
 		v[1] = -v[1];
 	VectorSet(PRVM_G_VECTOR(OFS_RETURN), r_refdef.view.x + r_refdef.view.width*0.5*(1.0+v[1]/v[0]/-r_refdef.view.frustum_x), r_refdef.view.y + r_refdef.view.height*0.5*(1.0+v[2]/v[0]/-r_refdef.view.frustum_y), v[0]);
-- 
2.39.5