Commit e7cac849 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

ddraw: Retrieve lights from the primary stateblock.

parent 7a085fce
......@@ -5579,17 +5579,17 @@ static HRESULT WINAPI d3d_device7_SetLight_FPUPreserve(IDirect3DDevice7 *iface,
static HRESULT d3d_device7_GetLight(IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
HRESULT rc;
BOOL enabled;
HRESULT hr;
TRACE("iface %p, light_idx %u, light %p.\n", iface, light_idx, light);
wined3d_mutex_lock();
/* Note: D3DLIGHT7 is compatible with struct wined3d_light. */
rc = wined3d_device_get_light(device->wined3d_device, light_idx, (struct wined3d_light *)light);
hr = wined3d_stateblock_get_light(device->state, light_idx, (struct wined3d_light *)light, &enabled);
wined3d_mutex_unlock();
/* Translate the result. WineD3D returns other values than D3D7 */
return hr_ddraw_from_wined3d(rc);
return hr_ddraw_from_wined3d(hr);
}
static HRESULT WINAPI d3d_device7_GetLight_FPUSetup(IDirect3DDevice7 *iface, DWORD light_idx, D3DLIGHT7 *light)
......@@ -6460,6 +6460,7 @@ static HRESULT WINAPI d3d_device7_LightEnable_FPUPreserve(IDirect3DDevice7 *ifac
static HRESULT d3d_device7_GetLightEnable(IDirect3DDevice7 *iface, DWORD light_idx, BOOL *enabled)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
struct wined3d_light light;
HRESULT hr;
TRACE("iface %p, light_idx %u, enabled %p.\n", iface, light_idx, enabled);
......@@ -6468,7 +6469,7 @@ static HRESULT d3d_device7_GetLightEnable(IDirect3DDevice7 *iface, DWORD light_i
return DDERR_INVALIDPARAMS;
wined3d_mutex_lock();
hr = wined3d_device_get_light_enable(device->wined3d_device, light_idx, enabled);
hr = wined3d_stateblock_get_light(device->state, light_idx, &light, enabled);
wined3d_mutex_unlock();
return hr_ddraw_from_wined3d(hr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment