summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_rasterpos.c
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-02-24 18:24:07 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-03-03 12:37:04 -0800
commita9c1b3caf67f035df83c6a4e38709cfa395f4cc6 (patch)
tree548d499762ff263d8f5a8a0d94b0d9f6cac0e506 /src/mesa/tnl/t_rasterpos.c
parent5cf2c5851bcd29c2d53bb04ab692b4b156f5a74d (diff)
tnl: Remove color-index TNL support
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/mesa/tnl/t_rasterpos.c')
-rw-r--r--src/mesa/tnl/t_rasterpos.c52
1 files changed, 15 insertions, 37 deletions
diff --git a/src/mesa/tnl/t_rasterpos.c b/src/mesa/tnl/t_rasterpos.c
index 13b84a7d77..3596d162b2 100644
--- a/src/mesa/tnl/t_rasterpos.c
+++ b/src/mesa/tnl/t_rasterpos.c
@@ -119,8 +119,7 @@ shade_rastpos(GLcontext *ctx,
const GLfloat vertex[4],
const GLfloat normal[3],
GLfloat Rcolor[4],
- GLfloat Rspec[4],
- GLfloat *Rindex)
+ GLfloat Rspec[4])
{
/*const*/ GLfloat (*base)[3] = ctx->Light._BaseColor;
const struct gl_light *light;
@@ -244,28 +243,14 @@ shade_rastpos(GLcontext *ctx,
ACC_SCALE_SCALAR_3V( specularColor, attenuation, specularContrib );
}
- if (ctx->Visual.rgbMode) {
- Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F);
- Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F);
- Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F);
- Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F);
- Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F);
- Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F);
- Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F);
- Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F);
- }
- else {
- GLfloat *ind = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_INDEXES];
- 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]
- + diffuseCI * (1.0F-specularCI) * d_a
- + specularCI * s_a);
- if (i > ind[MAT_INDEX_SPECULAR]) {
- i = ind[MAT_INDEX_SPECULAR];
- }
- *Rindex = i;
- }
+ Rcolor[0] = CLAMP(diffuseColor[0], 0.0F, 1.0F);
+ Rcolor[1] = CLAMP(diffuseColor[1], 0.0F, 1.0F);
+ Rcolor[2] = CLAMP(diffuseColor[2], 0.0F, 1.0F);
+ Rcolor[3] = CLAMP(diffuseColor[3], 0.0F, 1.0F);
+ Rspec[0] = CLAMP(specularColor[0], 0.0F, 1.0F);
+ Rspec[1] = CLAMP(specularColor[1], 0.0F, 1.0F);
+ Rspec[2] = CLAMP(specularColor[2], 0.0F, 1.0F);
+ Rspec[3] = CLAMP(specularColor[3], 0.0F, 1.0F);
}
@@ -469,21 +454,14 @@ _tnl_RasterPos(GLcontext *ctx, const GLfloat vObj[4])
/* lighting */
shade_rastpos( ctx, vObj, norm,
ctx->Current.RasterColor,
- ctx->Current.RasterSecondaryColor,
- &ctx->Current.RasterIndex );
+ ctx->Current.RasterSecondaryColor );
}
else {
- /* use current color or index */
- if (ctx->Visual.rgbMode) {
- COPY_4FV(ctx->Current.RasterColor,
- ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
- COPY_4FV(ctx->Current.RasterSecondaryColor,
- ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
- }
- else {
- ctx->Current.RasterIndex
- = ctx->Current.Attrib[VERT_ATTRIB_COLOR_INDEX][0];
- }
+ /* use current color */
+ COPY_4FV(ctx->Current.RasterColor,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
+ COPY_4FV(ctx->Current.RasterSecondaryColor,
+ ctx->Current.Attrib[VERT_ATTRIB_COLOR1]);
}
/* texture coords */