From 4e5b58f48382862922dbc387080bfb2378a43b47 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 7 Oct 2003 12:37:23 +0000 Subject: [PATCH] index wasn't being calculated correctly (result was being discarded) in light_ci() --- src/mesa/tnl/t_vb_lighttmp.h | 11 ++++++----- 1 file 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; -- 2.30.2