GLuint i;
for (i = 0; i < count; i++) {
- *bptr++ = ((GLfloat *)ptr)[0] == 1.0;
+ *bptr++ = ((GLfloat *)ptr)[0] == 1.0F;
ptr += stride;
}
SUB_3V(VP, light->_Position, vertex);
/* d = length(VP) */
d = (GLfloat) LEN_3FV( VP );
- if (d > 1.0e-6) {
+ if (d > 1.0e-6F) {
/* normalize VP */
GLfloat invd = 1.0F / d;
SELF_SCALE_SCALAR_3V(VP, invd);
}
}
- if (attenuation < 1e-3)
+ if (attenuation < 1e-3F)
continue;
n_dot_VP = DOT3( normal, VP );
shine = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_SHININESS][0];
spec_coef = powf(n_dot_h, shine);
- if (spec_coef > 1.0e-10) {
+ if (spec_coef > 1.0e-10F) {
if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
ACC_SCALE_SCALAR_3V( specularContrib, spec_coef,
light->_MatSpecular[0]);
#define FOG_STAGE_DATA(stage) ((struct fog_stage_data *)stage->privatePtr)
#define FOG_EXP_TABLE_SIZE 256
-#define FOG_MAX (10.0)
-#define EXP_FOG_MAX .0006595
+#define FOG_MAX (10.0F)
+#define EXP_FOG_MAX .0006595F
#define FOG_INCR (FOG_MAX/FOG_EXP_TABLE_SIZE)
static GLfloat exp_table[FOG_EXP_TABLE_SIZE];
static GLfloat inited = 0;
#if 1
#define NEG_EXP( result, narg ) \
do { \
- GLfloat f = (GLfloat) (narg * (1.0/FOG_INCR)); \
+ GLfloat f = (GLfloat) (narg * (1.0F / FOG_INCR)); \
GLint k = (GLint) f; \
if (k > FOG_EXP_TABLE_SIZE-2) \
result = (GLfloat) EXP_FOG_MAX; \
break;
m = s->tab;
- m[0] = 0.0;
- if (shininess == 0.0) {
+ m[0] = 0.0F;
+ if (shininess == 0.0F) {
for (j = 1 ; j <= SHINE_TABLE_SIZE ; j++)
- m[j] = 1.0;
+ m[j] = 1.0F;
}
else {
for (j = 1 ; j < SHINE_TABLE_SIZE ; j++) {
- GLdouble t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1);
- if (x < 0.005) /* underflow check */
- x = 0.005;
- t = pow(x, shininess);
- if (t > 1e-20)
- m[j] = (GLfloat) t;
+ GLfloat t, x = j / (GLfloat) (SHINE_TABLE_SIZE - 1);
+ if (x < 0.005F) /* underflow check */
+ x = 0.005F;
+ t = powf(x, shininess);
+ if (t > 1e-20F)
+ m[j] = t;
else
- m[j] = 0.0;
+ m[j] = 0.0F;
}
- m[SHINE_TABLE_SIZE] = 1.0;
+ m[SHINE_TABLE_SIZE] = 1.0F;
}
s->shininess = shininess;
GLint side;
GLfloat contrib[3];
GLfloat attenuation;
- GLfloat VP[3]; /* unit vector from vertex to light */
+ GLfloat VP[3]; /* unit vector from vertex to light */
GLfloat n_dot_VP; /* n dot VP */
GLfloat *h;
d = (GLfloat) LEN_3FV( VP );
- if (d > 1e-6) {
+ if (d > 1e-6F) {
GLfloat invd = 1.0F / d;
SELF_SCALE_SCALAR_3V(VP, invd);
}
}
}
- if (attenuation < 1e-3)
+ if (attenuation < 1e-3F)
continue; /* this light makes no contribution */
/* Compute dot product or normal and vector from V to light pos */
if (n_dot_h > 0.0F) {
GLfloat spec_coef = lookup_shininess(ctx, side, n_dot_h);
- if (spec_coef > 1.0e-10) {
+ if (spec_coef > 1.0e-10F) {
spec_coef *= attenuation;
ACC_SCALE_SCALAR_3V( spec[side], spec_coef,
light->_MatSpecular[side]);
/* Add contribution from each enabled light source */
foreach (light, &ctx->Light.EnabledList) {
-
GLfloat n_dot_h;
GLfloat correction;
GLint side;
GLfloat contrib[3];
- GLfloat attenuation = 1.0;
+ GLfloat attenuation;
GLfloat VP[3]; /* unit vector from vertex to light */
GLfloat n_dot_VP; /* n dot VP */
GLfloat *h;
else {
GLfloat d; /* distance from vertex to light */
-
SUB_3V(VP, light->_Position, vertex);
d = (GLfloat) LEN_3FV( VP );
- if ( d > 1e-6) {
+ if (d > 1e-6F) {
GLfloat invd = 1.0F / d;
SELF_SCALE_SCALAR_3V(VP, invd);
}
}
}
- if (attenuation < 1e-3)
+ if (attenuation < 1e-3F)
continue; /* this light makes no contribution */
/* Compute dot product or normal and vector from V to light pos */
store->NormalTransform = _mesa_normal_tab[transform | NORM_NORMALIZE];
}
else if (ctx->Transform.RescaleNormals &&
- ctx->_ModelViewInvScale != 1.0) {
+ ctx->_ModelViewInvScale != 1.0F) {
store->NormalTransform = _mesa_normal_tab[transform | NORM_RESCALE];
}
else {
store->NormalTransform = _mesa_normal_tab[NORM_NORMALIZE];
}
else if (!ctx->Transform.RescaleNormals &&
- ctx->_ModelViewInvScale != 1.0) {
+ ctx->_ModelViewInvScale != 1.0F) {
store->NormalTransform = _mesa_normal_tab[NORM_RESCALE];
}
else {
if (tnl->NeedNdcCoords) {
const GLfloat *dstclip = VB->ClipPtr->data[edst];
- if (dstclip[3] != 0.0) {
+ if (dstclip[3] != 0.0f) {
const GLfloat w = 1.0f / dstclip[3];
GLfloat pos[4];