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

wined3d: Get rid of IWineD3DTexture.

parent 2c16ab2a
......@@ -362,12 +362,8 @@ struct IDirect3DTexture8Impl
{
IDirect3DTexture8 IDirect3DTexture8_iface;
LONG ref;
/* IDirect3DResourc8 fields */
IWineD3DTexture *wineD3DTexture;
/* Parent reference */
IDirect3DDevice8 *parentDevice;
IWineD3DBaseTexture *wined3d_texture;
IDirect3DDevice8 *parentDevice;
};
HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *device,
......
......@@ -61,7 +61,7 @@ static ULONG WINAPI IDirect3DTexture8Impl_AddRef(IDirect3DTexture8 *iface)
{
IDirect3DDevice8_AddRef(This->parentDevice);
wined3d_mutex_lock();
IWineD3DTexture_AddRef(This->wineD3DTexture);
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
wined3d_mutex_unlock();
}
......@@ -79,7 +79,7 @@ static ULONG WINAPI IDirect3DTexture8Impl_Release(IDirect3DTexture8 *iface)
IDirect3DDevice8 *parentDevice = This->parentDevice;
wined3d_mutex_lock();
IWineD3DTexture_Release(This->wineD3DTexture);
IWineD3DBaseTexture_Release(This->wined3d_texture);
wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */
......@@ -114,7 +114,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_SetPrivateData(IDirect3DTexture8 *if
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock();
hr = IWineD3DTexture_SetPrivateData(This->wineD3DTexture, refguid, pData, SizeOfData, Flags);
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock();
return hr;
......@@ -130,7 +130,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetPrivateData(IDirect3DTexture8 *if
iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock();
hr = IWineD3DTexture_GetPrivateData(This->wineD3DTexture, refguid, pData, pSizeOfData);
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
wined3d_mutex_unlock();
return hr;
......@@ -145,7 +145,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_FreePrivateData(IDirect3DTexture8 *i
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock();
hr = IWineD3DTexture_FreePrivateData(This->wineD3DTexture, refguid);
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
wined3d_mutex_unlock();
return hr;
......@@ -159,7 +159,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_SetPriority(IDirect3DTexture8 *iface,
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
wined3d_mutex_lock();
ret = IWineD3DTexture_SetPriority(This->wineD3DTexture, PriorityNew);
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
wined3d_mutex_unlock();
return ret;
......@@ -173,7 +173,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetPriority(IDirect3DTexture8 *iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetPriority(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -186,7 +186,7 @@ static void WINAPI IDirect3DTexture8Impl_PreLoad(IDirect3DTexture8 *iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
IWineD3DTexture_PreLoad(This->wineD3DTexture);
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
wined3d_mutex_unlock();
}
......@@ -198,7 +198,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DTexture8Impl_GetType(IDirect3DTexture8 *i
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
type = IWineD3DTexture_GetType(This->wineD3DTexture);
type = IWineD3DBaseTexture_GetType(This->wined3d_texture);
wined3d_mutex_unlock();
return type;
......@@ -213,7 +213,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_SetLOD(IDirect3DTexture8 *iface, DWORD
TRACE("iface %p, lod %u.\n", iface, LODNew);
wined3d_mutex_lock();
ret = IWineD3DTexture_SetLOD(This->wineD3DTexture, LODNew);
ret = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
wined3d_mutex_unlock();
return ret;
......@@ -227,7 +227,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetLOD(IDirect3DTexture8 *iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetLOD(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -241,7 +241,7 @@ static DWORD WINAPI IDirect3DTexture8Impl_GetLevelCount(IDirect3DTexture8 *iface
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetLevelCount(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -257,7 +257,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(IDirect3DTexture8 *ifac
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
hr = D3DERR_INVALIDCALL;
else
{
......@@ -287,7 +287,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_GetSurfaceLevel(IDirect3DTexture8 *i
TRACE("iface %p, level %u, surface %p.\n", iface, level, surface);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
{
wined3d_mutex_unlock();
return D3DERR_INVALIDCALL;
......@@ -311,7 +311,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_LockRect(IDirect3DTexture8 *iface, U
iface, level, locked_rect, rect, flags);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DSurface8_LockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource),
......@@ -330,7 +330,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_UnlockRect(IDirect3DTexture8 *iface,
TRACE("iface %p, level %u.\n", iface, level);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DSurface8_UnlockRect((IDirect3DSurface8 *)wined3d_resource_get_parent(sub_resource));
......@@ -349,7 +349,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac
wined3d_mutex_lock();
if (!dirty_rect)
hr = IWineD3DTexture_AddDirtyRegion(texture->wineD3DTexture, 0, NULL);
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, NULL);
else
{
WINED3DBOX dirty_region;
......@@ -360,7 +360,7 @@ static HRESULT WINAPI IDirect3DTexture8Impl_AddDirtyRect(IDirect3DTexture8 *ifac
dirty_region.Bottom = dirty_rect->bottom;
dirty_region.Front = 0;
dirty_region.Back = 1;
hr = IWineD3DTexture_AddDirtyRegion(texture->wineD3DTexture, 0, &dirty_region);
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, &dirty_region);
}
wined3d_mutex_unlock();
......@@ -415,7 +415,7 @@ HRESULT texture_init(IDirect3DTexture8Impl *texture, IDirect3DDevice8Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
texture, &d3d8_texture_wined3d_parent_ops, &texture->wineD3DTexture);
texture, &d3d8_texture_wined3d_parent_ops, &texture->wined3d_texture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -353,15 +353,10 @@ HRESULT cubetexture_init(IDirect3DCubeTexture9Impl *texture, IDirect3DDevice9Imp
*/
typedef struct IDirect3DTexture9Impl
{
/* IUnknown fields */
const IDirect3DTexture9Vtbl *lpVtbl;
LONG ref;
/* IDirect3DResource9 fields */
IWineD3DTexture *wineD3DTexture;
/* Parent reference */
LPDIRECT3DDEVICE9EX parentDevice;
IWineD3DBaseTexture *wined3d_texture;
IDirect3DDevice9Ex *parentDevice;
} IDirect3DTexture9Impl;
HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *device,
......
......@@ -55,7 +55,7 @@ static ULONG WINAPI IDirect3DTexture9Impl_AddRef(LPDIRECT3DTEXTURE9 iface) {
{
IDirect3DDevice9Ex_AddRef(This->parentDevice);
wined3d_mutex_lock();
IWineD3DTexture_AddRef(This->wineD3DTexture);
IWineD3DBaseTexture_AddRef(This->wined3d_texture);
wined3d_mutex_unlock();
}
......@@ -72,7 +72,7 @@ static ULONG WINAPI IDirect3DTexture9Impl_Release(LPDIRECT3DTEXTURE9 iface) {
IDirect3DDevice9Ex *parentDevice = This->parentDevice;
wined3d_mutex_lock();
IWineD3DTexture_Release(This->wineD3DTexture);
IWineD3DBaseTexture_Release(This->wined3d_texture);
wined3d_mutex_unlock();
/* Release the device last, as it may cause the device to be destroyed. */
......@@ -104,7 +104,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_SetPrivateData(LPDIRECT3DTEXTURE9 if
iface, debugstr_guid(refguid), pData, SizeOfData, Flags);
wined3d_mutex_lock();
hr = IWineD3DTexture_SetPrivateData(This->wineD3DTexture, refguid, pData, SizeOfData, Flags);
hr = IWineD3DBaseTexture_SetPrivateData(This->wined3d_texture, refguid, pData, SizeOfData, Flags);
wined3d_mutex_unlock();
return hr;
......@@ -118,7 +118,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetPrivateData(LPDIRECT3DTEXTURE9 if
iface, debugstr_guid(refguid), pData, pSizeOfData);
wined3d_mutex_lock();
hr = IWineD3DTexture_GetPrivateData(This->wineD3DTexture, refguid, pData, pSizeOfData);
hr = IWineD3DBaseTexture_GetPrivateData(This->wined3d_texture, refguid, pData, pSizeOfData);
wined3d_mutex_unlock();
return hr;
......@@ -131,7 +131,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_FreePrivateData(LPDIRECT3DTEXTURE9 i
TRACE("iface %p, guid %s.\n", iface, debugstr_guid(refguid));
wined3d_mutex_lock();
hr = IWineD3DTexture_FreePrivateData(This->wineD3DTexture, refguid);
hr = IWineD3DBaseTexture_FreePrivateData(This->wined3d_texture, refguid);
wined3d_mutex_unlock();
return hr;
......@@ -144,7 +144,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_SetPriority(LPDIRECT3DTEXTURE9 iface,
TRACE("iface %p, priority %u.\n", iface, PriorityNew);
wined3d_mutex_lock();
ret = IWineD3DTexture_SetPriority(This->wineD3DTexture, PriorityNew);
ret = IWineD3DBaseTexture_SetPriority(This->wined3d_texture, PriorityNew);
wined3d_mutex_unlock();
return ret;
......@@ -157,7 +157,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetPriority(LPDIRECT3DTEXTURE9 iface)
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetPriority(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetPriority(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -169,7 +169,7 @@ static void WINAPI IDirect3DTexture9Impl_PreLoad(LPDIRECT3DTEXTURE9 iface) {
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
IWineD3DTexture_PreLoad(This->wineD3DTexture);
IWineD3DBaseTexture_PreLoad(This->wined3d_texture);
wined3d_mutex_unlock();
}
......@@ -180,7 +180,7 @@ static D3DRESOURCETYPE WINAPI IDirect3DTexture9Impl_GetType(LPDIRECT3DTEXTURE9 i
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetType(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetType(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -194,7 +194,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_SetLOD(LPDIRECT3DTEXTURE9 iface, DWORD
TRACE("iface %p, lod %u.\n", iface, LODNew);
wined3d_mutex_lock();
ret = IWineD3DTexture_SetLOD(This->wineD3DTexture, LODNew);
ret = IWineD3DBaseTexture_SetLOD(This->wined3d_texture, LODNew);
wined3d_mutex_unlock();
return ret;
......@@ -207,7 +207,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetLOD(LPDIRECT3DTEXTURE9 iface) {
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetLOD(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetLOD(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -220,7 +220,7 @@ static DWORD WINAPI IDirect3DTexture9Impl_GetLevelCount(LPDIRECT3DTEXTURE9 iface
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = IWineD3DTexture_GetLevelCount(This->wineD3DTexture);
ret = IWineD3DBaseTexture_GetLevelCount(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -233,7 +233,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_SetAutoGenFilterType(LPDIRECT3DTEXTU
TRACE("iface %p, filter_type %#x.\n", iface, FilterType);
wined3d_mutex_lock();
hr = IWineD3DTexture_SetAutoGenFilterType(This->wineD3DTexture, (WINED3DTEXTUREFILTERTYPE) FilterType);
hr = IWineD3DBaseTexture_SetAutoGenFilterType(This->wined3d_texture, (WINED3DTEXTUREFILTERTYPE)FilterType);
wined3d_mutex_unlock();
return hr;
......@@ -246,7 +246,7 @@ static D3DTEXTUREFILTERTYPE WINAPI IDirect3DTexture9Impl_GetAutoGenFilterType(LP
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
ret = (D3DTEXTUREFILTERTYPE) IWineD3DTexture_GetAutoGenFilterType(This->wineD3DTexture);
ret = (D3DTEXTUREFILTERTYPE)IWineD3DBaseTexture_GetAutoGenFilterType(This->wined3d_texture);
wined3d_mutex_unlock();
return ret;
......@@ -258,7 +258,7 @@ static void WINAPI IDirect3DTexture9Impl_GenerateMipSubLevels(LPDIRECT3DTEXTURE9
TRACE("iface %p.\n", iface);
wined3d_mutex_lock();
IWineD3DTexture_GenerateMipSubLevels(This->wineD3DTexture);
IWineD3DBaseTexture_GenerateMipSubLevels(This->wined3d_texture);
wined3d_mutex_unlock();
}
......@@ -272,7 +272,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetLevelDesc(IDirect3DTexture9 *ifac
TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
hr = D3DERR_INVALIDCALL;
else
{
......@@ -302,7 +302,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_GetSurfaceLevel(IDirect3DTexture9 *i
TRACE("iface %p, level %u, surface %p.\n", iface, level, surface);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
{
wined3d_mutex_unlock();
return D3DERR_INVALIDCALL;
......@@ -326,7 +326,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_LockRect(IDirect3DTexture9 *iface,
iface, level, locked_rect, rect, flags);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DSurface9_LockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource),
......@@ -345,7 +345,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_UnlockRect(IDirect3DTexture9 *iface,
TRACE("iface %p, level %u.\n", iface, level);
wined3d_mutex_lock();
if (!(sub_resource = IWineD3DTexture_GetSubResource(texture->wineD3DTexture, level)))
if (!(sub_resource = IWineD3DBaseTexture_GetSubResource(texture->wined3d_texture, level)))
hr = D3DERR_INVALIDCALL;
else
hr = IDirect3DSurface9_UnlockRect((IDirect3DSurface9 *)wined3d_resource_get_parent(sub_resource));
......@@ -364,7 +364,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac
wined3d_mutex_lock();
if (!dirty_rect)
hr = IWineD3DTexture_AddDirtyRegion(texture->wineD3DTexture, 0, NULL);
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, NULL);
else
{
WINED3DBOX dirty_region;
......@@ -375,7 +375,7 @@ static HRESULT WINAPI IDirect3DTexture9Impl_AddDirtyRect(IDirect3DTexture9 *ifac
dirty_region.Bottom = dirty_rect->bottom;
dirty_region.Front = 0;
dirty_region.Back = 1;
hr = IWineD3DTexture_AddDirtyRegion(texture->wineD3DTexture, 0, &dirty_region);
hr = IWineD3DBaseTexture_AddDirtyRegion(texture->wined3d_texture, 0, &dirty_region);
}
wined3d_mutex_unlock();
......@@ -433,7 +433,7 @@ HRESULT texture_init(IDirect3DTexture9Impl *texture, IDirect3DDevice9Impl *devic
wined3d_mutex_lock();
hr = IWineD3DDevice_CreateTexture(device->WineD3DDevice, width, height, levels,
usage & WINED3DUSAGE_MASK, wined3dformat_from_d3dformat(format), pool,
texture, &d3d9_texture_wined3d_parent_ops, &texture->wineD3DTexture);
texture, &d3d9_texture_wined3d_parent_ops, &texture->wined3d_texture);
wined3d_mutex_unlock();
if (FAILED(hr))
{
......
......@@ -3444,8 +3444,7 @@ static HRESULT CreateSurface(IDirectDrawImpl *ddraw, DDSURFACEDESC2 *DDSD,
else
{
hr = IWineD3DDevice_CreateTexture(ddraw->wineD3DDevice, DDSD->dwWidth, DDSD->dwHeight,
levels, 0, Format, Pool, object, &ddraw_null_wined3d_parent_ops,
(IWineD3DTexture **)&object->wineD3DTexture);
levels, 0, Format, Pool, object, &ddraw_null_wined3d_parent_ops, &object->wineD3DTexture);
}
ddraw->tex_root = NULL;
}
......
......@@ -1101,21 +1101,21 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateRendertargetView(IWineD3DDevice *
static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
UINT Width, UINT Height, UINT Levels, DWORD Usage, enum wined3d_format_id Format, WINED3DPOOL Pool,
void *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DTexture **ppTexture)
void *parent, const struct wined3d_parent_ops *parent_ops, IWineD3DBaseTexture **texture)
{
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
IWineD3DTextureImpl *object;
HRESULT hr;
TRACE("(%p) : Width %d, Height %d, Levels %d, Usage %#x\n", This, Width, Height, Levels, Usage);
TRACE("Format %#x (%s), Pool %#x, ppTexture %p, parent %p\n",
Format, debug_d3dformat(Format), Pool, ppTexture, parent);
TRACE("Format %#x (%s), Pool %#x, texture %p, parent %p\n",
Format, debug_d3dformat(Format), Pool, texture, parent);
object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
if (!object)
{
ERR("Out of memory\n");
*ppTexture = NULL;
*texture = NULL;
return WINED3DERR_OUTOFVIDEOMEMORY;
}
......@@ -1124,11 +1124,11 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateTexture(IWineD3DDevice *iface,
{
WARN("Failed to initialize texture, returning %#x\n", hr);
HeapFree(GetProcessHeap(), 0, object);
*ppTexture = NULL;
*texture = NULL;
return hr;
}
*ppTexture = (IWineD3DTexture *)object;
*texture = (IWineD3DBaseTexture *)object;
TRACE("(%p) : Created texture %p\n", This, object);
......
/*
* IWineD3DTexture implementation
*
* Copyright 2002-2005 Jason Edmeades
* Copyright 2002-2005 Raphael Junqueira
* Copyright 2005 Oliver Stieber
......@@ -221,19 +219,15 @@ static void texture_cleanup(IWineD3DTextureImpl *This)
basetexture_cleanup((IWineD3DBaseTextureImpl *)This);
}
/* *******************************************
IWineD3DTexture IUnknown parts follow
******************************************* */
static HRESULT WINAPI IWineD3DTextureImpl_QueryInterface(IWineD3DTexture *iface, REFIID riid, LPVOID *ppobj)
static HRESULT WINAPI IWineD3DTextureImpl_QueryInterface(IWineD3DBaseTexture *iface, REFIID riid, LPVOID *ppobj)
{
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
TRACE("(%p)->(%s,%p)\n",This,debugstr_guid(riid),ppobj);
if (IsEqualGUID(riid, &IID_IUnknown)
|| IsEqualGUID(riid, &IID_IWineD3DBase)
|| IsEqualGUID(riid, &IID_IWineD3DResource)
|| IsEqualGUID(riid, &IID_IWineD3DBaseTexture)
|| IsEqualGUID(riid, &IID_IWineD3DTexture)){
|| IsEqualGUID(riid, &IID_IWineD3DBaseTexture))
{
IUnknown_AddRef(iface);
*ppobj = This;
return WINED3D_OK;
......@@ -242,14 +236,16 @@ static HRESULT WINAPI IWineD3DTextureImpl_QueryInterface(IWineD3DTexture *iface,
return E_NOINTERFACE;
}
static ULONG WINAPI IWineD3DTextureImpl_AddRef(IWineD3DTexture *iface) {
static ULONG WINAPI IWineD3DTextureImpl_AddRef(IWineD3DBaseTexture *iface)
{
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
TRACE("(%p) : AddRef increasing from %d\n", This, This->resource.ref);
return InterlockedIncrement(&This->resource.ref);
}
/* Do not call while under the GL lock. */
static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DTexture *iface) {
static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DBaseTexture *iface)
{
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
ULONG ref;
TRACE("(%p) : Releasing from %d\n", This, This->resource.ref);
......@@ -263,95 +259,91 @@ static ULONG WINAPI IWineD3DTextureImpl_Release(IWineD3DTexture *iface) {
return ref;
}
/* ****************************************************
IWineD3DTexture IWineD3DResource parts follow
**************************************************** */
static HRESULT WINAPI IWineD3DTextureImpl_SetPrivateData(IWineD3DTexture *iface,
static HRESULT WINAPI IWineD3DTextureImpl_SetPrivateData(IWineD3DBaseTexture *iface,
REFGUID riid, const void *data, DWORD data_size, DWORD flags)
{
return resource_set_private_data(&((IWineD3DTextureImpl *)iface)->resource, riid, data, data_size, flags);
}
static HRESULT WINAPI IWineD3DTextureImpl_GetPrivateData(IWineD3DTexture *iface,
static HRESULT WINAPI IWineD3DTextureImpl_GetPrivateData(IWineD3DBaseTexture *iface,
REFGUID guid, void *data, DWORD *data_size)
{
return resource_get_private_data(&((IWineD3DTextureImpl *)iface)->resource, guid, data, data_size);
}
static HRESULT WINAPI IWineD3DTextureImpl_FreePrivateData(IWineD3DTexture *iface, REFGUID refguid)
static HRESULT WINAPI IWineD3DTextureImpl_FreePrivateData(IWineD3DBaseTexture *iface, REFGUID refguid)
{
return resource_free_private_data(&((IWineD3DTextureImpl *)iface)->resource, refguid);
}
static DWORD WINAPI IWineD3DTextureImpl_SetPriority(IWineD3DTexture *iface, DWORD priority)
static DWORD WINAPI IWineD3DTextureImpl_SetPriority(IWineD3DBaseTexture *iface, DWORD priority)
{
return resource_set_priority(&((IWineD3DTextureImpl *)iface)->resource, priority);
}
static DWORD WINAPI IWineD3DTextureImpl_GetPriority(IWineD3DTexture *iface)
static DWORD WINAPI IWineD3DTextureImpl_GetPriority(IWineD3DBaseTexture *iface)
{
return resource_get_priority(&((IWineD3DTextureImpl *)iface)->resource);
}
/* Do not call while under the GL lock. */
static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DTexture *iface)
static void WINAPI IWineD3DTextureImpl_PreLoad(IWineD3DBaseTexture *iface)
{
texture_preload((IWineD3DBaseTextureImpl *)iface, SRGB_ANY);
}
static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DTexture *iface)
static WINED3DRESOURCETYPE WINAPI IWineD3DTextureImpl_GetType(IWineD3DBaseTexture *iface)
{
return resource_get_type(&((IWineD3DTextureImpl *)iface)->resource);
}
static void * WINAPI IWineD3DTextureImpl_GetParent(IWineD3DTexture *iface)
static void * WINAPI IWineD3DTextureImpl_GetParent(IWineD3DBaseTexture *iface)
{
TRACE("iface %p.\n", iface);
return ((IWineD3DTextureImpl *)iface)->resource.parent;
}
/* ******************************************************
IWineD3DTexture IWineD3DBaseTexture parts follow
****************************************************** */
static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DTexture *iface, DWORD LODNew) {
static DWORD WINAPI IWineD3DTextureImpl_SetLOD(IWineD3DBaseTexture *iface, DWORD LODNew)
{
return basetexture_set_lod((IWineD3DBaseTextureImpl *)iface, LODNew);
}
static DWORD WINAPI IWineD3DTextureImpl_GetLOD(IWineD3DTexture *iface) {
static DWORD WINAPI IWineD3DTextureImpl_GetLOD(IWineD3DBaseTexture *iface)
{
return basetexture_get_lod((IWineD3DBaseTextureImpl *)iface);
}
static DWORD WINAPI IWineD3DTextureImpl_GetLevelCount(IWineD3DTexture *iface)
static DWORD WINAPI IWineD3DTextureImpl_GetLevelCount(IWineD3DBaseTexture *iface)
{
return basetexture_get_level_count((IWineD3DBaseTextureImpl *)iface);
}
static HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DTexture *iface,
static HRESULT WINAPI IWineD3DTextureImpl_SetAutoGenFilterType(IWineD3DBaseTexture *iface,
WINED3DTEXTUREFILTERTYPE FilterType)
{
return basetexture_set_autogen_filter_type((IWineD3DBaseTextureImpl *)iface, FilterType);
}
static WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DTextureImpl_GetAutoGenFilterType(IWineD3DTexture *iface)
static WINED3DTEXTUREFILTERTYPE WINAPI IWineD3DTextureImpl_GetAutoGenFilterType(IWineD3DBaseTexture *iface)
{
return basetexture_get_autogen_filter_type((IWineD3DBaseTextureImpl *)iface);
}
static void WINAPI IWineD3DTextureImpl_GenerateMipSubLevels(IWineD3DTexture *iface)
static void WINAPI IWineD3DTextureImpl_GenerateMipSubLevels(IWineD3DBaseTexture *iface)
{
basetexture_generate_mipmaps((IWineD3DBaseTextureImpl *)iface);
}
static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) {
static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DBaseTexture *iface)
{
IWineD3DTextureImpl *This = (IWineD3DTextureImpl *)iface;
TRACE("(%p)\n", This);
return This->cond_np2;
}
static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWineD3DTexture *iface,
static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWineD3DBaseTexture *iface,
UINT sub_resource_idx)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
......@@ -361,7 +353,7 @@ static struct wined3d_resource * WINAPI IWineD3DTextureImpl_GetSubResource(IWine
return basetexture_get_sub_resource(texture, sub_resource_idx);
}
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRegion(IWineD3DTexture *iface,
static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRegion(IWineD3DBaseTexture *iface,
UINT layer, const WINED3DBOX *dirty_region)
{
IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
......@@ -381,7 +373,7 @@ static HRESULT WINAPI IWineD3DTextureImpl_AddDirtyRegion(IWineD3DTexture *iface,
return WINED3D_OK;
}
static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
static const IWineD3DBaseTextureVtbl IWineD3DTexture_Vtbl =
{
/* IUnknown */
IWineD3DTextureImpl_QueryInterface,
......
......@@ -1953,17 +1953,11 @@ void basetexture_set_dirty(IWineD3DBaseTextureImpl *texture, BOOL dirty) DECLSPE
DWORD basetexture_set_lod(IWineD3DBaseTextureImpl *texture, DWORD lod) DECLSPEC_HIDDEN;
void basetexture_unload(IWineD3DBaseTextureImpl *texture) DECLSPEC_HIDDEN;
/*****************************************************************************
* IWineD3DTexture implementation structure (extends IWineD3DBaseTextureImpl)
*/
typedef struct IWineD3DTextureImpl
{
/* IUnknown & WineD3DResource/WineD3DBaseTexture Information */
const IWineD3DTextureVtbl *lpVtbl;
const IWineD3DBaseTextureVtbl *lpVtbl;
struct wined3d_resource resource;
IWineD3DBaseTextureClass baseTexture;
/* IWineD3DTexture */
BOOL cond_np2;
} IWineD3DTextureImpl;
......
......@@ -2370,15 +2370,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
[
object,
local,
uuid(3e72cc1c-6f30-11d9-c687-00046142c14f)
]
interface IWineD3DTexture : IWineD3DBaseTexture
{
}
[
object,
local,
uuid(41752900-6f30-11d9-c687-00046142c14f)
]
interface IWineD3DCubeTexture : IWineD3DBaseTexture
......@@ -2542,7 +2533,7 @@ interface IWineD3DDevice : IUnknown
[in] WINED3DPOOL pool,
[in] void *parent,
[in] const struct wined3d_parent_ops *parent_ops,
[out] IWineD3DTexture **texture
[out] IWineD3DBaseTexture **texture
);
HRESULT CreateVolumeTexture(
[in] UINT width,
......
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