diff options
| author | zakk <zakk@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-08-27 18:11:08 +0000 | 
|---|---|---|
| committer | zakk <zakk@edf5b092-35ff-0310-97b2-ce42778d08ea> | 2005-08-27 18:11:08 +0000 | 
| commit | 64fab6d1e5c81852878cf6d13a778fea7d071430 (patch) | |
| tree | e210aaf925f8b576257a7c43f94db3969aad25c0 /code/qcommon/cm_trace.c | |
| parent | 3dbd5ffc8df0bb4a6dcee022f5c79ffe7875e26f (diff) | |
| download | ioquake3-aero-64fab6d1e5c81852878cf6d13a778fea7d071430.tar.gz ioquake3-aero-64fab6d1e5c81852878cf6d13a778fea7d071430.zip | |
From ludwig: This one fixes a rendering error
git-svn-id: svn://svn.icculus.org/quake3/trunk@12 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/cm_trace.c')
| -rwxr-xr-x | code/qcommon/cm_trace.c | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/code/qcommon/cm_trace.c b/code/qcommon/cm_trace.c index 6eb9931..eb9b14f 100755 --- a/code/qcommon/cm_trace.c +++ b/code/qcommon/cm_trace.c @@ -131,15 +131,17 @@ SquareRootFloat  ================  */  float SquareRootFloat(float number) { -	long i; +	union { +		float f; +		int i; +	} t;  	float x, y;  	const float f = 1.5F;  	x = number * 0.5F; -	y  = number; -	i  = * ( long * ) &y; -	i  = 0x5f3759df - ( i >> 1 ); -	y  = * ( float * ) &i; +	t.f  = number; +	t.i  = 0x5f3759df - ( t.i >> 1 ); +	y  = t.f;  	y  = y * ( f - ( x * y * y ) );  	y  = y * ( f - ( x * y * y ) );  	return number * y; | 
