Commit 47fcc00c authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass an IWineD3DBaseTextureImpl pointer to basetexture_unload().

parent 7bc7caf4
...@@ -76,7 +76,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN ...@@ -76,7 +76,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN
void basetexture_cleanup(IWineD3DBaseTexture *iface) void basetexture_cleanup(IWineD3DBaseTexture *iface)
{ {
basetexture_unload(iface); basetexture_unload((IWineD3DBaseTextureImpl *)iface);
HeapFree(GetProcessHeap(), 0, ((IWineD3DBaseTextureImpl *)iface)->baseTexture.sub_resources); HeapFree(GetProcessHeap(), 0, ((IWineD3DBaseTextureImpl *)iface)->baseTexture.sub_resources);
resource_cleanup((IWineD3DResource *)iface); resource_cleanup((IWineD3DResource *)iface);
} }
...@@ -103,30 +103,28 @@ static void gltexture_delete(struct gl_texture *tex) ...@@ -103,30 +103,28 @@ static void gltexture_delete(struct gl_texture *tex)
tex->name = 0; tex->name = 0;
} }
void basetexture_unload(IWineD3DBaseTexture *iface) void basetexture_unload(IWineD3DBaseTextureImpl *texture)
{ {
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; IWineD3DDeviceImpl *device = texture->resource.device;
IWineD3DDeviceImpl *device = This->resource.device;
struct wined3d_context *context = NULL; struct wined3d_context *context = NULL;
if (This->baseTexture.texture_rgb.name || This->baseTexture.texture_srgb.name) if (texture->baseTexture.texture_rgb.name || texture->baseTexture.texture_srgb.name)
{ {
context = context_acquire(device, NULL); context = context_acquire(device, NULL);
} }
if(This->baseTexture.texture_rgb.name) { if (texture->baseTexture.texture_rgb.name)
gltexture_delete(&This->baseTexture.texture_rgb); gltexture_delete(&texture->baseTexture.texture_rgb);
}
if(This->baseTexture.texture_srgb.name) { if (texture->baseTexture.texture_srgb.name)
gltexture_delete(&This->baseTexture.texture_srgb); gltexture_delete(&texture->baseTexture.texture_srgb);
}
if (context) context_release(context); if (context) context_release(context);
This->baseTexture.texture_rgb.dirty = TRUE; texture->baseTexture.texture_rgb.dirty = TRUE;
This->baseTexture.texture_srgb.dirty = TRUE; texture->baseTexture.texture_srgb.dirty = TRUE;
resource_unload((IWineD3DResourceImpl *)This); resource_unload((IWineD3DResourceImpl *)texture);
} }
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew) DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew)
......
...@@ -229,7 +229,7 @@ static void WINAPI IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture *iface) ...@@ -229,7 +229,7 @@ static void WINAPI IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture *iface)
surface_set_texture_name(surface, 0, FALSE); surface_set_texture_name(surface, 0, FALSE);
} }
basetexture_unload((IWineD3DBaseTexture *)iface); basetexture_unload((IWineD3DBaseTextureImpl *)This);
} }
static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture *iface) { static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture *iface) {
......
...@@ -220,7 +220,7 @@ static void WINAPI IWineD3DTextureImpl_UnLoad(IWineD3DTexture *iface) { ...@@ -220,7 +220,7 @@ static void WINAPI IWineD3DTextureImpl_UnLoad(IWineD3DTexture *iface) {
surface_set_texture_name(surface, 0, TRUE); /* delete srgb name */ surface_set_texture_name(surface, 0, TRUE); /* delete srgb name */
} }
basetexture_unload((IWineD3DBaseTexture *)iface); basetexture_unload((IWineD3DBaseTextureImpl *)This);
} }
static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DTexture *iface) { static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DTexture *iface) {
......
...@@ -184,7 +184,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_UnLoad(IWineD3DVolumeTexture *iface ...@@ -184,7 +184,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_UnLoad(IWineD3DVolumeTexture *iface
IWineD3DVolume_UnLoad((IWineD3DVolume *)This->baseTexture.sub_resources[i]); IWineD3DVolume_UnLoad((IWineD3DVolume *)This->baseTexture.sub_resources[i]);
} }
basetexture_unload((IWineD3DBaseTexture *)iface); basetexture_unload((IWineD3DBaseTextureImpl *)This);
} }
static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeTextureImpl_GetType(IWineD3DVolumeTexture *iface) { static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeTextureImpl_GetType(IWineD3DVolumeTexture *iface) {
......
...@@ -1928,7 +1928,7 @@ HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, ...@@ -1928,7 +1928,7 @@ HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface,
WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN; WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN;
BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN; BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPEC_HIDDEN;
DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod) DECLSPEC_HIDDEN; DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD new_lod) DECLSPEC_HIDDEN;
void basetexture_unload(IWineD3DBaseTexture *iface) DECLSPEC_HIDDEN; void basetexture_unload(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;
/***************************************************************************** /*****************************************************************************
* IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl) * IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl)
......
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