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

Alexandre Julliard julliard at wine.codeweavers.com
Tue Mar 31 10:38:50 CDT 2015


Module: wine
Branch: master
Commit: e8aba71529adbcfe349fba53604b296d714dfa49
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e8aba71529adbcfe349fba53604b296d714dfa49

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Mon Mar 30 20:18:02 2015 +0200

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

---

 dlls/ddraw/light.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/dlls/ddraw/light.c b/dlls/ddraw/light.c
index baaf6a3..c632c32 100644
--- a/dlls/ddraw/light.c
+++ b/dlls/ddraw/light.c
@@ -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();




More information about the wine-cvs mailing list