mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 22:10:10 +01:00
changed bincoeff var to GLfloat, fixes bug introduced in previous check-in
This commit is contained in:
parent
a28fa45ab7
commit
417ed16a88
1 changed files with 11 additions and 11 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
/* $Id: m_eval.c,v 1.2 2001/03/07 05:06:12 brianp Exp $ */
|
/* $Id: m_eval.c,v 1.3 2001/03/08 17:15:01 brianp Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mesa 3-D graphics library
|
* Mesa 3-D graphics library
|
||||||
|
|
@ -75,12 +75,12 @@ 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)
|
GLuint dim, GLuint order)
|
||||||
{
|
{
|
||||||
GLfloat s, powert;
|
GLfloat s, powert, bincoeff;
|
||||||
GLuint i, k, bincoeff;
|
GLuint i, k;
|
||||||
|
|
||||||
if(order >= 2)
|
if(order >= 2)
|
||||||
{
|
{
|
||||||
bincoeff = order-1;
|
bincoeff = (GLfloat) (order - 1);
|
||||||
s = 1.0-t;
|
s = 1.0-t;
|
||||||
|
|
||||||
for(k=0; k<dim; k++)
|
for(k=0; k<dim; k++)
|
||||||
|
|
@ -88,8 +88,8 @@ _math_horner_bezier_curve(const GLfloat *cp, GLfloat *out, GLfloat t,
|
||||||
|
|
||||||
for(i=2, cp+=2*dim, powert=t*t; i<order; i++, powert*=t, cp +=dim)
|
for(i=2, cp+=2*dim, powert=t*t; i<order; i++, powert*=t, cp +=dim)
|
||||||
{
|
{
|
||||||
bincoeff *= order-i;
|
bincoeff *= (GLfloat) (order - i);
|
||||||
bincoeff *= (GLuint) inv_tab[i];
|
bincoeff *= inv_tab[i];
|
||||||
|
|
||||||
for(k=0; k<dim; k++)
|
for(k=0; k<dim; k++)
|
||||||
out[k] = s*out[k] + bincoeff*powert*cp[k];
|
out[k] = s*out[k] + bincoeff*powert*cp[k];
|
||||||
|
|
@ -127,8 +127,8 @@ _math_horner_bezier_surf(GLfloat *cn, GLfloat *out, GLfloat u, GLfloat v,
|
||||||
{
|
{
|
||||||
if(uorder >= 2)
|
if(uorder >= 2)
|
||||||
{
|
{
|
||||||
GLfloat s, poweru;
|
GLfloat s, poweru, bincoeff;
|
||||||
GLuint j, k, bincoeff;
|
GLuint j, k;
|
||||||
|
|
||||||
/* Compute the control polygon for the surface-curve in u-direction */
|
/* Compute the control polygon for the surface-curve in u-direction */
|
||||||
for(j=0; j<vorder; j++)
|
for(j=0; j<vorder; j++)
|
||||||
|
|
@ -137,7 +137,7 @@ _math_horner_bezier_surf(GLfloat *cn, GLfloat *out, GLfloat u, GLfloat v,
|
||||||
|
|
||||||
/* Each control point is the point for parameter u on a */
|
/* Each control point is the point for parameter u on a */
|
||||||
/* curve defined by the control polygons in u-direction */
|
/* curve defined by the control polygons in u-direction */
|
||||||
bincoeff = uorder-1;
|
bincoeff = (GLfloat) (uorder - 1);
|
||||||
s = 1.0-u;
|
s = 1.0-u;
|
||||||
|
|
||||||
for(k=0; k<dim; k++)
|
for(k=0; k<dim; k++)
|
||||||
|
|
@ -146,8 +146,8 @@ _math_horner_bezier_surf(GLfloat *cn, GLfloat *out, GLfloat u, GLfloat v,
|
||||||
for(i=2, ucp+=2*uinc, poweru=u*u; i<uorder;
|
for(i=2, ucp+=2*uinc, poweru=u*u; i<uorder;
|
||||||
i++, poweru*=u, ucp +=uinc)
|
i++, poweru*=u, ucp +=uinc)
|
||||||
{
|
{
|
||||||
bincoeff *= uorder-i;
|
bincoeff *= (GLfloat) (uorder - i);
|
||||||
bincoeff *= (GLuint) inv_tab[i];
|
bincoeff *= inv_tab[i];
|
||||||
|
|
||||||
for(k=0; k<dim; k++)
|
for(k=0; k<dim; k++)
|
||||||
cp[j*dim+k] = s*cp[j*dim+k] + bincoeff*poweru*ucp[k];
|
cp[j*dim+k] = s*cp[j*dim+k] + bincoeff*poweru*ucp[k];
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue