Module: wine Branch: master Commit: 6671535dc32b3a841d1b14003dc7efbe6a5f3863 URL: http://source.winehq.org/git/wine.git/?a=commit;h=6671535dc32b3a841d1b14003d...
Author: Riccardo Bortolato rikyz619@gmail.com Date: Fri Oct 16 13:59:18 2015 +0200
wined3d: Make wined3d_device_set_cursor_properties work with wined3d_texture and sub_resource_index.
Signed-off-by: Riccardo Bortolato rikyz619@gmail.com Signed-off-by: Henri Verbeet hverbeet@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/d3d8/device.c | 2 +- dlls/d3d9/device.c | 2 +- dlls/wined3d/device.c | 14 +++++++++++--- dlls/wined3d/wined3d.spec | 2 +- include/wine/wined3d.h | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 406cc7e..ae6bebb 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -534,7 +534,7 @@ static HRESULT WINAPI d3d8_device_SetCursorProperties(IDirect3DDevice8 *iface,
wined3d_mutex_lock(); hr = wined3d_device_set_cursor_properties(device->wined3d_device, - hotspot_x, hotspot_y, bitmap_impl->wined3d_surface); + hotspot_x, hotspot_y, bitmap_impl->wined3d_texture, bitmap_impl->sub_resource_idx); wined3d_mutex_unlock();
return hr; diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index a191b71..7d9f735 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -486,7 +486,7 @@ static HRESULT WINAPI d3d9_device_SetCursorProperties(IDirect3DDevice9Ex *iface,
wined3d_mutex_lock(); hr = wined3d_device_set_cursor_properties(device->wined3d_device, - hotspot_x, hotspot_y, bitmap_impl->wined3d_surface); + hotspot_x, hotspot_y, bitmap_impl->wined3d_texture, bitmap_impl->sub_resource_idx); wined3d_mutex_unlock();
return hr; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 35a9de4..087dc33 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4190,14 +4190,22 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined }
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, - UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_image) + UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx) { struct wined3d_display_mode mode; struct wined3d_map_desc map_desc; + struct wined3d_resource *sub_resource; + struct wined3d_surface *cursor_image; HRESULT hr;
- TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n", - device, x_hotspot, y_hotspot, cursor_image); + TRACE("device %p, x_hotspot %u, y_hotspot %u, texture %p, sub_resource_idx %u.\n", + device, x_hotspot, y_hotspot, texture, sub_resource_idx); + + if (!(sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx)) + || sub_resource->type != WINED3D_RTYPE_SURFACE) + return WINED3DERR_INVALIDCALL; + + cursor_image = surface_from_resource(sub_resource);
if (device->cursor_texture) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 4dc8be1..da1cbc4 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -111,7 +111,7 @@ @ cdecl wined3d_device_set_clip_plane(ptr long ptr) @ cdecl wined3d_device_set_clip_status(ptr ptr) @ cdecl wined3d_device_set_cursor_position(ptr long long long) -@ cdecl wined3d_device_set_cursor_properties(ptr long long ptr) +@ cdecl wined3d_device_set_cursor_properties(ptr long long ptr long) @ cdecl wined3d_device_set_depth_stencil_view(ptr ptr) @ cdecl wined3d_device_set_dialog_box_mode(ptr long) @ cdecl wined3d_device_set_gamma_ramp(ptr long long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index c5cfc4a..cb412e4 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2245,7 +2245,7 @@ HRESULT __cdecl wined3d_device_set_clip_status(struct wined3d_device *device, void __cdecl wined3d_device_set_cursor_position(struct wined3d_device *device, int x_screen_space, int y_screen_space, DWORD flags); HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *device, - UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_surface); + UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx); void __cdecl wined3d_device_set_depth_stencil_view(struct wined3d_device *device, struct wined3d_rendertarget_view *view); HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs);