summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2001-05-09 12:24:51 +0000
committerKeith Whitwell <[email protected]>2001-05-09 12:24:51 +0000
commit0a716cdff834624b95832f200446b6a3fe36789c (patch)
tree3605767fa205656563685ad9fd334e03bf93cb14 /src/mesa/main/light.c
parent0ff31445f20238112c4ee840901e5e5fe9b4c314 (diff)
Don't scale basealpha by 255 now it's a float.
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index 0b79afa415e..6a0619c62c9 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $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
@@ -664,7 +664,7 @@ void _mesa_update_material( GLcontext *ctx,
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];
@@ -672,7 +672,7 @@ void _mesa_update_material( GLcontext *ctx,
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 */
@@ -801,7 +801,7 @@ void _mesa_update_color_material( GLcontext *ctx,
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) {
@@ -810,7 +810,7 @@ void _mesa_update_color_material( GLcontext *ctx,
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 */
@@ -1217,8 +1217,8 @@ _mesa_update_lighting( GLcontext *ctx )
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) {