H. Verbeet : wined3d: Don' t set Parm when isDiffuseSupplied is FALSE in state_colormat(), it isn' t used anyway.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Jan 18 06:45:03 CST 2007


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Wed Jan 17 21:41:21 2007 +0100

wined3d: Don't set Parm when isDiffuseSupplied is FALSE in state_colormat(), it isn't used anyway.

---

 dlls/wined3d/state.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 8d74006..b0f74c7 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -812,7 +812,7 @@ static void state_fogdensity(DWORD state
 
 /* TODO: Merge with primitive type + init_materials()!! */
 static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock) {
-    GLenum Parm = -1;
+    GLenum Parm = 0;
     WineDirect3DStridedData *diffuse = &stateblock->wineD3DDevice->strided_streams.u.s.diffuse;
     BOOL isDiffuseSupplied;
 
@@ -825,7 +825,7 @@ static void state_colormat(DWORD state,
 
     isDiffuseSupplied = diffuse->lpData || diffuse->VBO;
 
-    if (stateblock->renderState[WINED3DRS_COLORVERTEX]) {
+    if (isDiffuseSupplied && stateblock->renderState[WINED3DRS_COLORVERTEX]) {
         TRACE("diff %d, amb %d, emis %d, spec %d\n",
               stateblock->renderState[WINED3DRS_DIFFUSEMATERIALSOURCE],
               stateblock->renderState[WINED3DRS_AMBIENTMATERIALSOURCE],
@@ -847,7 +847,7 @@ static void state_colormat(DWORD state,
         }
     }
 
-    if(Parm == -1 || !isDiffuseSupplied) {
+    if(!Parm) {
         glDisable(GL_COLOR_MATERIAL);
         checkGLcall("glDisable GL_COLOR_MATERIAL");
     } else {




More information about the wine-cvs mailing list