wined3d: Move WINED3DRS_ZFUNCENABLE to the state table.

This commit is contained in:
Stefan Dösinger 2006-12-08 01:44:55 +01:00 committed by Alexandre Julliard
parent 8879c7d8dd
commit 2ac48e8154
2 changed files with 11 additions and 12 deletions

View File

@ -3443,18 +3443,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, W
case WINED3DRS_SHADEMODE :
case WINED3DRS_DITHERENABLE :
case WINED3DRS_ZWRITEENABLE :
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_ZFUNC :
{
int glParm = CompareFunc(Value);
if(glParm) {
glDepthFunc(glParm);
checkGLcall("glDepthFunc");
}
}
StateTable[STATE_RENDER(State)].apply(STATE_RENDER(State), This->stateBlock);
break;
case WINED3DRS_AMBIENT :

View File

@ -195,6 +195,15 @@ static void state_zwritenable(DWORD state, IWineD3DStateBlockImpl *stateblock) {
}
}
static void state_zfunc(DWORD state, IWineD3DStateBlockImpl *stateblock) {
int glParm = CompareFunc(stateblock->renderState[WINED3DRS_ZFUNC]);
if(glParm) {
glDepthFunc(glParm);
checkGLcall("glDepthFunc");
}
}
const struct StateEntry StateTable[] =
{
/* State name representative, apply function */
@ -221,7 +230,7 @@ const struct StateEntry StateTable[] =
{ /* 20, WINED3DRS_DESTBLEND */ STATE_RENDER(WINED3DRS_ALPHABLENDENABLE), state_unknown },
{ /* 21, WINED3DRS_TEXTUREMAPBLEND */ 0 /* Handled in ddraw */, state_undefined },
{ /* 22, WINED3DRS_CULLMODE */ STATE_RENDER(WINED3DRS_CULLMODE), state_cullmode },
{ /* 23, WINED3DRS_ZFUNC */ STATE_RENDER(WINED3DRS_ZFUNC), state_unknown },
{ /* 23, WINED3DRS_ZFUNC */ STATE_RENDER(WINED3DRS_ZFUNC), state_zfunc },
{ /* 24, WINED3DRS_ALPHAREF */ STATE_RENDER(WINED3DRS_ALPHATESTENABLE), state_unknown },
{ /* 25, WINED3DRS_ALPHAFUNC */ STATE_RENDER(WINED3DRS_ALPHATESTENABLE), state_unknown },
{ /* 26, WINED3DRS_DITHERENABLE */ STATE_RENDER(WINED3DRS_DITHERENABLE), state_ditherenable },