From 0914a2f2af31f118d9ab5f3eac438604de6baf18 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Wed, 13 Nov 2019 21:47:50 -0600 Subject: [PATCH] ddraw: Handle stateblocks in d3d_device7_SetLight(). Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- dlls/ddraw/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c index e2643e6589d..55a9c6b6a18 100644 --- a/dlls/ddraw/device.c +++ b/dlls/ddraw/device.c @@ -5545,7 +5545,9 @@ static HRESULT d3d_device7_SetLight(IDirect3DDevice7 *iface, DWORD light_idx, D3 wined3d_mutex_lock(); /* Note: D3DLIGHT7 is compatible with struct wined3d_light. */ - hr = wined3d_device_set_light(device->wined3d_device, light_idx, (struct wined3d_light *)light); + hr = wined3d_stateblock_set_light(device->update_state, light_idx, (const struct wined3d_light *)light); + if (SUCCEEDED(hr) && !device->recording) + hr = wined3d_device_set_light(device->wined3d_device, light_idx, (const struct wined3d_light *)light); wined3d_mutex_unlock(); return hr_ddraw_from_wined3d(hr);