Zebediah Figura : wined3d: Introduce wined3d_stateblock_set_light_enable().
Alexandre Julliard
julliard at winehq.org
Fri Nov 15 16:55:19 CST 2019
Module: wine
Branch: master
Commit: 7daea10cca0d98bee91faf34f5c7e416c47d0b6a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=7daea10cca0d98bee91faf34f5c7e416c47d0b6a
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Fri Nov 15 09:46:50 2019 -0600
wined3d: Introduce wined3d_stateblock_set_light_enable().
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/stateblock.c | 18 ++++++++++++++++++
dlls/wined3d/wined3d.spec | 1 +
include/wine/wined3d.h | 1 +
3 files changed, 20 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index bf1e577f85..898a4bc93d 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1679,6 +1679,24 @@ HRESULT CDECL wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock
return wined3d_light_state_set_light(&stateblock->stateblock_state.light_state, light_idx, light, &object);
}
+HRESULT CDECL wined3d_stateblock_set_light_enable(struct wined3d_stateblock *stateblock, UINT light_idx, BOOL enable)
+{
+ struct wined3d_light_info *light_info;
+ HRESULT hr;
+
+ TRACE("stateblock %p, light_idx %u, enable %#x.\n", stateblock, light_idx, enable);
+
+ if (!(light_info = wined3d_light_state_get_light(&stateblock->stateblock_state.light_state, light_idx)))
+ {
+ if (FAILED(hr = wined3d_light_state_set_light(&stateblock->stateblock_state.light_state, light_idx,
+ &WINED3D_default_light, &light_info)))
+ return hr;
+ }
+ wined3d_light_state_enable_light(&stateblock->stateblock_state.light_state,
+ &stateblock->device->adapter->d3d_info, light_info, enable);
+ return S_OK;
+}
+
static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info)
{
union
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 8591aa5164..ea04c85d38 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -268,6 +268,7 @@
@ cdecl wined3d_stateblock_set_clip_plane(ptr long ptr)
@ cdecl wined3d_stateblock_set_index_buffer(ptr ptr long)
@ cdecl wined3d_stateblock_set_light(ptr long ptr)
+@ cdecl wined3d_stateblock_set_light_enable(ptr long long)
@ cdecl wined3d_stateblock_set_material(ptr ptr)
@ cdecl wined3d_stateblock_set_pixel_shader(ptr ptr)
@ cdecl wined3d_stateblock_set_ps_consts_b(ptr long long ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 33f668f934..fac9eef5be 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2677,6 +2677,7 @@ void __cdecl wined3d_stateblock_set_index_buffer(struct wined3d_stateblock *stat
struct wined3d_buffer *index_buffer, enum wined3d_format_id format_id);
HRESULT __cdecl wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock,
UINT light_idx, const struct wined3d_light *light);
+HRESULT __cdecl wined3d_stateblock_set_light_enable(struct wined3d_stateblock *stateblock, UINT light_idx, BOOL enable);
void __cdecl wined3d_stateblock_set_material(struct wined3d_stateblock *stateblock, const struct wined3d_material *material);
void __cdecl wined3d_stateblock_set_pixel_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
HRESULT __cdecl wined3d_stateblock_set_ps_consts_b(struct wined3d_stateblock *stateblock,
More information about the wine-cvs
mailing list