Henri Verbeet : wined3d: Properly check if an attribute is used in state_colormat().

Alexandre Julliard julliard at winehq.org
Mon Aug 24 10:08:42 CDT 2009


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Aug 24 09:27:55 2009 +0200

wined3d: Properly check if an attribute is used in state_colormat().

---

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

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 8b4eb8f..0bbd917 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1177,8 +1177,6 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, stru
 {
     IWineD3DDeviceImpl *device = stateblock->wineD3DDevice;
     GLenum Parm = 0;
-    const struct wined3d_stream_info_element *diffuse = &device->strided_streams.elements[WINED3D_FFP_DIFFUSE];
-    BOOL isDiffuseSupplied;
 
     /* Depends on the decoded vertex declaration to read the existence of diffuse data.
      * The vertex declaration will call this function if the fixed function pipeline is used.
@@ -1188,10 +1186,10 @@ static void state_colormat(DWORD state, IWineD3DStateBlockImpl *stateblock, stru
         return;
     }
 
-    isDiffuseSupplied = diffuse->data || diffuse->buffer_object;
-
     context->num_untracked_materials = 0;
-    if (isDiffuseSupplied && stateblock->renderState[WINED3DRS_COLORVERTEX]) {
+    if ((device->strided_streams.use_map & (1 << WINED3D_FFP_DIFFUSE))
+            && stateblock->renderState[WINED3DRS_COLORVERTEX])
+    {
         TRACE("diff %d, amb %d, emis %d, spec %d\n",
               stateblock->renderState[WINED3DRS_DIFFUSEMATERIALSOURCE],
               stateblock->renderState[WINED3DRS_AMBIENTMATERIALSOURCE],




More information about the wine-cvs mailing list