ddraw: Don't return an error when setting a 0 material handle in d3d_device3_SetLightState().
This commit is contained in:
parent
77da84b06a
commit
56d7e3b9a7
|
@ -2945,16 +2945,19 @@ static HRESULT WINAPI d3d_device3_SetLightState(IDirect3DDevice3 *iface,
|
||||||
wined3d_mutex_lock();
|
wined3d_mutex_lock();
|
||||||
if (state == D3DLIGHTSTATE_MATERIAL)
|
if (state == D3DLIGHTSTATE_MATERIAL)
|
||||||
{
|
{
|
||||||
struct d3d_material *m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL);
|
if (value)
|
||||||
if (!m)
|
{
|
||||||
|
struct d3d_material *m;
|
||||||
|
|
||||||
|
if (!(m = ddraw_get_object(&device->handle_table, value - 1, DDRAW_HANDLE_MATERIAL)))
|
||||||
{
|
{
|
||||||
WARN("Invalid material handle.\n");
|
WARN("Invalid material handle.\n");
|
||||||
wined3d_mutex_unlock();
|
wined3d_mutex_unlock();
|
||||||
return DDERR_INVALIDPARAMS;
|
return DDERR_INVALIDPARAMS;
|
||||||
}
|
}
|
||||||
|
|
||||||
TRACE(" activating material %p.\n", m);
|
|
||||||
material_activate(m);
|
material_activate(m);
|
||||||
|
}
|
||||||
|
|
||||||
device->material = value;
|
device->material = value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue