Chris Robinson : wined3d: Don'
t pass bad values to glAlphaFunc and glDepthFunc.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Aug 21 05:58:58 CDT 2006
Module: wine
Branch: master
Commit: a39e2b51cb78a2c0008b3be3d3f93ed303c9636f
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=a39e2b51cb78a2c0008b3be3d3f93ed303c9636f
Author: Chris Robinson <chris.kcat at gmail.com>
Date: Sun Aug 20 16:26:39 2006 -0700
wined3d: Don't pass bad values to glAlphaFunc and glDepthFunc.
---
dlls/wined3d/device.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index f0e7f26..27791b6 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3560,7 +3560,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl
case WINED3DRS_ZFUNC :
{
- int glParm = GL_LESS;
+ int glParm = 0;
switch ((D3DCMPFUNC) Value) {
case D3DCMP_NEVER: glParm=GL_NEVER; break;
@@ -3574,8 +3574,10 @@ static HRESULT WINAPI IWineD3DDeviceImpl
default:
FIXME("Unrecognized/Unhandled D3DCMPFUNC value %ld\n", Value);
}
- glDepthFunc(glParm);
- checkGLcall("glDepthFunc");
+ if(glParm) {
+ glDepthFunc(glParm);
+ checkGLcall("glDepthFunc");
+ }
}
break;
@@ -3644,8 +3646,8 @@ static HRESULT WINAPI IWineD3DDeviceImpl
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,9 +3690,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl
FIXME("Unrecognized/Unhandled D3DCMPFUNC value %ld\n", This->stateBlock->renderState[WINED3DRS_ALPHAFUNC]);
}
}
- This->alphafunc = glParm;
- glAlphaFunc(glParm, ref);
- checkGLcall("glAlphaFunc");
+ if(glParm) {
+ This->alphafunc = glParm;
+ glAlphaFunc(glParm, ref);
+ checkGLcall("glAlphaFunc");
+ }
}
break;
More information about the wine-cvs
mailing list