Commit f63313fe authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Fix the indentation in tex_coordindex().

The indentation here is pretty horrible. Also removes a couple of fairly useless comments.
parent 8255dde1
...@@ -3118,26 +3118,22 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine ...@@ -3118,26 +3118,22 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
* state. We do not (yet) support the WINED3DRENDERSTATE_WRAPx values, nor tie them up * state. We do not (yet) support the WINED3DRENDERSTATE_WRAPx values, nor tie them up
* to the TEXCOORDINDEX value * to the TEXCOORDINDEX value
*/ */
switch (stateblock->textureState[stage][WINED3DTSS_TEXCOORDINDEX] & 0xffff0000)
{
case WINED3DTSS_TCI_PASSTHRU:
/* Use the specified texture coordinates contained within the
* vertex format. This value resolves to zero. */
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
checkGLcall("glDisable(GL_TEXTURE_GEN_S,T,R,Q)");
break;
/* case WINED3DTSS_TCI_CAMERASPACEPOSITION:
* Be careful the value of the mask 0xF0000 come from d3d8types.h infos /* CameraSpacePosition means use the vertex position, transformed to camera space,
*/ * as the input texture coordinates for this stage's texture transformation. This
switch (stateblock->textureState[stage][WINED3DTSS_TEXCOORDINDEX] & 0xFFFF0000) { * equates roughly to EYE_LINEAR */
case WINED3DTSS_TCI_PASSTHRU:
/*Use the specified texture coordinates contained within the vertex format. This value resolves to zero.*/
glDisable(GL_TEXTURE_GEN_S);
glDisable(GL_TEXTURE_GEN_T);
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
checkGLcall("glDisable(GL_TEXTURE_GEN_S,T,R,Q)");
break;
case WINED3DTSS_TCI_CAMERASPACEPOSITION:
/* CameraSpacePosition means use the vertex position, transformed to camera space,
* as the input texture coordinates for this stage's texture transformation. This
* equates roughly to EYE_LINEAR
*/
{
TRACE("WINED3DTSS_TCI_CAMERASPACEPOSITION - Set eye plane\n"); TRACE("WINED3DTSS_TCI_CAMERASPACEPOSITION - Set eye plane\n");
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
...@@ -3162,42 +3158,46 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine ...@@ -3162,42 +3158,46 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
checkGLcall("glEnable(GL_TEXTURE_GEN_R)"); checkGLcall("glEnable(GL_TEXTURE_GEN_R)");
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR);
checkGLcall("glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR)"); checkGLcall("glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_EYE_LINEAR)");
} break;
break;
case WINED3DTSS_TCI_CAMERASPACENORMAL: case WINED3DTSS_TCI_CAMERASPACENORMAL:
{ if (!GL_SUPPORT(NV_TEXGEN_REFLECTION))
if (GL_SUPPORT(NV_TEXGEN_REFLECTION)) { {
TRACE("WINED3DTSS_TCI_CAMERASPACENORMAL - Set eye plane\n"); break;
}
glMatrixMode(GL_MODELVIEW);
glPushMatrix(); TRACE("WINED3DTSS_TCI_CAMERASPACENORMAL - Set eye plane\n");
glLoadIdentity();
glTexGenfv(GL_S, GL_EYE_PLANE, s_plane); glMatrixMode(GL_MODELVIEW);
glTexGenfv(GL_T, GL_EYE_PLANE, t_plane); glPushMatrix();
glTexGenfv(GL_R, GL_EYE_PLANE, r_plane); glLoadIdentity();
glTexGenfv(GL_Q, GL_EYE_PLANE, q_plane); glTexGenfv(GL_S, GL_EYE_PLANE, s_plane);
glPopMatrix(); glTexGenfv(GL_T, GL_EYE_PLANE, t_plane);
glTexGenfv(GL_R, GL_EYE_PLANE, r_plane);
glEnable(GL_TEXTURE_GEN_S); glTexGenfv(GL_Q, GL_EYE_PLANE, q_plane);
checkGLcall("glEnable(GL_TEXTURE_GEN_S)"); glPopMatrix();
glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
checkGLcall("glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV)"); glEnable(GL_TEXTURE_GEN_S);
glEnable(GL_TEXTURE_GEN_T); checkGLcall("glEnable(GL_TEXTURE_GEN_S)");
checkGLcall("glEnable(GL_TEXTURE_GEN_T)"); glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV); checkGLcall("glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV)");
checkGLcall("glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV)"); glEnable(GL_TEXTURE_GEN_T);
glEnable(GL_TEXTURE_GEN_R); checkGLcall("glEnable(GL_TEXTURE_GEN_T)");
checkGLcall("glEnable(GL_TEXTURE_GEN_R)"); glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV); checkGLcall("glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV)");
checkGLcall("glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV)"); glEnable(GL_TEXTURE_GEN_R);
checkGLcall("glEnable(GL_TEXTURE_GEN_R)");
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV);
checkGLcall("glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_NORMAL_MAP_NV)");
break;
case WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR:
if (!GL_SUPPORT(NV_TEXGEN_REFLECTION))
{
break;
} }
}
break;
case WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR:
{
if (GL_SUPPORT(NV_TEXGEN_REFLECTION)) {
TRACE("WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR - Set eye plane\n"); TRACE("WINED3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR - Set eye plane\n");
glMatrixMode(GL_MODELVIEW); glMatrixMode(GL_MODELVIEW);
...@@ -3221,20 +3221,16 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine ...@@ -3221,20 +3221,16 @@ static void tex_coordindex(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
checkGLcall("glEnable(GL_TEXTURE_GEN_R)"); checkGLcall("glEnable(GL_TEXTURE_GEN_R)");
glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_NV); glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_NV);
checkGLcall("glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_NV)"); checkGLcall("glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP_NV)");
}
} break;
break;
default:
/* Unhandled types: */ glDisable(GL_TEXTURE_GEN_S);
default: glDisable(GL_TEXTURE_GEN_T);
/* Todo: */ glDisable(GL_TEXTURE_GEN_R);
/* ? disable GL_TEXTURE_GEN_n ? */ glDisable(GL_TEXTURE_GEN_Q);
glDisable(GL_TEXTURE_GEN_S); FIXME("Unhandled WINED3DTSS_TEXCOORDINDEX %x\n", stateblock->textureState[stage][WINED3DTSS_TEXCOORDINDEX]);
glDisable(GL_TEXTURE_GEN_T); break;
glDisable(GL_TEXTURE_GEN_R);
glDisable(GL_TEXTURE_GEN_Q);
FIXME("Unhandled WINED3DTSS_TEXCOORDINDEX %x\n", stateblock->textureState[stage][WINED3DTSS_TEXCOORDINDEX]);
break;
} }
/* Update the texture matrix */ /* Update the texture matrix */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment