[PATCH 4/7] wined3d: make wined3d_device_set_cursor_properties work with wined3d_texture and sub_resource_index

Riccardo Bortolato rikyz619 at gmail.com
Mon Oct 12 10:23:34 CDT 2015


updated the calls in d3d8 and d3d9

Signed-off-by: Riccardo Bortolato <rikyz619 at gmail.com>
---
 dlls/d3d8/device.c        |  2 +-
 dlls/d3d9/device.c        |  2 +-
 dlls/wined3d/device.c     | 10 +++++++++-
 dlls/wined3d/wined3d.spec |  2 +-
 include/wine/wined3d.h    |  2 +-
 5 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 65600fd..2b11923 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 6dfa037..9dfb6ae 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -484,7 +484,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 6c1af7e..e1d518a 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4222,8 +4222,16 @@ 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 *wined3d_texture, unsigned int sub_resource_idx)
 {
+    struct wined3d_resource *sub_resource = wined3d_texture_get_sub_resource(wined3d_texture, sub_resource_idx);
+    struct wined3d_surface *cursor_image;
+
+    if (!sub_resource)
+        return WINED3DERR_INVALIDCALL;
+
+    cursor_image = surface_from_resource(sub_resource);
+
     TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n",
             device, x_hotspot, y_hotspot, cursor_image);
 
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 24cc089..1569e24 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -113,7 +113,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 923822e..1735b95 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2249,7 +2249,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 *wined3d_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);
-- 
1.9.1




More information about the wine-patches mailing list