Commit 74bc7c43 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Use wined3d_texture_get_sub_resource_parent() in d3d9_texture_cube_GetCubeMapSurface().

parent ec590c84
......@@ -719,7 +719,6 @@ static HRESULT WINAPI d3d9_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture9
D3DCUBEMAP_FACES face, UINT level, IDirect3DSurface9 **surface)
{
struct d3d9_texture *texture = impl_from_IDirect3DCubeTexture9(iface);
struct wined3d_resource *sub_resource;
struct d3d9_surface *surface_impl;
UINT sub_resource_idx;
DWORD level_count;
......@@ -735,13 +734,12 @@ static HRESULT WINAPI d3d9_texture_cube_GetCubeMapSurface(IDirect3DCubeTexture9
}
sub_resource_idx = level_count * face + level;
if (!(sub_resource = wined3d_texture_get_sub_resource(texture->wined3d_texture, sub_resource_idx)))
if (!(surface_impl = wined3d_texture_get_sub_resource_parent(texture->wined3d_texture, sub_resource_idx)))
{
wined3d_mutex_unlock();
return D3DERR_INVALIDCALL;
}
surface_impl = wined3d_resource_get_parent(sub_resource);
*surface = &surface_impl->IDirect3DSurface9_iface;
IDirect3DSurface9_AddRef(*surface);
wined3d_mutex_unlock();
......
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