Stefan Dösinger : wined3d: Move WINED3DRS_ZFUNCENABLE to the state table.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Dec 8 06:07:10 CST 2006
Module: wine
Branch: master
Commit: 2ac48e81541852358a7d9ec0dddd23c882f476b2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2ac48e81541852358a7d9ec0dddd23c882f476b2
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Fri Dec 8 01:44:55 2006 +0100
wined3d: Move WINED3DRS_ZFUNCENABLE to the state table.
---
dlls/wined3d/device.c | 12 +-----------
dlls/wined3d/state.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 291f795..b51f32d 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3443,18 +3443,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl
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 :
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 3f9aeec..684ff94 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -195,6 +195,15 @@ static void state_zwritenable(DWORD stat
}
}
+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 },
More information about the wine-cvs
mailing list