summaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl/t_save_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/tnl/t_save_api.c')
-rw-r--r--src/mesa/tnl/t_save_api.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
index 5765652b7e0..8625142e16e 100644
--- a/src/mesa/tnl/t_save_api.c
+++ b/src/mesa/tnl/t_save_api.c
@@ -371,7 +371,8 @@ static void _save_copy_to_current( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint i;
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++) {
+ /* XXX Use _TNL_FIRST_* and _TNL_LAST_* values instead? */
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++) {
if (tnl->save.attrsz[i]) {
tnl->save.currentsz[i][0] = tnl->save.attrsz[i];
COPY_CLEAN_4V(tnl->save.current[i],
@@ -399,7 +400,7 @@ static void _save_copy_from_current( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLint i;
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_INDEX ; i++)
+ for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++)
switch (tnl->save.attrsz[i]) {
case 4: tnl->save.attrptr[i][3] = tnl->save.current[i][3];
case 3: tnl->save.attrptr[i][2] = tnl->save.current[i][2];
@@ -1173,19 +1174,15 @@ static void GLAPIENTRY _save_EdgeFlag( GLboolean b )
IDX_ATTR( _TNL_ATTRIB_EDGEFLAG, (GLfloat)b );
}
-static void GLAPIENTRY _save_EdgeFlagv( const GLboolean *v )
-{
- IDX_ATTR( _TNL_ATTRIB_EDGEFLAG, (GLfloat)(v[0]) );
-}
static void GLAPIENTRY _save_Indexf( GLfloat f )
{
- IDX_ATTR( _TNL_ATTRIB_INDEX, f );
+ IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f );
}
static void GLAPIENTRY _save_Indexfv( const GLfloat *f )
{
- IDX_ATTR( _TNL_ATTRIB_INDEX, f[0] );
+ IDX_ATTR( _TNL_ATTRIB_COLOR_INDEX, f[0] );
}
@@ -1467,7 +1464,6 @@ static void _save_vtxfmt_init( GLcontext *ctx )
vfmt->Color4f = _save_Color4f;
vfmt->Color4fv = _save_Color4fv;
vfmt->EdgeFlag = _save_EdgeFlag;
- vfmt->EdgeFlagv = _save_EdgeFlagv;
vfmt->End = _save_End;
vfmt->FogCoordfEXT = _save_FogCoordfEXT;
vfmt->FogCoordfvEXT = _save_FogCoordfvEXT;
@@ -1652,16 +1648,13 @@ static void _save_current_init( GLcontext *ctx )
tnl->save.current[i] = ctx->ListState.CurrentAttrib[i];
}
- for (i = _TNL_ATTRIB_MAT_FRONT_AMBIENT; i < _TNL_ATTRIB_INDEX; i++) {
- const GLuint j = i - _TNL_ATTRIB_MAT_FRONT_AMBIENT;
+ for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) {
+ const GLuint j = i - _TNL_FIRST_MAT;
ASSERT(j < MAT_ATTRIB_MAX);
tnl->save.currentsz[i] = &ctx->ListState.ActiveMaterialSize[j];
tnl->save.current[i] = ctx->ListState.CurrentMaterial[j];
}
- tnl->save.currentsz[_TNL_ATTRIB_INDEX] = &ctx->ListState.ActiveIndex;
- tnl->save.current[_TNL_ATTRIB_INDEX] = &ctx->ListState.CurrentIndex;
-
tnl->save.currentsz[_TNL_ATTRIB_EDGEFLAG] = &ctx->ListState.ActiveEdgeFlag;
tnl->save.current[_TNL_ATTRIB_EDGEFLAG] = &tnl->save.CurrentFloatEdgeFlag;
}