}
}
} else {
- GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data;
+ GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data;
saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0];
saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0];
saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0];
*/
GLuint Count; /**< Number of vertices currently in buffer */
- /* Pointers to current data.
+ /* Pointers to current data. Most of the data is in AttribPtr -- all of
+ * it that is one of VERT_ATTRIB_X. For things only produced by TNL,
+ * such as backface color or eye-space coordinates, they are stored
+ * here.
* XXX some of these fields alias AttribPtr below and should be removed
* such as FogCoordPtr, etc.
*/
GLubyte *ClipMask; /* _TNL_BIT_POS */
GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */
GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */
- GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */
+ GLvector4f *BackfaceIndexPtr; /* _TNL_BIT_INDEX */
GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */
GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */
GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */
*/
VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
VB->ColorPtr[1] = NULL;
- VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX];
- VB->IndexPtr[1] = NULL;
+ VB->BackfaceIndexPtr = NULL;
VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1];
VB->SecondaryColorPtr[1] = NULL;
VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0];
VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0];
- VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = VB->IndexPtr[0];
return GL_TRUE;
}
fprintf(stderr, "%s\n", __FUNCTION__ );
#endif
- VB->IndexPtr[0] = &store->LitIndex[0];
+ VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = &store->LitIndex[0];
#if IDX & LIGHT_TWOSIDE
- VB->IndexPtr[1] = &store->LitIndex[1];
+ VB->BackfaceIndexPtr = &store->LitIndex[1];
#endif
- indexResult[0] = (GLfloat *)VB->IndexPtr[0]->data;
+ indexResult[0] = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]->data;
#if IDX & LIGHT_TWOSIDE
- indexResult[1] = (GLfloat *)VB->IndexPtr[1]->data;
+ indexResult[1] = (GLfloat *)VB->BackfaceIndexPtr->data;
#endif
/* loop over vertices */
VB->SecondaryColorPtr[1]->data[in] );
}
- if (VB->IndexPtr[1]) {
- VB->IndexPtr[1]->data[dst][0] = LINTERP( t,
- VB->IndexPtr[1]->data[out][0],
- VB->IndexPtr[1]->data[in][0] );
+ if (VB->BackfaceIndexPtr) {
+ VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t,
+ VB->BackfaceIndexPtr->data[out][0],
+ VB->BackfaceIndexPtr->data[in][0] );
}
if (VB->EdgeFlag) {
VB->SecondaryColorPtr[1]->data[src] );
}
- if (VB->IndexPtr[1]) {
- VB->IndexPtr[1]->data[dst][0] = VB->IndexPtr[1]->data[src][0];
+ if (VB->BackfaceIndexPtr) {
+ VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0];
}
_tnl_generic_copy_pv(ctx, dst, src);
}
}
else {
- GLfloat (*vbindex) = (GLfloat *)VB->IndexPtr[1]->data;
+ GLfloat (*vbindex) = (GLfloat *)VB->BackfaceIndexPtr->data;
if (!DO_FLAT) {
VERT_SAVE_IND( 0 );
VERT_SAVE_IND( 1 );
}
}
else {
- GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data;
+ GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data;
if (!DO_FLAT) {
VERT_SAVE_IND( 0 );
VERT_SAVE_IND( 1 );
OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX1] );
OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX2] );
OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX3] );
- OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, IndexPtr );
+ OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] );
OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr );
OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr );
OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr );