index wasn't being calculated correctly (result was being discarded)
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 7 Oct 2003 12:37:23 +0000 (12:37 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 7 Oct 2003 12:37:23 +0000 (12:37 +0000)
in light_ci()

src/mesa/tnl/t_vb_lighttmp.h

index db61234253f45d8d42abf620ab557ff8b2cbfae7..d1ca33d5d07b8cd150915e9058ba85a026f5d188 100644 (file)
@@ -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;