wined3d: Don't pass bad values to glAlphaFunc and glDepthFunc.
This commit is contained in:
parent
4c88bb84b9
commit
a39e2b51cb
|
@ -3560,7 +3560,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D
|
|||
|
||||
case WINED3DRS_ZFUNC :
|
||||
{
|
||||
int glParm = GL_LESS;
|
||||
int glParm = 0;
|
||||
|
||||
switch ((D3DCMPFUNC) Value) {
|
||||
case D3DCMP_NEVER: glParm=GL_NEVER; break;
|
||||
|
@ -3574,9 +3574,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D
|
|||
default:
|
||||
FIXME("Unrecognized/Unhandled D3DCMPFUNC value %ld\n", Value);
|
||||
}
|
||||
if(glParm) {
|
||||
glDepthFunc(glParm);
|
||||
checkGLcall("glDepthFunc");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WINED3DRS_AMBIENT :
|
||||
|
@ -3644,8 +3646,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D
|
|||
case WINED3DRS_ALPHAREF :
|
||||
case WINED3DRS_COLORKEYENABLE :
|
||||
{
|
||||
int glParm = 0.0;
|
||||
float ref = GL_LESS;
|
||||
int glParm = 0;
|
||||
float ref;
|
||||
BOOL enable_ckey = FALSE;
|
||||
|
||||
IWineD3DSurfaceImpl *surf;
|
||||
|
@ -3688,10 +3690,12 @@ static HRESULT WINAPI IWineD3DDeviceImpl_SetRenderState(IWineD3DDevice *iface, D
|
|||
FIXME("Unrecognized/Unhandled D3DCMPFUNC value %ld\n", This->stateBlock->renderState[WINED3DRS_ALPHAFUNC]);
|
||||
}
|
||||
}
|
||||
if(glParm) {
|
||||
This->alphafunc = glParm;
|
||||
glAlphaFunc(glParm, ref);
|
||||
checkGLcall("glAlphaFunc");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WINED3DRS_CLIPPLANEENABLE :
|
||||
|
|
Loading…
Reference in New Issue