Commit f984f56f authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

ddraw: Use wined3d_texture_get_sub_resource_parent() in ddraw_surface_create().

parent 691086ea
...@@ -6116,8 +6116,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ ...@@ -6116,8 +6116,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
return hr_ddraw_from_wined3d(hr); return hr_ddraw_from_wined3d(hr);
} }
resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); root = wined3d_texture_get_sub_resource_parent(wined3d_texture, 0);
root = wined3d_resource_get_parent(resource);
wined3d_texture_decref(wined3d_texture); wined3d_texture_decref(wined3d_texture);
root->is_complex_root = TRUE; root->is_complex_root = TRUE;
texture->root = root; texture->root = root;
...@@ -6141,12 +6140,12 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ ...@@ -6141,12 +6140,12 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
for (j = 0; j < levels; ++j) for (j = 0; j < levels; ++j)
{ {
resource = wined3d_texture_get_sub_resource(wined3d_texture, i * levels + j); mip = wined3d_texture_get_sub_resource_parent(wined3d_texture, i * levels + j);
mip = wined3d_resource_get_parent(resource);
mip_desc = &mip->surface_desc; mip_desc = &mip->surface_desc;
if (j) if (j)
{ {
resource = wined3d_texture_get_sub_resource(wined3d_texture, i * levels + j);
wined3d_resource_get_desc(resource, &wined3d_mip_desc); wined3d_resource_get_desc(resource, &wined3d_mip_desc);
mip_desc->dwWidth = wined3d_mip_desc.width; mip_desc->dwWidth = wined3d_mip_desc.width;
mip_desc->dwHeight = wined3d_mip_desc.height; mip_desc->dwHeight = wined3d_mip_desc.height;
...@@ -6237,8 +6236,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_ ...@@ -6237,8 +6236,7 @@ HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_
goto fail; goto fail;
} }
resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); last = wined3d_texture_get_sub_resource_parent(wined3d_texture, 0);
last = wined3d_resource_get_parent(resource);
wined3d_texture_decref(wined3d_texture); wined3d_texture_decref(wined3d_texture);
texture->root = last; texture->root = last;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment