summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2003-10-07 12:37:23 +0000
committerKeith Whitwell <[email protected]>2003-10-07 12:37:23 +0000
commit4e5b58f48382862922dbc387080bfb2378a43b47 (patch)
treeda7cdbae35b508b73539cf7e4db30cfd3c780c4e /src
parenta4fc8035f154c4c24b263f629308a0a659ce4563 (diff)
index wasn't being calculated correctly (result was being discarded)
in light_ci()
Diffstat (limited to 'src')
-rw-r--r--src/mesa/tnl/t_vb_lighttmp.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h
index db61234253f..d1ca33d5d07 100644
--- a/src/mesa/tnl/t_vb_lighttmp.h
+++ b/src/mesa/tnl/t_vb_lighttmp.h
@@ -962,11 +962,12 @@ static void TAG(light_ci)( GLcontext *ctx,
else {
GLfloat d_a = ind[MAT_INDEX_DIFFUSE] - ind[MAT_INDEX_AMBIENT];
GLfloat s_a = ind[MAT_INDEX_SPECULAR] - ind[MAT_INDEX_AMBIENT];
- GLfloat i = (ind[MAT_INDEX_AMBIENT]
- + diffuse[side] * (1.0F-specular[side]) * d_a
- + specular[side] * s_a);
- if (i > ind[MAT_INDEX_SPECULAR]) {
- i = ind[MAT_INDEX_SPECULAR];
+
+ index = (ind[MAT_INDEX_AMBIENT]
+ + diffuse[side] * (1.0F-specular[side]) * d_a
+ + specular[side] * s_a);
+ if (index > ind[MAT_INDEX_SPECULAR]) {
+ index = ind[MAT_INDEX_SPECULAR];
}
}
indexResult[side][j] = (GLuint) (GLint) index;