From 91a615ee4dc4efb7ef9929d6422421ccd2f039e4 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 29 Apr 2014 22:02:46 +0200 Subject: [PATCH] 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 88142a95406..925d97ecd1e 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); }