[v2 3/4] wined3d: make wined3d_device_set_cursor_properties work with wined3d_texture and sub_resource_index

Henri Verbeet hverbeet at gmail.com
Thu Oct 15 05:29:30 CDT 2015


On 13 October 2015 at 18:45, Riccardo Bortolato <rikyz619 at gmail.com> wrote:
>  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)
>  {
> -    TRACE("device %p, x_hotspot %u, y_hotspot %u, cursor_image %p.\n",
> -            device, x_hotspot, y_hotspot, cursor_image);
> +    struct wined3d_resource *sub_resource;
> +    struct wined3d_surface *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);
> +
> +    sub_resource = wined3d_texture_get_sub_resource(texture, sub_resource_idx);
> +
> +    if (!sub_resource)
> +        return WINED3DERR_INVALIDCALL;
You can merge these lines:
    if (!(sub_resource = wined3d_texture_get_sub_resource(texture,
sub_resource_idx)))
        return WINED3DERR_INVALIDCALL;

Other than that, this has the same issue as patch 2/4 that
"sub_resource" isn't necessarily a surface.



More information about the wine-devel mailing list