From 47fcc00cce253d7bd59fdf0c34d3e66952f85b66 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Wed, 15 Dec 2010 21:06:24 +0100 Subject: [PATCH] wined3d: Pass an IWineD3DBaseTextureImpl pointer to basetexture_unload(). --- dlls/wined3d/basetexture.c | 26 ++++++++++++-------------- dlls/wined3d/cubetexture.c | 2 +- dlls/wined3d/texture.c | 2 +- dlls/wined3d/volumetexture.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c index 50470812711..b48aaf39315 100644 --- a/dlls/wined3d/basetexture.c +++ b/dlls/wined3d/basetexture.c @@ -76,7 +76,7 @@ HRESULT basetexture_init(IWineD3DBaseTextureImpl *texture, UINT layer_count, UIN void basetexture_cleanup(IWineD3DBaseTexture *iface) { - basetexture_unload(iface); + basetexture_unload((IWineD3DBaseTextureImpl *)iface); HeapFree(GetProcessHeap(), 0, ((IWineD3DBaseTextureImpl *)iface)->baseTexture.sub_resources); resource_cleanup((IWineD3DResource *)iface); } @@ -103,30 +103,28 @@ static void gltexture_delete(struct gl_texture *tex) tex->name = 0; } -void basetexture_unload(IWineD3DBaseTexture *iface) +void basetexture_unload(IWineD3DBaseTextureImpl *texture) { - IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface; - IWineD3DDeviceImpl *device = This->resource.device; + IWineD3DDeviceImpl *device = texture->resource.device; 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); } - if(This->baseTexture.texture_rgb.name) { - gltexture_delete(&This->baseTexture.texture_rgb); - } - if(This->baseTexture.texture_srgb.name) { - gltexture_delete(&This->baseTexture.texture_srgb); - } + if (texture->baseTexture.texture_rgb.name) + gltexture_delete(&texture->baseTexture.texture_rgb); + + if (texture->baseTexture.texture_srgb.name) + gltexture_delete(&texture->baseTexture.texture_srgb); if (context) context_release(context); - This->baseTexture.texture_rgb.dirty = TRUE; - This->baseTexture.texture_srgb.dirty = TRUE; + texture->baseTexture.texture_rgb.dirty = TRUE; + texture->baseTexture.texture_srgb.dirty = TRUE; - resource_unload((IWineD3DResourceImpl *)This); + resource_unload((IWineD3DResourceImpl *)texture); } DWORD basetexture_set_lod(IWineD3DBaseTexture *iface, DWORD LODNew) diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 5287e379f7f..66df6ba87f9 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -229,7 +229,7 @@ static void WINAPI IWineD3DCubeTextureImpl_UnLoad(IWineD3DCubeTexture *iface) surface_set_texture_name(surface, 0, FALSE); } - basetexture_unload((IWineD3DBaseTexture *)iface); + basetexture_unload((IWineD3DBaseTextureImpl *)This); } static WINED3DRESOURCETYPE WINAPI IWineD3DCubeTextureImpl_GetType(IWineD3DCubeTexture *iface) { diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index e6108465e93..86dd01ab631 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -220,7 +220,7 @@ static void WINAPI IWineD3DTextureImpl_UnLoad(IWineD3DTexture *iface) { 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) { diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c index 0c61111ed40..ae819fe0b79 100644 --- a/dlls/wined3d/volumetexture.c +++ b/dlls/wined3d/volumetexture.c @@ -184,7 +184,7 @@ static void WINAPI IWineD3DVolumeTextureImpl_UnLoad(IWineD3DVolumeTexture *iface IWineD3DVolume_UnLoad((IWineD3DVolume *)This->baseTexture.sub_resources[i]); } - basetexture_unload((IWineD3DBaseTexture *)iface); + basetexture_unload((IWineD3DBaseTextureImpl *)This); } static WINED3DRESOURCETYPE WINAPI IWineD3DVolumeTextureImpl_GetType(IWineD3DVolumeTexture *iface) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 7db7f269b08..6a15f38b3cb 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1928,7 +1928,7 @@ HRESULT basetexture_set_autogen_filter_type(IWineD3DBaseTexture *iface, WINED3DTEXTUREFILTERTYPE filter_type) DECLSPEC_HIDDEN; BOOL basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) 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)