ddraw: Make sure to activate / deactivate the light on D3DLIGHT_ACTIVE flag changes.

This commit is contained in:
Matteo Bruni 2015-03-30 20:18:02 +02:00 committed by Alexandre Julliard
parent b41a3ad219
commit e8aba71529
1 changed files with 5 additions and 1 deletions

View File

@ -201,7 +201,11 @@ static HRESULT WINAPI d3d_light_SetLight(IDirect3DLight *iface, D3DLIGHT *data)
wined3d_mutex_lock();
memcpy(&light->light, data, sizeof(D3DLIGHT));
if (flags & D3DLIGHT_ACTIVE)
if (!(light->light.dwFlags & D3DLIGHT_ACTIVE) && flags & D3DLIGHT_ACTIVE)
light_activate(light);
else if (light->light.dwFlags & D3DLIGHT_ACTIVE && !(flags & D3DLIGHT_ACTIVE))
light_deactivate(light);
else if (flags & D3DLIGHT_ACTIVE)
light_update(light);
light->light.dwFlags = flags;
wined3d_mutex_unlock();