From 206d248e4864f5ece30ea9295e0639959f5905dc Mon Sep 17 00:00:00 2001 From: Ivan Gyurdiev Date: Sun, 29 Oct 2006 21:44:58 -0500 Subject: [PATCH] wined3d: Add D3DCMPFUNC to the WINED3D namespace. --- dlls/wined3d/stateblock.c | 8 ++++---- dlls/wined3d/utils.c | 20 ++++++++++---------- include/wine/wined3d_types.h | 13 +++++++++++++ 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 15d8cce6948..30389057cab 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -854,8 +854,8 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat IWineD3DDevice_SetRenderState(device, WINED3DRS_SRCBLEND, WINED3DBLEND_ONE); IWineD3DDevice_SetRenderState(device, WINED3DRS_DESTBLEND, WINED3DBLEND_ZERO); IWineD3DDevice_SetRenderState(device, WINED3DRS_CULLMODE, WINED3DCULL_CCW); - IWineD3DDevice_SetRenderState(device, WINED3DRS_ZFUNC, D3DCMP_LESSEQUAL); - IWineD3DDevice_SetRenderState(device, WINED3DRS_ALPHAFUNC, D3DCMP_ALWAYS); + IWineD3DDevice_SetRenderState(device, WINED3DRS_ZFUNC, WINED3DCMP_LESSEQUAL); + IWineD3DDevice_SetRenderState(device, WINED3DRS_ALPHAFUNC, WINED3DCMP_ALWAYS); IWineD3DDevice_SetRenderState(device, WINED3DRS_ALPHAREF, 0); IWineD3DDevice_SetRenderState(device, WINED3DRS_DITHERENABLE, FALSE); IWineD3DDevice_SetRenderState(device, WINED3DRS_ALPHABLENDENABLE, FALSE); @@ -886,7 +886,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat */ This->renderState[WINED3DRS_STENCILREF] = 0; This->renderState[WINED3DRS_STENCILMASK] = 0xFFFFFFFF; - IWineD3DDevice_SetRenderState(device, WINED3DRS_STENCILFUNC, D3DCMP_ALWAYS); + IWineD3DDevice_SetRenderState(device, WINED3DRS_STENCILFUNC, WINED3DCMP_ALWAYS); IWineD3DDevice_SetRenderState(device, WINED3DRS_STENCILWRITEMASK, 0xFFFFFFFF); IWineD3DDevice_SetRenderState(device, WINED3DRS_TEXTUREFACTOR, 0xFFFFFFFF); IWineD3DDevice_SetRenderState(device, WINED3DRS_WRAP0, 0); @@ -957,7 +957,7 @@ static HRESULT WINAPI IWineD3DStateBlockImpl_InitStartupStateBlock(IWineD3DStat IWineD3DDevice_SetRenderState(device, WINED3DRS_CCW_STENCILFAIL, WINED3DSTENCILOP_KEEP); IWineD3DDevice_SetRenderState(device, WINED3DRS_CCW_STENCILZFAIL, WINED3DSTENCILOP_KEEP); IWineD3DDevice_SetRenderState(device, WINED3DRS_CCW_STENCILPASS, WINED3DSTENCILOP_KEEP); - IWineD3DDevice_SetRenderState(device, WINED3DRS_CCW_STENCILFUNC, D3DCMP_ALWAYS); + IWineD3DDevice_SetRenderState(device, WINED3DRS_CCW_STENCILFUNC, WINED3DCMP_ALWAYS); IWineD3DDevice_SetRenderState(device, WINED3DRS_COLORWRITEENABLE1, 0x0000000F); IWineD3DDevice_SetRenderState(device, WINED3DRS_COLORWRITEENABLE2, 0x0000000F); IWineD3DDevice_SetRenderState(device, WINED3DRS_COLORWRITEENABLE3, 0x0000000F); diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 3a29e9d83f6..398f37d17a4 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -666,17 +666,17 @@ GLenum StencilOp(DWORD op) { } GLenum CompareFunc(DWORD func) { - switch ((D3DCMPFUNC)func) { - case D3DCMP_NEVER : return GL_NEVER; - case D3DCMP_LESS : return GL_LESS; - case D3DCMP_EQUAL : return GL_EQUAL; - case D3DCMP_LESSEQUAL : return GL_LEQUAL; - case D3DCMP_GREATER : return GL_GREATER; - case D3DCMP_NOTEQUAL : return GL_NOTEQUAL; - case D3DCMP_GREATEREQUAL : return GL_GEQUAL; - case D3DCMP_ALWAYS : return GL_ALWAYS; + switch ((WINED3DCMPFUNC)func) { + case WINED3DCMP_NEVER : return GL_NEVER; + case WINED3DCMP_LESS : return GL_LESS; + case WINED3DCMP_EQUAL : return GL_EQUAL; + case WINED3DCMP_LESSEQUAL : return GL_LEQUAL; + case WINED3DCMP_GREATER : return GL_GREATER; + case WINED3DCMP_NOTEQUAL : return GL_NOTEQUAL; + case WINED3DCMP_GREATEREQUAL : return GL_GEQUAL; + case WINED3DCMP_ALWAYS : return GL_ALWAYS; default: - FIXME("Unrecognized D3DCMPFUNC value %d\n", func); + FIXME("Unrecognized WINED3DCMPFUNC value %d\n", func); return 0; } } diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h index 59dfb4c4520..8b72a7b6208 100644 --- a/include/wine/wined3d_types.h +++ b/include/wine/wined3d_types.h @@ -480,6 +480,19 @@ typedef enum _WINED3DVERTEXBLENDFLAGS { WINED3DVBF_0WEIGHTS = 256 } WINED3DVERTEXBLENDFLAGS; +typedef enum _WINED3DCMPFUNC { + WINED3DCMP_NEVER = 1, + WINED3DCMP_LESS = 2, + WINED3DCMP_EQUAL = 3, + WINED3DCMP_LESSEQUAL = 4, + WINED3DCMP_GREATER = 5, + WINED3DCMP_NOTEQUAL = 6, + WINED3DCMP_GREATEREQUAL = 7, + WINED3DCMP_ALWAYS = 8, + + WINED3DCMP_FORCE_DWORD = 0x7fffffff +} WINED3DCMPFUNC; + typedef enum _WINED3DZBUFFERTYPE { WINED3DZB_FALSE = 0, WINED3DZB_TRUE = 1, -- 2.11.4.GIT