-/* $Id: light.c,v 1.43 2001/04/28 08:39:17 keithw Exp $ */
+/* $Id: light.c,v 1.44 2001/05/09 12:24:51 keithw Exp $ */
/*
* Mesa 3-D graphics library
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
- UNCLAMPED_FLOAT_TO_CHAN(ctx->Light._BaseAlpha[0], mat->Diffuse[3]);
+ ctx->Light._BaseAlpha[0] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
if (bitmask & BACK_DIFFUSE_BIT) {
struct gl_material *mat = &ctx->Light.Material[1];
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
- UNCLAMPED_FLOAT_TO_CHAN(ctx->Light._BaseAlpha[1], mat->Diffuse[3]);
+ ctx->Light._BaseAlpha[1] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
/* update material specular values */
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[0], light->Diffuse, mat->Diffuse );
}
- UNCLAMPED_FLOAT_TO_CHAN(ctx->Light._BaseAlpha[0], mat->Diffuse[3]);
+ ctx->Light._BaseAlpha[0] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
if (bitmask & BACK_DIFFUSE_BIT) {
foreach (light, list) {
SCALE_3V( light->_MatDiffuse[1], light->Diffuse, mat->Diffuse );
}
- UNCLAMPED_FLOAT_TO_CHAN(ctx->Light._BaseAlpha[1], mat->Diffuse[3]);
+ ctx->Light._BaseAlpha[1] = CLAMP( mat->Diffuse[3], 0.0, 1.0 );
}
/* update light->_MatSpecular = light's specular * material's specular */
ctx->Light.Model.Ambient,
mat->Ambient);
- UNCLAMPED_FLOAT_TO_CHAN(ctx->Light._BaseAlpha[side],
- ctx->Light.Material[side].Diffuse[3] );
+ ctx->Light._BaseAlpha[side] =
+ CLAMP( ctx->Light.Material[side].Diffuse[3], 0.0, 1.0 );
}
foreach (light, &ctx->Light.EnabledList) {