| GLfloat (*f)[3] = store->tmp_f; | GLfloat (*f)[3] = store->tmp_f; | ||||
| GLfloat *m = store->tmp_m; | GLfloat *m = store->tmp_m; | ||||
| /* _mesa_debug(NULL, "%s normstride %d eyestride %d\n", */ | /* _mesa_debug(NULL, "%s normstride %d eyestride %d\n", */ | ||||
| /* __FUNCTION__, VB->NormalPtr->stride, */ | /* __FUNCTION__, VB->NormalPtr->stride, */ | ||||
| /* VB->EyePtr->stride); */ | /* VB->EyePtr->stride); */ | ||||
| struct vertex_buffer *VB = &tnl->vb; | struct vertex_buffer *VB = &tnl->vb; | ||||
| GLvector4f *in = VB->TexCoordPtr[unit]; | GLvector4f *in = VB->TexCoordPtr[unit]; | ||||
| GLvector4f *out = &store->texcoord[unit]; | GLvector4f *out = &store->texcoord[unit]; | ||||
| struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; | |||||
| const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; | |||||
| const GLvector4f *obj = VB->ObjPtr; | const GLvector4f *obj = VB->ObjPtr; | ||||
| const GLvector4f *eye = VB->EyePtr; | const GLvector4f *eye = VB->EyePtr; | ||||
| const GLvector4f *normal = VB->NormalPtr; | const GLvector4f *normal = VB->NormalPtr; | ||||
| const GLfloat *m = store->tmp_m; | |||||
| const GLuint count = VB->Count; | |||||
| GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data; | GLfloat (*texcoord)[4] = (GLfloat (*)[4])out->data; | ||||
| GLfloat *indata; | |||||
| GLuint count = VB->Count; | |||||
| GLfloat (*f)[3] = store->tmp_f; | GLfloat (*f)[3] = store->tmp_f; | ||||
| GLfloat *m = store->tmp_m; | |||||
| GLuint holes = 0; | GLuint holes = 0; | ||||
| if (texUnit->_GenFlags & TEXGEN_NEED_M) { | if (texUnit->_GenFlags & TEXGEN_NEED_M) { | ||||
| build_m_tab[in->size]( store->tmp_f, store->tmp_m, normal, eye ); | |||||
| build_m_tab[eye->size]( store->tmp_f, store->tmp_m, normal, eye ); | |||||
| } else if (texUnit->_GenFlags & TEXGEN_NEED_F) { | } else if (texUnit->_GenFlags & TEXGEN_NEED_F) { | ||||
| build_f_tab[in->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); | |||||
| build_f_tab[eye->size]( (GLfloat *)store->tmp_f, 3, normal, eye ); | |||||
| } | } | ||||
| if (!in) { | if (!in) { | ||||
| texUnit->EyePlaneS ); | texUnit->EyePlaneS ); | ||||
| break; | break; | ||||
| case GL_SPHERE_MAP: | case GL_SPHERE_MAP: | ||||
| for (indata=in->start,i=0 ; i<count ;i++, STRIDE_F(indata,in->stride)) | |||||
| texcoord[i][0] = indata[0] * m[i] + 0.5F; | |||||
| for (i = 0; i < count; i++) | |||||
| texcoord[i][0] = f[i][0] * m[i] + 0.5F; | |||||
| break; | break; | ||||
| case GL_REFLECTION_MAP_NV: | case GL_REFLECTION_MAP_NV: | ||||
| for (i=0;i<count;i++) | for (i=0;i<count;i++) | ||||
| texUnit->EyePlaneT ); | texUnit->EyePlaneT ); | ||||
| break; | break; | ||||
| case GL_SPHERE_MAP: | case GL_SPHERE_MAP: | ||||
| for (indata=in->start,i=0; i<count ;i++,STRIDE_F(indata,in->stride)) | |||||
| texcoord[i][1] = indata[1] * m[i] + 0.5F; | |||||
| for (i = 0; i < count; i++) | |||||
| texcoord[i][1] = f[i][1] * m[i] + 0.5F; | |||||
| break; | break; | ||||
| case GL_REFLECTION_MAP_NV: | case GL_REFLECTION_MAP_NV: | ||||
| for (i=0;i<count;i++) | for (i=0;i<count;i++) | ||||
| store->TexgenSize[i] = sz; | store->TexgenSize[i] = sz; | ||||
| store->TexgenHoles[i] = (all_bits[sz] & ~texUnit->TexGenEnabled); | store->TexgenHoles[i] = (all_bits[sz] & ~texUnit->TexGenEnabled); | ||||
| store->TexgenFunc[i] = texgen; | |||||
| store->TexgenFunc[i] = texgen; /* general solution */ | |||||
| /* look for special texgen cases */ | |||||
| if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT)) { | if (texUnit->TexGenEnabled == (S_BIT|T_BIT|R_BIT)) { | ||||
| if (texUnit->_GenFlags == TEXGEN_REFLECTION_MAP_NV) { | if (texUnit->_GenFlags == TEXGEN_REFLECTION_MAP_NV) { | ||||
| store->TexgenFunc[i] = texgen_reflection_map_nv; | store->TexgenFunc[i] = texgen_reflection_map_nv; |