diff options
author | Gareth Hughes <gareth@valinux.com> | 2001-03-12 00:48:37 +0000 |
---|---|---|
committer | Gareth Hughes <gareth@valinux.com> | 2001-03-12 00:48:37 +0000 |
commit | 22144ab7552f0799bcfca506bf4ffa7f70a06649 (patch) | |
tree | e7986aa02e97d88071b0769dc8d5359860320614 /src/mesa/math | |
parent | 57ffddba9870a0e602ae454e13072a0af48fa150 (diff) |
Consistent copyright info (version number, date) across all files.
Diffstat (limited to 'src/mesa/math')
-rw-r--r-- | src/mesa/math/m_clip_tmp.h | 42 | ||||
-rw-r--r-- | src/mesa/math/m_copy_tmp.h | 6 | ||||
-rw-r--r-- | src/mesa/math/m_debug.h | 4 | ||||
-rw-r--r-- | src/mesa/math/m_debug_norm.c | 6 | ||||
-rw-r--r-- | src/mesa/math/m_debug_util.h | 6 | ||||
-rw-r--r-- | src/mesa/math/m_debug_xform.c | 4 | ||||
-rw-r--r-- | src/mesa/math/m_dotprod_tmp.h | 42 | ||||
-rw-r--r-- | src/mesa/math/m_eval.c | 4 | ||||
-rw-r--r-- | src/mesa/math/m_eval.h | 25 | ||||
-rw-r--r-- | src/mesa/math/m_matrix.c | 172 | ||||
-rw-r--r-- | src/mesa/math/m_matrix.h | 28 | ||||
-rw-r--r-- | src/mesa/math/m_norm_tmp.h | 52 | ||||
-rw-r--r-- | src/mesa/math/m_trans_tmp.h | 20 | ||||
-rw-r--r-- | src/mesa/math/m_translate.c | 39 | ||||
-rw-r--r-- | src/mesa/math/m_translate.h | 10 | ||||
-rw-r--r-- | src/mesa/math/m_vector.c | 54 | ||||
-rw-r--r-- | src/mesa/math/m_vector.h | 48 | ||||
-rw-r--r-- | src/mesa/math/m_xform.c | 4 | ||||
-rw-r--r-- | src/mesa/math/m_xform.h | 46 | ||||
-rw-r--r-- | src/mesa/math/m_xform_tmp.h | 6 | ||||
-rw-r--r-- | src/mesa/math/mathmod.h | 26 |
21 files changed, 346 insertions, 298 deletions
diff --git a/src/mesa/math/m_clip_tmp.h b/src/mesa/math/m_clip_tmp.h index 9c97f97de0..5f27d82959 100644 --- a/src/mesa/math/m_clip_tmp.h +++ b/src/mesa/math/m_clip_tmp.h @@ -1,21 +1,21 @@ -/* $Id: m_clip_tmp.h,v 1.5 2001/03/03 20:57:00 brianp Exp $ */ +/* $Id: m_clip_tmp.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -35,10 +35,10 @@ * the case where the cliptest passes. This isn't essential, * and an asm implementation needn't replicate that behaviour. */ -static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, - GLvector4f *proj_vec, +static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, + GLvector4f *proj_vec, GLubyte clipMask[], - GLubyte *orMask, + GLubyte *orMask, GLubyte *andMask ) { const GLuint stride = clip_vec->stride; @@ -83,12 +83,12 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, vProj[i][2] = 0; vProj[i][3] = 1; } else { - GLfloat oow = 1.0F / cw; + GLfloat oow = 1.0F / cw; vProj[i][0] = cx * oow; vProj[i][1] = cy * oow; - vProj[i][2] = cz * oow; + vProj[i][2] = cz * oow; vProj[i][3] = oow; - } + } } *orMask = tmpOrMask; @@ -102,10 +102,10 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points4)( GLvector4f *clip_vec, -static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, - GLvector4f *proj_vec, +static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, + GLvector4f *proj_vec, GLubyte clipMask[], - GLubyte *orMask, + GLubyte *orMask, GLubyte *andMask ) { const GLuint stride = clip_vec->stride; @@ -144,7 +144,7 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, c++; tmpAndMask &= mask; tmpOrMask |= mask; - } + } } *orMask = tmpOrMask; @@ -153,10 +153,10 @@ static GLvector4f * _XFORMAPI TAG(cliptest_np_points4)( GLvector4f *clip_vec, } -static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, - GLvector4f *proj_vec, +static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, + GLvector4f *proj_vec, GLubyte clipMask[], - GLubyte *orMask, + GLubyte *orMask, GLubyte *andMask ) { const GLuint stride = clip_vec->stride; @@ -186,10 +186,10 @@ static GLvector4f * _XFORMAPI TAG(cliptest_points3)( GLvector4f *clip_vec, } -static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, - GLvector4f *proj_vec, +static GLvector4f * _XFORMAPI TAG(cliptest_points2)( GLvector4f *clip_vec, + GLvector4f *proj_vec, GLubyte clipMask[], - GLubyte *orMask, + GLubyte *orMask, GLubyte *andMask ) { const GLuint stride = clip_vec->stride; diff --git a/src/mesa/math/m_copy_tmp.h b/src/mesa/math/m_copy_tmp.h index 755536f3e2..609f5abdd8 100644 --- a/src/mesa/math/m_copy_tmp.h +++ b/src/mesa/math/m_copy_tmp.h @@ -1,10 +1,10 @@ -/* $Id: m_copy_tmp.h,v 1.3 2001/03/03 20:33:30 brianp Exp $ */ +/* $Id: m_copy_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.5 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/src/mesa/math/m_debug.h b/src/mesa/math/m_debug.h index b098aa0abc..8bb2a1976d 100644 --- a/src/mesa/math/m_debug.h +++ b/src/mesa/math/m_debug.h @@ -1,4 +1,4 @@ -/* $Id: m_debug.h,v 1.2 2001/02/05 19:17:31 brianp Exp $ */ +/* $Id: m_debug.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library @@ -23,7 +23,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * Author: + * Authors: * Gareth Hughes <gareth@valinux.com> */ diff --git a/src/mesa/math/m_debug_norm.c b/src/mesa/math/m_debug_norm.c index 9b7bafa7ca..a6f0cb76a7 100644 --- a/src/mesa/math/m_debug_norm.c +++ b/src/mesa/math/m_debug_norm.c @@ -1,10 +1,10 @@ -/* $Id: m_debug_norm.c,v 1.4 2001/03/08 15:23:46 brianp Exp $ */ +/* $Id: m_debug_norm.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -23,7 +23,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * Author: + * Authors: * Gareth Hughes <gareth@valinux.com> */ diff --git a/src/mesa/math/m_debug_util.h b/src/mesa/math/m_debug_util.h index e49f3615c7..79e369ebd5 100644 --- a/src/mesa/math/m_debug_util.h +++ b/src/mesa/math/m_debug_util.h @@ -1,10 +1,10 @@ -/* $Id: m_debug_util.h,v 1.1 2001/02/03 08:41:04 gareth Exp $ */ +/* $Id: m_debug_util.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -23,7 +23,7 @@ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * Author: + * Authors: * Gareth Hughes <gareth@valinux.com> */ diff --git a/src/mesa/math/m_debug_xform.c b/src/mesa/math/m_debug_xform.c index dc81705aca..9600bec804 100644 --- a/src/mesa/math/m_debug_xform.c +++ b/src/mesa/math/m_debug_xform.c @@ -1,10 +1,10 @@ -/* $Id: m_debug_xform.c,v 1.4 2001/03/08 15:23:46 brianp Exp $ */ +/* $Id: m_debug_xform.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/src/mesa/math/m_dotprod_tmp.h b/src/mesa/math/m_dotprod_tmp.h index 88a9b37fa5..232c5389ca 100644 --- a/src/mesa/math/m_dotprod_tmp.h +++ b/src/mesa/math/m_dotprod_tmp.h @@ -1,21 +1,21 @@ -/* $Id: m_dotprod_tmp.h,v 1.3 2001/03/03 20:57:00 brianp Exp $ */ +/* $Id: m_dotprod_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * + * Version: 3.5 + * + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -31,10 +31,10 @@ /* Note - respects the stride of the output vector. */ -static void TAG(dotprod_vec2)( GLfloat *out, +static void TAG(dotprod_vec2)( GLfloat *out, GLuint outstride, - const GLvector4f *coord_vec, - const GLfloat plane[4], + const GLvector4f *coord_vec, + const GLfloat plane[4], const GLubyte mask[]) { GLuint stride = coord_vec->stride; @@ -42,9 +42,9 @@ static void TAG(dotprod_vec2)( GLfloat *out, GLuint count = coord_vec->count; GLuint i; - + const GLfloat plane0 = plane[0], plane1 = plane[1], plane3 = plane[3]; - + (void) mask; for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(out,outstride)) { @@ -53,13 +53,13 @@ static void TAG(dotprod_vec2)( GLfloat *out, coord[1] * plane1 + plane3); } - } + } } -static void TAG(dotprod_vec3)( GLfloat *out, +static void TAG(dotprod_vec3)( GLfloat *out, GLuint outstride, - const GLvector4f *coord_vec, - const GLfloat plane[4], + const GLvector4f *coord_vec, + const GLfloat plane[4], const GLubyte mask[]) { GLuint stride = coord_vec->stride; @@ -80,13 +80,13 @@ static void TAG(dotprod_vec3)( GLfloat *out, coord[2] * plane2 + plane3); } - } + } } -static void TAG(dotprod_vec4)( GLfloat *out, +static void TAG(dotprod_vec4)( GLfloat *out, GLuint outstride, - const GLvector4f *coord_vec, - const GLfloat plane[4], + const GLvector4f *coord_vec, + const GLfloat plane[4], const GLubyte mask[]) { GLuint stride = coord_vec->stride; @@ -106,7 +106,7 @@ static void TAG(dotprod_vec4)( GLfloat *out, coord[2] * plane2 + coord[3] * plane3); } - } + } } diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c index 9316625d97..ded7247b3f 100644 --- a/src/mesa/math/m_eval.c +++ b/src/mesa/math/m_eval.c @@ -1,10 +1,10 @@ -/* $Id: m_eval.c,v 1.4 2001/03/08 17:17:28 brianp Exp $ */ +/* $Id: m_eval.c,v 1.5 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/src/mesa/math/m_eval.h b/src/mesa/math/m_eval.h index b478b39351..2553c96a67 100644 --- a/src/mesa/math/m_eval.h +++ b/src/mesa/math/m_eval.h @@ -1,3 +1,28 @@ +/* $Id: m_eval.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ #ifndef _M_EVAL_H #define _M_EVAL_H diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 8f8320f256..de002adb5d 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1,21 +1,21 @@ -/* $Id: m_matrix.c,v 1.7 2001/03/07 05:06:12 brianp Exp $ */ +/* $Id: m_matrix.c,v 1.8 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -66,13 +66,13 @@ static GLfloat Identity[16] = { /* - * This matmul was contributed by Thomas Malik + * This matmul was contributed by Thomas Malik * * Perform a 4x4 matrix multiplication (product = a x b). * Input: a, b - matrices to multiply * Output: product - product of a and b * WARNING: (product != b) assumed - * NOTE: (product == a) allowed + * NOTE: (product == a) allowed * * KW: 4*16 = 64 muls */ @@ -94,7 +94,7 @@ static void matmul4( GLfloat *product, const GLfloat *a, const GLfloat *b ) /* Multiply two matrices known to occupy only the top three rows, such - * as typical model matrices, and ortho matrices. + * as typical model matrices, and ortho matrices. */ static void matmul34( GLfloat *product, const GLfloat *a, const GLfloat *b ) { @@ -127,8 +127,8 @@ static void matrix_multf( GLmatrix *mat, const GLfloat *m, GLuint flags ) if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D)) matmul34( mat->m, mat->m, m ); - else - matmul4( mat->m, mat->m, m ); + else + matmul4( mat->m, mat->m, m ); } @@ -140,7 +140,7 @@ static void print_matrix_floats( const GLfloat m[16] ) } } -void +void _math_matrix_print( const GLmatrix *m ) { fprintf(stderr, "Matrix type: %s, flags: %x\n", types[m->type], m->flags); @@ -176,31 +176,31 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) GLfloat wtmp[4][8]; GLfloat m0, m1, m2, m3, s; GLfloat *r0, *r1, *r2, *r3; - + r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3]; - + r0[0] = MAT(m,0,0), r0[1] = MAT(m,0,1), r0[2] = MAT(m,0,2), r0[3] = MAT(m,0,3), r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0, - + r1[0] = MAT(m,1,0), r1[1] = MAT(m,1,1), r1[2] = MAT(m,1,2), r1[3] = MAT(m,1,3), r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0, - + r2[0] = MAT(m,2,0), r2[1] = MAT(m,2,1), r2[2] = MAT(m,2,2), r2[3] = MAT(m,2,3), r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0, - + r3[0] = MAT(m,3,0), r3[1] = MAT(m,3,1), r3[2] = MAT(m,3,2), r3[3] = MAT(m,3,3), r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0; - + /* choose pivot - or die */ if (fabs(r3[0])>fabs(r2[0])) SWAP_ROWS(r3, r2); if (fabs(r2[0])>fabs(r1[0])) SWAP_ROWS(r2, r1); if (fabs(r1[0])>fabs(r0[0])) SWAP_ROWS(r1, r0); if (0.0 == r0[0]) return GL_FALSE; - + /* eliminate first variable */ m1 = r1[0]/r0[0]; m2 = r2[0]/r0[0]; m3 = r3[0]/r0[0]; s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s; @@ -214,12 +214,12 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) if (s != 0.0) { r1[6] -= m1 * s; r2[6] -= m2 * s; r3[6] -= m3 * s; } s = r0[7]; if (s != 0.0) { r1[7] -= m1 * s; r2[7] -= m2 * s; r3[7] -= m3 * s; } - + /* choose pivot - or die */ if (fabs(r3[1])>fabs(r2[1])) SWAP_ROWS(r3, r2); if (fabs(r2[1])>fabs(r1[1])) SWAP_ROWS(r2, r1); if (0.0 == r1[1]) return GL_FALSE; - + /* eliminate second variable */ m2 = r2[1]/r1[1]; m3 = r3[1]/r1[1]; r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2]; @@ -228,23 +228,23 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) s = r1[5]; if (0.0 != s) { r2[5] -= m2 * s; r3[5] -= m3 * s; } s = r1[6]; if (0.0 != s) { r2[6] -= m2 * s; r3[6] -= m3 * s; } s = r1[7]; if (0.0 != s) { r2[7] -= m2 * s; r3[7] -= m3 * s; } - + /* choose pivot - or die */ if (fabs(r3[2])>fabs(r2[2])) SWAP_ROWS(r3, r2); if (0.0 == r2[2]) return GL_FALSE; - + /* eliminate third variable */ m3 = r3[2]/r2[2]; r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4], r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6], r3[7] -= m3 * r2[7]; - + /* last check */ if (0.0 == r3[3]) return GL_FALSE; - + s = 1.0/r3[3]; /* now back substitute row 3 */ r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s; - + m2 = r2[3]; /* now back substitute row 2 */ s = 1.0/r2[2]; r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2), @@ -255,7 +255,7 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) m0 = r0[3]; r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0, r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0; - + m1 = r1[2]; /* now back substitute row 1 */ s = 1.0/r1[1]; r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1), @@ -263,12 +263,12 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) m0 = r0[2]; r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0, r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0; - + m0 = r0[1]; /* now back substitute row 0 */ s = 1.0/r0[0]; r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0), r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0); - + MAT(out,0,0) = r0[4]; MAT(out,0,1) = r0[5], MAT(out,0,2) = r0[6]; MAT(out,0,3) = r0[7], MAT(out,1,0) = r1[4]; MAT(out,1,1) = r1[5], @@ -276,15 +276,15 @@ static GLboolean invert_matrix_general( GLmatrix *mat ) MAT(out,2,0) = r2[4]; MAT(out,2,1) = r2[5], MAT(out,2,2) = r2[6]; MAT(out,2,3) = r2[7], MAT(out,3,0) = r3[4]; MAT(out,3,1) = r3[5], - MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7]; - + MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7]; + return GL_TRUE; } #undef SWAP_ROWS /* Adapted from graphics gems II. - */ + */ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) { const GLfloat *in = mat->m; @@ -293,7 +293,7 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) GLfloat det; /* Calculate the determinant of upper left 3x3 submatrix and - * determine if the matrix is singular. + * determine if the matrix is singular. */ pos = neg = 0.0; t = MAT(in,0,0) * MAT(in,1,1) * MAT(in,2,2); @@ -316,9 +316,9 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) det = pos + neg; - if (det*det < 1e-25) + if (det*det < 1e-25) return GL_FALSE; - + det = 1.0 / det; MAT(out,0,0) = ( (MAT(in,1,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,1,2) )*det); MAT(out,0,1) = (- (MAT(in,0,1)*MAT(in,2,2) - MAT(in,2,1)*MAT(in,0,2) )*det); @@ -340,7 +340,7 @@ static GLboolean invert_matrix_3d_general( GLmatrix *mat ) MAT(out,2,3) = - (MAT(in,0,3) * MAT(out,2,0) + MAT(in,1,3) * MAT(out,2,1) + MAT(in,2,3) * MAT(out,2,2) ); - + return GL_TRUE; } @@ -353,13 +353,13 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) if (!TEST_MAT_FLAGS(mat, MAT_FLAGS_ANGLE_PRESERVING)) { return invert_matrix_3d_general( mat ); } - + if (mat->flags & MAT_FLAG_UNIFORM_SCALE) { GLfloat scale = (MAT(in,0,0) * MAT(in,0,0) + MAT(in,0,1) * MAT(in,0,1) + MAT(in,0,2) * MAT(in,0,2)); - if (scale == 0.0) + if (scale == 0.0) return GL_FALSE; scale = 1.0 / scale; @@ -395,7 +395,7 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) MAT(out,2,3) = - MAT(in,2,3); return GL_TRUE; } - + if (mat->flags & MAT_FLAG_TRANSLATION) { /* Do the translation part */ MAT(out,0,3) = - (MAT(in,0,3) * MAT(out,0,0) + @@ -411,11 +411,11 @@ static GLboolean invert_matrix_3d( GLmatrix *mat ) else { MAT(out,0,3) = MAT(out,1,3) = MAT(out,2,3) = 0.0; } - + return GL_TRUE; } - + static GLboolean invert_matrix_identity( GLmatrix *mat ) { @@ -429,9 +429,9 @@ static GLboolean invert_matrix_3d_no_rot( GLmatrix *mat ) const GLfloat *in = mat->m; GLfloat *out = mat->inv; - if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 ) + if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0 || MAT(in,2,2) == 0 ) return GL_FALSE; - + MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0 / MAT(in,0,0); MAT(out,1,1) = 1.0 / MAT(in,1,1); @@ -452,9 +452,9 @@ static GLboolean invert_matrix_2d_no_rot( GLmatrix *mat ) const GLfloat *in = mat->m; GLfloat *out = mat->inv; - if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) + if (MAT(in,0,0) == 0 || MAT(in,1,1) == 0) return GL_FALSE; - + MEMCPY( out, Identity, 16 * sizeof(GLfloat) ); MAT(out,0,0) = 1.0 / MAT(in,0,0); MAT(out,1,1) = 1.0 / MAT(in,1,1); @@ -517,7 +517,7 @@ static GLboolean matrix_invert( GLmatrix *mat ) mat->flags |= MAT_FLAG_SINGULAR; MEMCPY( mat->inv, Identity, sizeof(Identity) ); return GL_FALSE; - } + } } @@ -529,15 +529,15 @@ static GLboolean matrix_invert( GLmatrix *mat ) * Generate a 4x4 transformation matrix from glRotate parameters, and * postmultiply the input matrix by it. */ -void -_math_matrix_rotate( GLmatrix *mat, +void +_math_matrix_rotate( GLmatrix *mat, GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) { /* This function contributed by Erich Boleyn (erich@uruk.org) */ GLfloat mag, s, c; GLfloat xx, yy, zz, xy, yz, zx, xs, ys, zs, one_c; GLfloat m[16]; - + s = sin( angle * DEG2RAD ); c = cos( angle * DEG2RAD ); @@ -646,9 +646,9 @@ _math_matrix_rotate( GLmatrix *mat, void -_math_matrix_frustum( GLmatrix *mat, +_math_matrix_frustum( GLmatrix *mat, GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, + GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval ) { GLfloat x, y, a, b, c, d; @@ -672,9 +672,9 @@ _math_matrix_frustum( GLmatrix *mat, } void -_math_matrix_ortho( GLmatrix *mat, +_math_matrix_ortho( GLmatrix *mat, GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, + GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval ) { GLfloat x, y, z; @@ -738,7 +738,7 @@ _math_matrix_ortho( GLmatrix *mat, ZERO(3) | ZERO(7) | ZERO(15) ) #define SQ(x) ((x)*(x)) - + /* Determine type and flags from scratch. This is expensive enough to * only want to do it once. */ @@ -751,7 +751,7 @@ static void analyse_from_scratch( GLmatrix *mat ) for (i = 0 ; i < 16 ; i++) { if (m[i] == 0.0) mask |= (1<<i); } - + if (m[0] == 1.0F) mask |= (1<<16); if (m[5] == 1.0F) mask |= (1<<21); if (m[10] == 1.0F) mask |= (1<<26); @@ -759,10 +759,10 @@ static void analyse_from_scratch( GLmatrix *mat ) mat->flags &= ~MAT_FLAGS_GEOMETRY; - /* Check for translation - no-one really cares + /* Check for translation - no-one really cares */ - if ((mask & MASK_NO_TRX) != MASK_NO_TRX) - mat->flags |= MAT_FLAG_TRANSLATION; + if ((mask & MASK_NO_TRX) != MASK_NO_TRX) + mat->flags |= MAT_FLAG_TRANSLATION; /* Do the real work */ @@ -771,7 +771,7 @@ static void analyse_from_scratch( GLmatrix *mat ) } else if ((mask & MASK_2D_NO_ROT) == (GLuint) MASK_2D_NO_ROT) { mat->type = MATRIX_2D_NO_ROT; - + if ((mask & MASK_NO_2D_SCALE) != MASK_NO_2D_SCALE) mat->flags = MAT_FLAG_GENERAL_SCALE; } @@ -784,7 +784,7 @@ static void analyse_from_scratch( GLmatrix *mat ) /* Check for scale */ if (SQ(mm-1) > SQ(1e-6) || - SQ(m4m4-1) > SQ(1e-6)) + SQ(m4m4-1) > SQ(1e-6)) mat->flags |= MAT_FLAG_GENERAL_SCALE; /* Check for rotation */ @@ -798,7 +798,7 @@ static void analyse_from_scratch( GLmatrix *mat ) mat->type = MATRIX_3D_NO_ROT; /* Check for scale */ - if (SQ(m[0]-m[5]) < SQ(1e-6) && + if (SQ(m[0]-m[5]) < SQ(1e-6) && SQ(m[0]-m[10]) < SQ(1e-6)) { if (SQ(m[0]-1.0) > SQ(1e-6)) { mat->flags |= MAT_FLAG_UNIFORM_SCALE; @@ -831,7 +831,7 @@ static void analyse_from_scratch( GLmatrix *mat ) if (SQ(d1) < SQ(1e-6)) { CROSS3( cp, m, m+4 ); SUB_3V( cp, cp, (m+8) ); - if (LEN_SQUARED_3FV(cp) < SQ(1e-6)) + if (LEN_SQUARED_3FV(cp) < SQ(1e-6)) mat->flags |= MAT_FLAG_ROTATION; else mat->flags |= MAT_FLAG_GENERAL_3D; @@ -852,7 +852,7 @@ static void analyse_from_scratch( GLmatrix *mat ) /* Analyse a matrix given that its flags are accurate - this is the - * more common operation, hopefully. + * more common operation, hopefully. */ static void analyse_from_flags( GLmatrix *mat ) { @@ -872,7 +872,7 @@ static void analyse_from_flags( GLmatrix *mat ) } } else if (TEST_MAT_FLAGS(mat, MAT_FLAGS_3D)) { - if ( m[ 8]==0.0F + if ( m[ 8]==0.0F && m[ 9]==0.0F && m[2]==0.0F && m[6]==0.0F && m[10]==1.0F && m[14]==0.0F) { mat->type = MATRIX_2D; @@ -893,11 +893,11 @@ static void analyse_from_flags( GLmatrix *mat ) } -void -_math_matrix_analyse( GLmatrix *mat ) +void +_math_matrix_analyse( GLmatrix *mat ) { if (mat->flags & MAT_DIRTY_TYPE) { - if (mat->flags & MAT_DIRTY_FLAGS) + if (mat->flags & MAT_DIRTY_FLAGS) analyse_from_scratch( mat ); else analyse_from_flags( mat ); @@ -913,7 +913,7 @@ _math_matrix_analyse( GLmatrix *mat ) } -void +void _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) { MEMCPY( to->m, from->m, sizeof(Identity) ); @@ -931,7 +931,7 @@ _math_matrix_copy( GLmatrix *to, const GLmatrix *from ) } -void +void _math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ) { GLfloat *m = mat->m; @@ -945,12 +945,12 @@ _math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ) else mat->flags |= MAT_FLAG_GENERAL_SCALE; - mat->flags |= (MAT_DIRTY_TYPE | + mat->flags |= (MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE); } -void +void _math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ) { GLfloat *m = mat->m; @@ -959,20 +959,20 @@ _math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ) m[14] = m[2] * x + m[6] * y + m[10] * z + m[14]; m[15] = m[3] * x + m[7] * y + m[11] * z + m[15]; - mat->flags |= (MAT_FLAG_TRANSLATION | - MAT_DIRTY_TYPE | + mat->flags |= (MAT_FLAG_TRANSLATION | + MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE); } -void +void _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) { MEMCPY( mat->m, m, 16*sizeof(GLfloat) ); mat->flags = (MAT_FLAG_GENERAL | MAT_DIRTY); } -void +void _math_matrix_ctr( GLmatrix *m ) { if ( m->m == 0 ) { @@ -984,7 +984,7 @@ _math_matrix_ctr( GLmatrix *m ) m->flags = 0; } -void +void _math_matrix_dtr( GLmatrix *m ) { if ( m->m != 0 ) { @@ -998,7 +998,7 @@ _math_matrix_dtr( GLmatrix *m ) } -void +void _math_matrix_alloc_inv( GLmatrix *m ) { if ( m->inv == 0 ) { @@ -1008,32 +1008,32 @@ _math_matrix_alloc_inv( GLmatrix *m ) } -void +void _math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ) { dest->flags = (a->flags | b->flags | - MAT_DIRTY_TYPE | + MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE); if (TEST_MAT_FLAGS(dest, MAT_FLAGS_3D)) matmul34( dest->m, a->m, b->m ); - else + else matmul4( dest->m, a->m, b->m ); } -void +void _math_matrix_mul_floats( GLmatrix *dest, const GLfloat *m ) { dest->flags |= (MAT_FLAG_GENERAL | - MAT_DIRTY_TYPE | + MAT_DIRTY_TYPE | MAT_DIRTY_INVERSE); - matmul4( dest->m, dest->m, m ); + matmul4( dest->m, dest->m, m ); } -void +void _math_matrix_set_identity( GLmatrix *mat ) { MEMCPY( mat->m, Identity, 16*sizeof(GLfloat) ); @@ -1049,7 +1049,7 @@ _math_matrix_set_identity( GLmatrix *mat ) -void +void _math_transposef( GLfloat to[16], const GLfloat from[16] ) { to[0] = from[0]; @@ -1071,7 +1071,7 @@ _math_transposef( GLfloat to[16], const GLfloat from[16] ) } -void +void _math_transposed( GLdouble to[16], const GLdouble from[16] ) { to[0] = from[0]; @@ -1092,7 +1092,7 @@ _math_transposed( GLdouble to[16], const GLdouble from[16] ) to[15] = from[15]; } -void +void _math_transposefd( GLfloat to[16], const GLdouble from[16] ) { to[0] = from[0]; diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h index 66600330b8..d042b74628 100644 --- a/src/mesa/math/m_matrix.h +++ b/src/mesa/math/m_matrix.h @@ -1,21 +1,21 @@ -/* $Id: m_matrix.h,v 1.3 2001/02/05 18:48:52 brianp Exp $ */ +/* $Id: m_matrix.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -119,35 +119,35 @@ _math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ); extern void _math_matrix_mul_floats( GLmatrix *dest, const GLfloat *b ); -extern void +extern void _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ); -extern void +extern void _math_matrix_translate( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ); extern void -_math_matrix_rotate( GLmatrix *m, GLfloat angle, +_math_matrix_rotate( GLmatrix *m, GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); -extern void +extern void _math_matrix_scale( GLmatrix *mat, GLfloat x, GLfloat y, GLfloat z ); extern void -_math_matrix_ortho( GLmatrix *mat, +_math_matrix_ortho( GLmatrix *mat, GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, + GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval ); extern void -_math_matrix_frustum( GLmatrix *mat, +_math_matrix_frustum( GLmatrix *mat, GLfloat left, GLfloat right, - GLfloat bottom, GLfloat top, + GLfloat bottom, GLfloat top, GLfloat nearval, GLfloat farval ); extern void _math_matrix_set_identity( GLmatrix *dest ); -extern void +extern void _math_matrix_copy( GLmatrix *to, const GLmatrix *from ); extern void diff --git a/src/mesa/math/m_norm_tmp.h b/src/mesa/math/m_norm_tmp.h index ccaa2247e8..aea3a4b65b 100644 --- a/src/mesa/math/m_norm_tmp.h +++ b/src/mesa/math/m_norm_tmp.h @@ -1,21 +1,21 @@ -/* $Id: m_norm_tmp.h,v 1.4 2001/03/03 20:57:00 brianp Exp $ */ +/* $Id: m_norm_tmp.h,v 1.5 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 - * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. - * + * Version: 3.5 + * + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -39,7 +39,7 @@ TAG(transform_normalize_normals)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -113,7 +113,7 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -153,7 +153,7 @@ TAG(transform_normalize_normals_no_rot)( const GLmatrix *mat, /* scale has been snapped to 1.0 if it is close. */ if (scale != 1.0) { - m0 *= scale; + m0 *= scale; m5 *= scale; m10 *= scale; } @@ -188,7 +188,7 @@ TAG(transform_rescale_normals_no_rot)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -218,7 +218,7 @@ TAG(transform_rescale_normals)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -252,7 +252,7 @@ TAG(transform_normals_no_rot)(const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -284,7 +284,7 @@ TAG(transform_normals)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -316,7 +316,7 @@ TAG(normalize_normals)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -332,7 +332,7 @@ TAG(normalize_normals)( const GLmatrix *mat, out[i][0] = x * invlen; out[i][1] = y * invlen; out[i][2] = z * invlen; - } + } } } else { @@ -351,7 +351,7 @@ TAG(normalize_normals)( const GLmatrix *mat, out[i][1] = y; out[i][2] = z; } - } + } } } dest->count = in->count; @@ -366,7 +366,7 @@ TAG(rescale_normals)( const GLmatrix *mat, const GLubyte mask[], GLvector3f *dest ) { - GLuint i; + GLuint i; const GLfloat *from = in->start; GLuint stride = in->stride; GLuint count = in->count; @@ -387,27 +387,27 @@ TAG(rescale_normals)( const GLmatrix *mat, static void _XFORMAPI TAG(init_c_norm_transform)( void ) { - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] = + _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] = TAG(transform_normals_no_rot); - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][IDX] = + _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][IDX] = TAG(transform_rescale_normals_no_rot); - _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][IDX] = + _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][IDX] = TAG(transform_normalize_normals_no_rot); - _mesa_normal_tab[NORM_TRANSFORM][IDX] = + _mesa_normal_tab[NORM_TRANSFORM][IDX] = TAG(transform_normals); - _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE][IDX] = + _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE][IDX] = TAG(transform_rescale_normals); - _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][IDX] = + _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][IDX] = TAG(transform_normalize_normals); - _mesa_normal_tab[NORM_RESCALE][IDX] = + _mesa_normal_tab[NORM_RESCALE][IDX] = TAG(rescale_normals); - _mesa_normal_tab[NORM_NORMALIZE][IDX] = + _mesa_normal_tab[NORM_NORMALIZE][IDX] = TAG(normalize_normals); } diff --git a/src/mesa/math/m_trans_tmp.h b/src/mesa/math/m_trans_tmp.h index 1b20266fbc..e425d0584d 100644 --- a/src/mesa/math/m_trans_tmp.h +++ b/src/mesa/math/m_trans_tmp.h @@ -1,21 +1,21 @@ -/* $Id: m_trans_tmp.h,v 1.3 2001/01/24 00:04:59 brianp Exp $ */ +/* $Id: m_trans_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -48,7 +48,7 @@ static void DEST_4F( GLfloat (*t)[4], (void) first; (void) start; for (i = DST_START ; i < n ; i++, NEXT_F) { - CHECK { + CHECK { NEXT_F2; if (SZ >= 1) t[i][0] = TRX_4F(f, 0); if (SZ >= 2) t[i][1] = TRX_4F(f, 1); @@ -118,7 +118,7 @@ static void DEST_4UB( GLubyte (*t)[4], NEXT_F2; if (SZ >= 1) TRX_UB(t[i][0], f, 0); if (SZ >= 2) TRX_UB(t[i][1], f, 1); - if (SZ >= 3) TRX_UB(t[i][2], f, 2); + if (SZ >= 3) TRX_UB(t[i][2], f, 2); if (SZ == 4) TRX_UB(t[i][3], f, 3); else t[i][3] = 255; } } @@ -142,7 +142,7 @@ static void DEST_4US( GLushort (*t)[4], NEXT_F2; if (SZ >= 1) TRX_US(t[i][0], f, 0); if (SZ >= 2) TRX_US(t[i][1], f, 1); - if (SZ >= 3) TRX_US(t[i][2], f, 2); + if (SZ >= 3) TRX_US(t[i][2], f, 2); if (SZ == 4) TRX_US(t[i][3], f, 3); else t[i][3] = 65535; } } @@ -220,7 +220,7 @@ static void INIT(void) #ifdef DEST_4F TAB(_4f)[SZ][SRC_IDX] = DEST_4F; #endif - + } @@ -234,5 +234,3 @@ static void INIT(void) #undef DEST_1F #undef SZ #undef TAG - - diff --git a/src/mesa/math/m_translate.c b/src/mesa/math/m_translate.c index 967f6a54cf..47f6c61f5f 100644 --- a/src/mesa/math/m_translate.c +++ b/src/mesa/math/m_translate.c @@ -1,21 +1,21 @@ -/* $Id: m_translate.c,v 1.5 2001/02/20 18:28:52 keithw Exp $ */ +/* $Id: m_translate.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -42,13 +42,13 @@ typedef void (*trans_1f_func)(GLfloat *to, CONST void *ptr, GLuint stride, - GLuint start, + GLuint start, GLuint n ); typedef void (*trans_1ui_func)(GLuint *to, CONST void *ptr, GLuint stride, - GLuint start, + GLuint start, GLuint n ); typedef void (*trans_1ub_func)(GLubyte *to, @@ -72,13 +72,13 @@ typedef void (*trans_4us_func)(GLushort (*to)[4], typedef void (*trans_4f_func)(GLfloat (*to)[4], CONST void *ptr, GLuint stride, - GLuint start, + GLuint start, GLuint n ); typedef void (*trans_3f_func)(GLfloat (*to)[3], CONST void *ptr, GLuint stride, - GLuint start, + GLuint start, GLuint n ); @@ -436,9 +436,9 @@ static trans_4f_func _math_trans_4f_tab[5][MAX_TYPES]; #define SRC GLfloat #define SRC_IDX TYPE_IDX(GL_FLOAT) #define SZ 4 -#define INIT init_trans_4_GLfloat_raw -#define DEST_4UB trans_4_GLfloat_4ub_raw -#define DEST_4US trans_4_GLfloat_4us_raw +#define INIT init_trans_4_GLfloat_raw +#define DEST_4UB trans_4_GLfloat_4ub_raw +#define DEST_4US trans_4_GLfloat_4us_raw #define DEST_4F trans_4_GLfloat_4f_raw #include "m_trans_tmp.h" @@ -481,7 +481,7 @@ static void trans_4_GLubyte_4ub_raw(GLubyte (*t)[4], const GLubyte *f = (GLubyte *) Ptr + SRC_START * stride; GLuint i; - if (((((long) f | (long) stride)) & 3L) == 0L) { + if (((((long) f | (long) stride)) & 3L) == 0L) { /* Aligned. */ for (i = DST_START ; i < n ; i++, f += stride) { @@ -579,7 +579,7 @@ void _math_trans_1ui(GLuint *to, GLuint start, GLuint n ) { - _math_trans_1ui_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); + _math_trans_1ui_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); } void _math_trans_1ub(GLubyte *to, @@ -589,7 +589,7 @@ void _math_trans_1ub(GLubyte *to, GLuint start, GLuint n ) { - _math_trans_1ub_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); + _math_trans_1ub_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); } @@ -601,7 +601,7 @@ void _math_trans_4ub(GLubyte (*to)[4], GLuint start, GLuint n ) { - _math_trans_4ub_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); + _math_trans_4ub_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); } void _math_trans_4chan( GLchan (*to)[4], @@ -629,7 +629,7 @@ void _math_trans_4us(GLushort (*to)[4], GLuint start, GLuint n ) { - _math_trans_4us_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); + _math_trans_4us_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); } void _math_trans_4f(GLfloat (*to)[4], @@ -640,7 +640,7 @@ void _math_trans_4f(GLfloat (*to)[4], GLuint start, GLuint n ) { - _math_trans_4f_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); + _math_trans_4f_tab[size][TYPE_IDX(type)]( to, ptr, stride, start, n ); } void _math_trans_3f(GLfloat (*to)[3], @@ -650,6 +650,5 @@ void _math_trans_3f(GLfloat (*to)[3], GLuint start, GLuint n ) { - _math_trans_3f_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); + _math_trans_3f_tab[TYPE_IDX(type)]( to, ptr, stride, start, n ); } - diff --git a/src/mesa/math/m_translate.h b/src/mesa/math/m_translate.h index 55ac887e24..f15bb77e2d 100644 --- a/src/mesa/math/m_translate.h +++ b/src/mesa/math/m_translate.h @@ -1,21 +1,21 @@ -/* $Id: m_translate.h,v 1.5 2001/02/20 18:28:52 keithw Exp $ */ +/* $Id: m_translate.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL diff --git a/src/mesa/math/m_vector.c b/src/mesa/math/m_vector.c index 2cb227594d..0195faf7e4 100644 --- a/src/mesa/math/m_vector.c +++ b/src/mesa/math/m_vector.c @@ -1,21 +1,21 @@ -/* $Id: m_vector.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */ +/* $Id: m_vector.c,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -45,14 +45,14 @@ void _mesa_vector4f_clean_elem( GLvector4f *vec, GLuint count, GLuint elt ) { static const GLubyte elem_bits[4] = { VEC_DIRTY_0, - VEC_DIRTY_1, - VEC_DIRTY_2, + VEC_DIRTY_1, + VEC_DIRTY_2, VEC_DIRTY_3 }; static const GLfloat clean[4] = { 0, 0, 0, 1 }; const GLfloat v = clean[elt]; GLfloat (*data)[4] = (GLfloat (*)[4])vec->start; - GLuint i; + GLuint i; for (i = 0 ; i < count ; i++) data[i][elt] = v; @@ -234,7 +234,7 @@ void _mesa_vector1ub_alloc( GLvector1ub *v, GLuint flags, GLuint count, { v->stride = 1 * sizeof(GLubyte); v->storage = ALIGN_MALLOC( count * sizeof(GLubyte), alignment ); - v->start = (GLubyte *) v->storage; + v->start = (GLubyte *) v->storage; v->data = (GLubyte *) v->storage; v->count = 0; v->flags = flags | VEC_MALLOC ; @@ -245,7 +245,7 @@ void _mesa_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count, { v->stride = 1 * sizeof(GLuint); v->storage = ALIGN_MALLOC( count * sizeof(GLuint), alignment ); - v->start = (GLuint *) v->storage; + v->start = (GLuint *) v->storage; v->data = (GLuint *) v->storage; v->count = 0; v->flags = flags | VEC_MALLOC ; @@ -368,20 +368,20 @@ void _mesa_vector4f_print( GLvector4f *v, GLubyte *cullmask, GLboolean culling ) GLuint j, i = 0, count; printf("data-start\n"); - for ( ; d != v->start ; STRIDE_F(d, v->stride), i++) + for ( ; d != v->start ; STRIDE_F(d, v->stride), i++) printf( t, i, d[0], d[1], d[2], d[3]); - + printf("start-count(%u)\n", v->count); count = i + v->count; if (culling) { - for ( ; i < count ; STRIDE_F(d, v->stride), i++) - if (cullmask[i]) - printf( t, i, d[0], d[1], d[2], d[3]); + for ( ; i < count ; STRIDE_F(d, v->stride), i++) + if (cullmask[i]) + printf( t, i, d[0], d[1], d[2], d[3]); } else { - for ( ; i < count ; STRIDE_F(d, v->stride), i++) - printf( t, i, d[0], d[1], d[2], d[3]); + for ( ; i < count ; STRIDE_F(d, v->stride), i++) + printf( t, i, d[0], d[1], d[2], d[3]); } for (j = v->size ; j < 4; j++) { @@ -389,13 +389,13 @@ void _mesa_vector4f_print( GLvector4f *v, GLubyte *cullmask, GLboolean culling ) printf("checking col %u is clean as advertised ", j); - for (i = 0, d = (GLfloat *) v->data ; - i < count && d[j] == c[j] ; + for (i = 0, d = (GLfloat *) v->data ; + i < count && d[j] == c[j] ; i++, STRIDE_F(d, v->stride)) {}; - if (i == count) + if (i == count) printf(" --> ok\n"); - else + else printf(" --> Failed at %u ******\n", i); } } @@ -411,19 +411,19 @@ void _mesa_vector3f_print( GLvector3f *v, GLubyte *cullmask, GLboolean culling ) GLuint i = 0, count; printf("data-start\n"); - for ( ; d != v->start ; STRIDE_F(d,v->stride), i++) + for ( ; d != v->start ; STRIDE_F(d,v->stride), i++) printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); - + printf("start-count(%u)\n", v->count); count = i + v->count; if (culling) { - for ( ; i < count ; STRIDE_F(d,v->stride), i++) + for ( ; i < count ; STRIDE_F(d,v->stride), i++) if (cullmask[i]) - printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); + printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); } else { - for ( ; i < count ; STRIDE_F(d,v->stride), i++) - printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); + for ( ; i < count ; STRIDE_F(d,v->stride), i++) + printf( "%u:\t%f, %f, %f\n", i, d[0], d[1], d[2]); } } diff --git a/src/mesa/math/m_vector.h b/src/mesa/math/m_vector.h index 0615d3056f..222a49880b 100644 --- a/src/mesa/math/m_vector.h +++ b/src/mesa/math/m_vector.h @@ -1,21 +1,21 @@ -/* $Id: m_vector.h,v 1.5 2001/03/03 20:33:30 brianp Exp $ */ +/* $Id: m_vector.h,v 1.6 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 - * + * * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -36,7 +36,7 @@ #include "mtypes.h" /* hack for GLchan */ -#define VEC_DIRTY_0 0x1 +#define VEC_DIRTY_0 0x1 #define VEC_DIRTY_1 0x2 #define VEC_DIRTY_2 0x4 #define VEC_DIRTY_3 0x8 @@ -55,7 +55,7 @@ /* Wrap all the information about vectors up in a struct. Has * additional fields compared to the other vectors to help us track of * different vertex sizes, and whether we need to clean columns out - * because they contain non-(0,0,0,1) values. + * because they contain non-(0,0,0,1) values. * * The start field is used to reserve data for copied vertices at the * end of _mesa_transform_vb, and avoids the need for a multiplication in @@ -82,10 +82,10 @@ extern void _mesa_vector4f_clean_elem( GLvector4f *vec, GLuint nr, GLuint elt ); /* Could use a single vector type for normals and vertices, but - * this way avoids some casts. + * this way avoids some casts. */ typedef struct { - GLfloat (*data)[3]; + GLfloat (*data)[3]; GLfloat *start; GLuint count; GLuint stride; @@ -101,7 +101,7 @@ extern void _mesa_vector3f_print( GLvector3f *v, GLubyte *, GLboolean ); typedef struct { - GLfloat *data; + GLfloat *data; GLfloat *start; GLuint count; GLuint stride; @@ -121,12 +121,12 @@ typedef struct { GLubyte (*data)[4]; GLubyte *start; GLuint count; - GLuint stride; - GLuint flags; + GLuint stride; + GLuint flags; void *storage; } GLvector4ub; -extern void _mesa_vector4ub_init( GLvector4ub *v, GLuint flags, +extern void _mesa_vector4ub_init( GLvector4ub *v, GLuint flags, GLubyte (*storage)[4] ); extern void _mesa_vector4ub_alloc( GLvector4ub *v, GLuint flags, GLuint count, GLuint alignment ); @@ -139,12 +139,12 @@ typedef struct { GLchan (*data)[4]; GLchan *start; GLuint count; - GLuint stride; - GLuint flags; + GLuint stride; + GLuint flags; void *storage; } GLvector4chan; -extern void _mesa_vector4chan_init( GLvector4chan *v, GLuint flags, +extern void _mesa_vector4chan_init( GLvector4chan *v, GLuint flags, GLchan (*storage)[4] ); extern void _mesa_vector4chan_alloc( GLvector4chan *v, GLuint flags, GLuint count, GLuint alignment ); @@ -159,12 +159,12 @@ typedef struct { GLushort (*data)[4]; GLushort *start; GLuint count; - GLuint stride; - GLuint flags; + GLuint stride; + GLuint flags; void *storage; } GLvector4us; -extern void _mesa_vector4us_init( GLvector4us *v, GLuint flags, +extern void _mesa_vector4us_init( GLvector4us *v, GLuint flags, GLushort (*storage)[4] ); extern void _mesa_vector4us_alloc( GLvector4us *v, GLuint flags, GLuint count, GLuint alignment ); @@ -179,8 +179,8 @@ typedef struct { GLubyte *data; GLubyte *start; GLuint count; - GLuint stride; - GLuint flags; + GLuint stride; + GLuint flags; void *storage; } GLvector1ub; @@ -198,13 +198,13 @@ typedef struct { GLuint *data; GLuint *start; GLuint count; - GLuint stride; - GLuint flags; + GLuint stride; + GLuint flags; void *storage; } GLvector1ui; extern void _mesa_vector1ui_init( GLvector1ui *v, GLuint flags, GLuint *storage ); -extern void _mesa_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count, +extern void _mesa_vector1ui_alloc( GLvector1ui *v, GLuint flags, GLuint count, GLuint alignment ); extern void _mesa_vector1ui_free( GLvector1ui * ); diff --git a/src/mesa/math/m_xform.c b/src/mesa/math/m_xform.c index f896bb1e03..7103f11f94 100644 --- a/src/mesa/math/m_xform.c +++ b/src/mesa/math/m_xform.c @@ -1,10 +1,10 @@ -/* $Id: m_xform.c,v 1.10 2001/03/03 20:57:00 brianp Exp $ */ +/* $Id: m_xform.c,v 1.11 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library * Version: 3.5 * - * Copyright (C) 1999-2000 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/src/mesa/math/m_xform.h b/src/mesa/math/m_xform.h index d8b019cc54..3e24ceac4a 100644 --- a/src/mesa/math/m_xform.h +++ b/src/mesa/math/m_xform.h @@ -1,21 +1,21 @@ -/* $Id: m_xform.h,v 1.7 2001/03/03 20:57:00 brianp Exp $ */ +/* $Id: m_xform.h,v 1.8 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.3 - * - * Copyright (C) 1999 Brian Paul All Rights Reserved. - * + * Version: 3.5 + * + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL @@ -78,7 +78,7 @@ extern void _mesa_transform_vector( GLfloat u[4], CONST GLfloat m[16] ); -extern void +extern void _math_init_transformation( void ); @@ -94,7 +94,7 @@ _math_init_transformation( void ); * * There are two cases where we wouldn't want to do the divide in cliptest: * - When we aren't clipping. We still might want to cull backfaces - * so the divide should be done elsewhere. This currently never + * so the divide should be done elsewhere. This currently never * happens. * * - When culling isn't likely to help us, such as when the GL culling @@ -105,17 +105,17 @@ _math_init_transformation( void ); * application wouldn't turn on culling in such cases. * * We supply a buffer to hold the [x/w,y/w,z/w,1/w] values which - * are the result of the projection. This is only used in the + * are the result of the projection. This is only used in the * 4-vector case - in other cases, we just use the clip coordinates * as the projected coordinates - they are identical. - * + * * This is doubly convenient because it means the Win[] array is now * of the same stride as all the others, so I can now turn map_vertices * into a straight-forward matrix transformation, with asm acceleration - * automatically available. + * automatically available. */ -/* Vertex buffer clipping flags +/* Vertex buffer clipping flags */ #define CLIP_RIGHT_SHIFT 0 #define CLIP_LEFT_SHIFT 1 @@ -135,19 +135,19 @@ _math_init_transformation( void ); typedef GLvector4f * (_XFORMAPIP clip_func)( GLvector4f *vClip, - GLvector4f *vProj, + GLvector4f *vProj, GLubyte clipMask[], - GLubyte *orMask, + GLubyte *orMask, GLubyte *andMask ); -typedef void (*dotprod_func)( GLfloat *out, +typedef void (*dotprod_func)( GLfloat *out, GLuint out_stride, - CONST GLvector4f *coord_vec, - CONST GLfloat plane[4], + CONST GLvector4f *coord_vec, + CONST GLfloat plane[4], CONST GLubyte mask[]); -typedef void (*vec_copy_func)( GLvector4f *to, - CONST GLvector4f *from, +typedef void (*vec_copy_func)( GLvector4f *to, + CONST GLvector4f *from, CONST GLubyte mask[]); @@ -163,7 +163,7 @@ typedef void (_NORMAPIP normal_func)( CONST GLmatrix *mat, GLvector3f *dest ); -/* Flags for selecting a normal transformation function. +/* Flags for selecting a normal transformation function. */ #define NORM_RESCALE 0x1 /* apply the scale factor */ #define NORM_NORMALIZE 0x2 /* normalize */ @@ -176,11 +176,11 @@ typedef void (_NORMAPIP normal_func)( CONST GLmatrix *mat, /* KW: New versions of the transform function allow a mask array * specifying that individual vector transform should be skipped * when the mask byte is zero. This is always present as a - * parameter, to allow a unified interface. + * parameter, to allow a unified interface. */ typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec, CONST GLfloat m[16], - CONST GLvector4f *from_vec, + CONST GLvector4f *from_vec, CONST GLubyte *clipmask, CONST GLubyte flag ); diff --git a/src/mesa/math/m_xform_tmp.h b/src/mesa/math/m_xform_tmp.h index eca41f5f76..dd5a233b5c 100644 --- a/src/mesa/math/m_xform_tmp.h +++ b/src/mesa/math/m_xform_tmp.h @@ -1,10 +1,10 @@ -/* $Id: m_xform_tmp.h,v 1.3 2001/03/03 20:33:30 brianp Exp $ */ +/* $Id: m_xform_tmp.h,v 1.4 2001/03/12 00:48:41 gareth Exp $ */ /* * Mesa 3-D graphics library - * Version: 3.1 + * Version: 3.5 * - * Copyright (C) 1999 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), diff --git a/src/mesa/math/mathmod.h b/src/mesa/math/mathmod.h index f27427d81b..44bf2b97d5 100644 --- a/src/mesa/math/mathmod.h +++ b/src/mesa/math/mathmod.h @@ -1,3 +1,29 @@ +/* $Id: mathmod.h,v 1.3 2001/03/12 00:48:41 gareth Exp $ */ + +/* + * Mesa 3-D graphics library + * Version: 3.5 + * + * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + #ifndef _MESA_MATH_H_ #define _MESA_MATH_H_ |