Stefan Dösinger : wined3d: Disable two sided stencil if it is supported, but not enabled.

Alexandre Julliard julliard at winehq.org
Wed Sep 19 08:16:15 CDT 2007


Module: wine
Branch: master
Commit: 145d56847bcdea75669d541ea79931cc023293a0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=145d56847bcdea75669d541ea79931cc023293a0

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Fri Sep 14 12:02:56 2007 +0200

wined3d: Disable two sided stencil if it is supported, but not enabled.

---

 dlls/wined3d/state.c |   25 ++++++++++++++-----------
 1 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index ce8b07d..77b728e 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -694,18 +694,21 @@ state_stencil(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *c
 
         renderstate_stencil_twosided(stateblock, GL_FRONT, func, ref, mask, stencilFail, depthFail, stencilPass);
         renderstate_stencil_twosided(stateblock, GL_BACK, func_ccw, ref, mask, stencilFail_ccw, depthFail_ccw, stencilPass_ccw);
-    } else {
-        if (onesided_enable) {
-            glEnable(GL_STENCIL_TEST);
-            checkGLcall("glEnable GL_STENCIL_TEST");
-            glStencilFunc(func, ref, mask);
-            checkGLcall("glStencilFunc(...)");
-            glStencilOp(stencilFail, depthFail, stencilPass);
-            checkGLcall("glStencilOp(...)");
-        } else {
-            glDisable(GL_STENCIL_TEST);
-            checkGLcall("glDisable GL_STENCIL_TEST");
+    } else if(onesided_enable) {
+        if(GL_SUPPORT(EXT_STENCIL_TWO_SIDE)) {
+            glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT);
+            checkGLcall("glDisable(GL_STENCIL_TEST_TWO_SIDE_EXT)");
         }
+
+        glEnable(GL_STENCIL_TEST);
+        checkGLcall("glEnable GL_STENCIL_TEST");
+        glStencilFunc(func, ref, mask);
+        checkGLcall("glStencilFunc(...)");
+        glStencilOp(stencilFail, depthFail, stencilPass);
+        checkGLcall("glStencilOp(...)");
+    } else {
+        glDisable(GL_STENCIL_TEST);
+        checkGLcall("glDisable GL_STENCIL_TEST");
     }
 }
 




More information about the wine-cvs mailing list