wined3d: Move WINED3DRS_ZENABLE to the state table.

This commit is contained in:
Stefan Dösinger 2006-12-08 01:40:51 +01:00 committed by Alexandre Julliard
parent 53e788956a
commit bb564dc6fa
2 changed files with 22 additions and 21 deletions

View File

@ -3438,27 +3438,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
switch (State) {
case WINED3DRS_FILLMODE :
case WINED3DRS_LIGHTING :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_ZENABLE :
switch ((WINED3DZBUFFERTYPE) Value) {
case WINED3DZB_FALSE:
glDisable(GL_DEPTH_TEST);
checkGLcall("glDisable GL_DEPTH_TEST");
break;
case WINED3DZB_TRUE:
glEnable(GL_DEPTH_TEST);
checkGLcall("glEnable GL_DEPTH_TEST");
break;
case WINED3DZB_USEW:
glEnable(GL_DEPTH_TEST);
checkGLcall("glEnable GL_DEPTH_TEST");
FIXME("W buffer is not well handled\n");
break;
default:
FIXME("Unrecognized WINED3DZBUFFERTYPE value %d\n", Value);
}
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_CULLMODE :

View File

@ -94,6 +94,26 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
static void state_zenable(DWORD state, IWineD3DStateBlockImpl *stateblock) {
switch ((WINED3DZBUFFERTYPE) stateblock->renderState[WINED3DRS_ZENABLE]) {
case WINED3DZB_FALSE:
glDisable(GL_DEPTH_TEST);
checkGLcall("glDisable GL_DEPTH_TEST");
break;
case WINED3DZB_TRUE:
glEnable(GL_DEPTH_TEST);
checkGLcall("glEnable GL_DEPTH_TEST");
break;
case WINED3DZB_USEW:
glEnable(GL_DEPTH_TEST);
checkGLcall("glEnable GL_DEPTH_TEST");
FIXME("W buffer is not well handled\n");
break;
default:
FIXME("Unrecognized D3DZBUFFERTYPE value %d\n", stateblock->renderState[WINED3DRS_ZENABLE]);
}
}
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
@ -104,7 +124,7 @@ const struct StateEntry StateTable[] =
{ /* 4, WINED3DRS_TEXTUREPERSPECTIVE */ STATE_RENDER(WINED3DRS_TEXTUREPERSPECTIVE), state_unknown },
{ /* 5, WINED3DRS_WRAPU */ STATE_RENDER(WINED3DRS_WRAPU), state_unknown },
{ /* 6, WINED3DRS_WRAPV */ STATE_RENDER(WINED3DRS_WRAPV), state_unknown },
{ /* 7, WINED3DRS_ZENABLE */ STATE_RENDER(WINED3DRS_ZENABLE), state_unknown },
{ /* 7, WINED3DRS_ZENABLE */ STATE_RENDER(WINED3DRS_ZENABLE), state_zenable },
{ /* 8, WINED3DRS_FILLMODE */ STATE_RENDER(WINED3DRS_FILLMODE), state_fillmode },
{ /* 9, WINED3DRS_SHADEMODE */ STATE_RENDER(WINED3DRS_SHADEMODE), state_unknown },
{ /* 10, WINED3DRS_LINEPATTERN */ STATE_RENDER(WINED3DRS_LINEPATTERN), state_unknown },