Module: wine Branch: oldstable Commit: 63cf5771a8b1677f3f769cead471e2c2cec36e1e URL: https://source.winehq.org/git/wine.git/?a=commit;h=63cf5771a8b1677f3f769cead...
Author: Paul Gofman gofmanp@gmail.com Date: Wed May 15 18:06:49 2019 +0300
ddraw: Enable lighting only if material is set in d3d_execute_buffer_execute().
Signed-off-by: Paul Gofman gofmanp@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit ae2696c992a0bf0971b8b2e6df847bea51f8d3c4) Signed-off-by: Michael Stefaniuc mstefani@winehq.org
---
dlls/ddraw/executebuffer.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c index 2ba29a7ed7..6f00d75562 100644 --- a/dlls/ddraw/executebuffer.c +++ b/dlls/ddraw/executebuffer.c @@ -318,21 +318,11 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, case D3DPROCESSVERTICES_TRANSFORM: wined3d_device_set_stream_source(device->wined3d_device, 0, buffer->src_vertex_buffer, buffer->src_vertex_pos, sizeof(D3DVERTEX)); - if (op == D3DPROCESSVERTICES_TRANSFORMLIGHT) - { - wined3d_device_set_vertex_declaration(device->wined3d_device, - ddraw_find_decl(device->ddraw, D3DFVF_VERTEX)); - wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_LIGHTING, TRUE); - } - else - { - wined3d_device_set_vertex_declaration(device->wined3d_device, - ddraw_find_decl(device->ddraw, D3DFVF_LVERTEX)); - wined3d_device_set_render_state(device->wined3d_device, - WINED3D_RS_LIGHTING, FALSE); - } - + wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_LIGHTING, + op == D3DPROCESSVERTICES_TRANSFORMLIGHT && !!device->material); + wined3d_device_set_vertex_declaration(device->wined3d_device, + ddraw_find_decl(device->ddraw, op == D3DPROCESSVERTICES_TRANSFORMLIGHT + ? D3DFVF_VERTEX : D3DFVF_LVERTEX)); wined3d_device_process_vertices(device->wined3d_device, ci->wStart, ci->wDest, ci->dwCount, buffer->dst_vertex_buffer, NULL, 0, D3DFVF_TLVERTEX); break;