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>
This commit is contained in:
parent
53f795af0a
commit
6671535dc3
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue