From 55bdf1bafcbe11965b60d505d335f95129405822 Mon Sep 17 00:00:00 2001 From: havoc Date: Mon, 8 Jul 2002 02:57:02 +0000 Subject: [PATCH] some whitespace cleanups and a correction of a comment git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2018 d7cf8633-e32d-0410-b094-e92efae38249 --- mathlib.c | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/mathlib.c b/mathlib.c index 80c09fa1..7846af91 100644 --- a/mathlib.c +++ b/mathlib.c @@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "quakedef.h" -void Sys_Error (char *error, ...); - vec3_t vec3_origin = {0,0,0}; float ixtable[4096]; @@ -47,7 +45,7 @@ float m_bytenormals[NUMVERTEXNORMALS][3] = {-0.500000, 0.809017, -0.309017}, {-0.525731, 0.850651, 0.000000}, {0.000000, 0.850651, -0.525731}, {-0.238856, 0.864188, -0.442863}, {0.000000, 0.955423, -0.295242}, {-0.262866, 0.951056, -0.162460}, -{0.000000, 1.000000, 0.000000}, {0.000000, 0.955423, 0.295242}, +{0.000000, 1.000000, 0.000000}, {0.000000, 0.955423, 0.295242}, {-0.262866, 0.951056, 0.162460}, {0.238856, 0.864188, 0.442863}, {0.262866, 0.951056, 0.162460}, {0.500000, 0.809017, 0.309017}, {0.238856, 0.864188, -0.442863}, {0.262866, 0.951056, -0.162460}, @@ -55,7 +53,7 @@ float m_bytenormals[NUMVERTEXNORMALS][3] = {0.716567, 0.681718, 0.147621}, {0.716567, 0.681718, -0.147621}, {0.525731, 0.850651, 0.000000}, {0.425325, 0.688191, 0.587785}, {0.864188, 0.442863, 0.238856}, {0.688191, 0.587785, 0.425325}, -{0.809017, 0.309017, 0.500000}, {0.681718, 0.147621, 0.716567}, +{0.809017, 0.309017, 0.500000}, {0.681718, 0.147621, 0.716567}, {0.587785, 0.425325, 0.688191}, {0.955423, 0.295242, 0.000000}, {1.000000, 0.000000, 0.000000}, {0.951056, 0.162460, 0.262866}, {0.850651, -0.525731, 0.000000}, {0.955423, -0.295242, 0.000000}, @@ -70,8 +68,8 @@ float m_bytenormals[NUMVERTEXNORMALS][3] = {0.309017, 0.500000, -0.809017}, {0.425325, 0.688191, -0.587785}, {0.442863, 0.238856, -0.864188}, {0.587785, 0.425325, -0.688191}, {0.688191, 0.587785, -0.425325}, {-0.147621, 0.716567, -0.681718}, -{-0.309017, 0.500000, -0.809017}, {0.000000, 0.525731, -0.850651}, -{-0.525731, 0.000000, -0.850651}, {-0.442863, 0.238856, -0.864188}, +{-0.309017, 0.500000, -0.809017}, {0.000000, 0.525731, -0.850651}, +{-0.525731, 0.000000, -0.850651}, {-0.442863, 0.238856, -0.864188}, {-0.295242, 0.000000, -0.955423}, {-0.162460, 0.262866, -0.951056}, {0.000000, 0.000000, -1.000000}, {0.295242, 0.000000, -0.955423}, {0.162460, 0.262866, -0.951056}, {-0.442863, -0.238856, -0.864188}, @@ -94,24 +92,24 @@ float m_bytenormals[NUMVERTEXNORMALS][3] = {-0.500000, -0.809017, 0.309017}, {-0.238856, -0.864188, 0.442863}, {-0.262866, -0.951056, 0.162460}, {-0.864188, -0.442863, 0.238856}, {-0.809017, -0.309017, 0.500000}, {-0.688191, -0.587785, 0.425325}, -{-0.681718, -0.147621, 0.716567}, {-0.442863, -0.238856, 0.864188}, -{-0.587785, -0.425325, 0.688191}, {-0.309017, -0.500000, 0.809017}, -{-0.147621, -0.716567, 0.681718}, {-0.425325, -0.688191, 0.587785}, -{-0.162460, -0.262866, 0.951056}, {0.442863, -0.238856, 0.864188}, -{0.162460, -0.262866, 0.951056}, {0.309017, -0.500000, 0.809017}, -{0.147621, -0.716567, 0.681718}, {0.000000, -0.525731, 0.850651}, -{0.425325, -0.688191, 0.587785}, {0.587785, -0.425325, 0.688191}, -{0.688191, -0.587785, 0.425325}, {-0.955423, 0.295242, 0.000000}, -{-0.951056, 0.162460, 0.262866}, {-1.000000, 0.000000, 0.000000}, -{-0.850651, 0.000000, 0.525731}, {-0.955423, -0.295242, 0.000000}, -{-0.951056, -0.162460, 0.262866}, {-0.864188, 0.442863, -0.238856}, -{-0.951056, 0.162460, -0.262866}, {-0.809017, 0.309017, -0.500000}, +{-0.681718, -0.147621, 0.716567}, {-0.442863, -0.238856, 0.864188}, +{-0.587785, -0.425325, 0.688191}, {-0.309017, -0.500000, 0.809017}, +{-0.147621, -0.716567, 0.681718}, {-0.425325, -0.688191, 0.587785}, +{-0.162460, -0.262866, 0.951056}, {0.442863, -0.238856, 0.864188}, +{0.162460, -0.262866, 0.951056}, {0.309017, -0.500000, 0.809017}, +{0.147621, -0.716567, 0.681718}, {0.000000, -0.525731, 0.850651}, +{0.425325, -0.688191, 0.587785}, {0.587785, -0.425325, 0.688191}, +{0.688191, -0.587785, 0.425325}, {-0.955423, 0.295242, 0.000000}, +{-0.951056, 0.162460, 0.262866}, {-1.000000, 0.000000, 0.000000}, +{-0.850651, 0.000000, 0.525731}, {-0.955423, -0.295242, 0.000000}, +{-0.951056, -0.162460, 0.262866}, {-0.864188, 0.442863, -0.238856}, +{-0.951056, 0.162460, -0.262866}, {-0.809017, 0.309017, -0.500000}, {-0.864188, -0.442863, -0.238856}, {-0.951056, -0.162460, -0.262866}, {-0.809017, -0.309017, -0.500000}, {-0.681718, 0.147621, -0.716567}, -{-0.681718, -0.147621, -0.716567}, {-0.850651, 0.000000, -0.525731}, -{-0.688191, 0.587785, -0.425325}, {-0.587785, 0.425325, -0.688191}, -{-0.425325, 0.688191, -0.587785}, {-0.425325, -0.688191, -0.587785}, -{-0.587785, -0.425325, -0.688191}, {-0.688191, -0.587785, -0.425325}, +{-0.681718, -0.147621, -0.716567}, {-0.850651, 0.000000, -0.525731}, +{-0.688191, 0.587785, -0.425325}, {-0.587785, 0.425325, -0.688191}, +{-0.425325, 0.688191, -0.587785}, {-0.425325, -0.688191, -0.587785}, +{-0.587785, -0.425325, -0.688191}, {-0.688191, -0.587785, -0.425325}, }; qbyte NormalToByte(const vec3_t n) @@ -158,7 +156,7 @@ float Q_RSqrt(float number) void PerpendicularVector( vec3_t dst, const vec3_t src ) { // LordHavoc: optimized to death and beyond - int pos; + int pos; float minelem; if (src[0]) @@ -241,9 +239,9 @@ void VectorVectorsDouble(const double *forward, double *right, double *up) void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point, float degrees ) { - float t0, t1; - float angle, c, s; - vec3_t vr, vu, vf; + float t0, t1; + float angle, c, s; + vec3_t vr, vu, vf; angle = DEG2RAD(degrees); @@ -466,13 +464,13 @@ void AngleMatrix (const vec3_t angles, const vec3_t translate, vec_t matrix[][4] } -// LordHavoc: renamed these to Length, and made the normal ones #define +// LordHavoc: renamed this to Length, and made the normal one a #define float VectorNormalizeLength (vec3_t v) { - float length, ilength; + float length, ilength; length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2]; - length = sqrt (length); // FIXME + length = sqrt (length); if (length) { @@ -494,15 +492,15 @@ R_ConcatRotations */ void R_ConcatRotations (const float in1[3*3], const float in2[3*3], float out[3*3]) { - out[0*3+ 0] = in1[0*3+0] * in2[0*3+0] + in1[0*3+1] * in2[1*3+0] + in1[0*3+2] * in2[2*3+0]; - out[0*3+ 1] = in1[0*3+0] * in2[0*3+1] + in1[0*3+1] * in2[1*3+1] + in1[0*3+2] * in2[2*3+1]; - out[0*3+ 2] = in1[0*3+0] * in2[0*3+2] + in1[0*3+1] * in2[1*3+2] + in1[0*3+2] * in2[2*3+2]; - out[1*3+ 0] = in1[1*3+0] * in2[0*3+0] + in1[1*3+1] * in2[1*3+0] + in1[1*3+2] * in2[2*3+0]; - out[1*3+ 1] = in1[1*3+0] * in2[0*3+1] + in1[1*3+1] * in2[1*3+1] + in1[1*3+2] * in2[2*3+1]; - out[1*3+ 2] = in1[1*3+0] * in2[0*3+2] + in1[1*3+1] * in2[1*3+2] + in1[1*3+2] * in2[2*3+2]; - out[2*3+ 0] = in1[2*3+0] * in2[0*3+0] + in1[2*3+1] * in2[1*3+0] + in1[2*3+2] * in2[2*3+0]; - out[2*3+ 1] = in1[2*3+0] * in2[0*3+1] + in1[2*3+1] * in2[1*3+1] + in1[2*3+2] * in2[2*3+1]; - out[2*3+ 2] = in1[2*3+0] * in2[0*3+2] + in1[2*3+1] * in2[1*3+2] + in1[2*3+2] * in2[2*3+2]; + out[0*3+0] = in1[0*3+0] * in2[0*3+0] + in1[0*3+1] * in2[1*3+0] + in1[0*3+2] * in2[2*3+0]; + out[0*3+1] = in1[0*3+0] * in2[0*3+1] + in1[0*3+1] * in2[1*3+1] + in1[0*3+2] * in2[2*3+1]; + out[0*3+2] = in1[0*3+0] * in2[0*3+2] + in1[0*3+1] * in2[1*3+2] + in1[0*3+2] * in2[2*3+2]; + out[1*3+0] = in1[1*3+0] * in2[0*3+0] + in1[1*3+1] * in2[1*3+0] + in1[1*3+2] * in2[2*3+0]; + out[1*3+1] = in1[1*3+0] * in2[0*3+1] + in1[1*3+1] * in2[1*3+1] + in1[1*3+2] * in2[2*3+1]; + out[1*3+2] = in1[1*3+0] * in2[0*3+2] + in1[1*3+1] * in2[1*3+2] + in1[1*3+2] * in2[2*3+2]; + out[2*3+0] = in1[2*3+0] * in2[0*3+0] + in1[2*3+1] * in2[1*3+0] + in1[2*3+2] * in2[2*3+0]; + out[2*3+1] = in1[2*3+0] * in2[0*3+1] + in1[2*3+1] * in2[1*3+1] + in1[2*3+2] * in2[2*3+1]; + out[2*3+2] = in1[2*3+0] * in2[0*3+2] + in1[2*3+1] * in2[1*3+2] + in1[2*3+2] * in2[2*3+2]; } -- 2.39.2