wined3d: Simplify the "transformed" check in state_lighting().

Henri Verbeet hverbeet at codeweavers.com
Thu Mar 26 04:43:40 CDT 2009


It doesn't really matter if lighting is enabled or not if we don't have
position data.
---
 dlls/wined3d/state.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 6035c71..ab18459 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -81,8 +81,6 @@ static void state_fillmode(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
 }
 
 static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DContext *context) {
-    BOOL transformed;
-
     /* Lighting is not enabled if transformed vertices are drawn
      * but lighting does not affect the stream sources, so it is not grouped for performance reasons.
      * This state reads the decoded vertex declaration, so if it is dirty don't do anything. The
@@ -93,11 +91,9 @@ static void state_lighting(DWORD state, IWineD3DStateBlockImpl *stateblock, Wine
         return;
     }
 
-    transformed = ((stateblock->wineD3DDevice->strided_streams.u.s.position.lpData != NULL ||
-                    stateblock->wineD3DDevice->strided_streams.u.s.position.VBO != 0) &&
-                    stateblock->wineD3DDevice->strided_streams.position_transformed) ? TRUE : FALSE;
-
-    if (stateblock->renderState[WINED3DRS_LIGHTING] && !transformed) {
+    if (stateblock->renderState[WINED3DRS_LIGHTING]
+            && !stateblock->wineD3DDevice->strided_streams.position_transformed)
+    {
         glEnable(GL_LIGHTING);
         checkGLcall("glEnable GL_LIGHTING");
     } else {
-- 
1.6.0.6



--------------030807050901010703050301--



More information about the wine-patches mailing list