Henri Verbeet : ddraw: Disable lighting when a 0 material handle is set.

Alexandre Julliard julliard at winehq.org
Wed Apr 30 13:32:51 CDT 2014


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

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Apr 29 22:02:46 2014 +0200

ddraw: Disable lighting when a 0 material handle is set.

---

 dlls/ddraw/device.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 88142a9..925d97e 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -3571,15 +3571,11 @@ static HRESULT WINAPI d3d_device7_DrawPrimitive_FPUPreserve(IDirect3DDevice7 *if
 
 static void setup_lighting(const struct d3d_device *device, DWORD fvf, DWORD flags)
 {
-    BOOL enable;
+    BOOL enable = TRUE;
 
     /* Ignore the D3DFVF_XYZRHW case here, wined3d takes care of that */
-    if (flags & D3DDP_DONOTLIGHT)
+    if (!device->material || !(fvf & D3DFVF_NORMAL) || (flags & D3DDP_DONOTLIGHT))
         enable = FALSE;
-    else if (!(fvf & D3DFVF_NORMAL))
-        enable = FALSE;
-    else
-        enable = TRUE;
 
     wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_LIGHTING, enable);
 }




More information about the wine-cvs mailing list