wined3d: Use the texture dimension helpers in wined3d_device_create_cursor_texture().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-04-03 15:30:53 +02:00 committed by Alexandre Julliard
parent 442e60b7e4
commit 3f5e1d1707
1 changed files with 3 additions and 2 deletions

View File

@ -4282,6 +4282,7 @@ void CDECL wined3d_device_set_depth_stencil_view(struct wined3d_device *device,
static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined3d_device *device,
struct wined3d_texture *cursor_image, unsigned int sub_resource_idx)
{
unsigned int texture_level = sub_resource_idx % cursor_image->level_count;
struct wined3d_sub_resource_data data;
struct wined3d_resource_desc desc;
struct wined3d_map_desc map_desc;
@ -4304,8 +4305,8 @@ static struct wined3d_texture *wined3d_device_create_cursor_texture(struct wined
desc.multisample_quality = 0;
desc.usage = WINED3DUSAGE_DYNAMIC;
desc.pool = WINED3D_POOL_DEFAULT;
desc.width = cursor_image->sub_resources[sub_resource_idx].resource->width;
desc.height = cursor_image->sub_resources[sub_resource_idx].resource->height;
desc.width = wined3d_texture_get_level_width(cursor_image, texture_level);
desc.height = wined3d_texture_get_level_height(cursor_image, texture_level);
desc.depth = 1;
desc.size = 0;