From 896e8bd2d7eb1385ca89e71b7eac146577320e00 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Mar 2001 17:17:28 +0000 Subject: processed by indent to improve readability --- src/mesa/math/m_eval.c | 361 ++++++++++++++++++++++--------------------------- 1 file changed, 161 insertions(+), 200 deletions(-) diff --git a/src/mesa/math/m_eval.c b/src/mesa/math/m_eval.c index adf5b19fec..9316625d97 100644 --- a/src/mesa/math/m_eval.c +++ b/src/mesa/math/m_eval.c @@ -1,4 +1,4 @@ -/* $Id: m_eval.c,v 1.3 2001/03/08 17:15:01 brianp Exp $ */ +/* $Id: m_eval.c,v 1.4 2001/03/08 17:17:28 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -72,32 +72,31 @@ static GLfloat inv_tab[MAX_EVAL_ORDER]; void -_math_horner_bezier_curve(const GLfloat *cp, GLfloat *out, GLfloat t, +_math_horner_bezier_curve(const GLfloat * cp, GLfloat * out, GLfloat t, GLuint dim, GLuint order) { GLfloat s, powert, bincoeff; GLuint i, k; - if(order >= 2) - { + if (order >= 2) { bincoeff = (GLfloat) (order - 1); - s = 1.0-t; + s = 1.0 - t; - for(k=0; k constant curve */ - { - for(k=0; k constant curve */ + + for (k = 0; k < dim; k++) out[k] = cp[k]; } } @@ -117,69 +116,64 @@ _math_horner_bezier_curve(const GLfloat *cp, GLfloat *out, GLfloat t, */ void -_math_horner_bezier_surf(GLfloat *cn, GLfloat *out, GLfloat u, GLfloat v, +_math_horner_bezier_surf(GLfloat * cn, GLfloat * out, GLfloat u, GLfloat v, GLuint dim, GLuint uorder, GLuint vorder) { - GLfloat *cp = cn + uorder*vorder*dim; - GLuint i, uinc = vorder*dim; + GLfloat *cp = cn + uorder * vorder * dim; + GLuint i, uinc = vorder * dim; - if(vorder > uorder) - { - if(uorder >= 2) - { + if (vorder > uorder) { + if (uorder >= 2) { GLfloat s, poweru, bincoeff; GLuint j, k; /* Compute the control polygon for the surface-curve in u-direction */ - for(j=0; j cn defines a curve in v */ + else /* uorder=1 -> cn defines a curve in v */ _math_horner_bezier_curve(cn, out, v, dim, vorder); } - else /* vorder <= uorder */ - { - if(vorder > 1) - { + else { /* vorder <= uorder */ + + if (vorder > 1) { GLuint i; /* Compute the control polygon for the surface-curve in u-direction */ - for(i=0; i cn defines a curve in u */ + else /* vorder=1 -> cn defines a curve in u */ _math_horner_bezier_curve(cn, out, u, dim, uorder); } } @@ -199,15 +193,15 @@ _math_horner_bezier_surf(GLfloat *cn, GLfloat *out, GLfloat u, GLfloat v, */ void -_math_de_casteljau_surf(GLfloat *cn, GLfloat *out, GLfloat *du, GLfloat *dv, - GLfloat u, GLfloat v, GLuint dim, +_math_de_casteljau_surf(GLfloat * cn, GLfloat * out, GLfloat * du, + GLfloat * dv, GLfloat u, GLfloat v, GLuint dim, GLuint uorder, GLuint vorder) { - GLfloat *dcn = cn + uorder*vorder*dim; - GLfloat us = 1.0-u, vs = 1.0-v; + GLfloat *dcn = cn + uorder * vorder * dim; + GLfloat us = 1.0 - u, vs = 1.0 - v; GLuint h, i, j, k; GLuint minorder = uorder < vorder ? uorder : vorder; - GLuint uinc = vorder*dim; + GLuint uinc = vorder * dim; GLuint dcuinc = vorder; /* Each component is evaluated separately to save buffer space */ @@ -218,267 +212,234 @@ _math_de_casteljau_surf(GLfloat *cn, GLfloat *out, GLfloat *du, GLfloat *dv, #define CN(I,J,K) cn[(I)*uinc+(J)*dim+(K)] #define DCN(I, J) dcn[(I)*dcuinc+(J)] - if(minorder < 3) - { - if(uorder==vorder) - { - for(k=0; k