wined3d: Get rid of the silly pointers in WINED3DVOLUME_DESC.
This commit is contained in:
parent
08d95233e3
commit
621da64245
|
@ -154,21 +154,21 @@ static HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DV
|
|||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
/* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */
|
||||
wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format;
|
||||
wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type;
|
||||
wined3ddesc.Usage = &pDesc->Usage;
|
||||
wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool;
|
||||
wined3ddesc.Size = &pDesc->Size;
|
||||
wined3ddesc.Width = &pDesc->Width;
|
||||
wined3ddesc.Height = &pDesc->Height;
|
||||
wined3ddesc.Depth = &pDesc->Depth;
|
||||
|
||||
EnterCriticalSection(&d3d8_cs);
|
||||
hr = IWineD3DVolume_GetDesc(This->wineD3DVolume, &wined3ddesc);
|
||||
LeaveCriticalSection(&d3d8_cs);
|
||||
|
||||
if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(pDesc->Format);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format);
|
||||
pDesc->Type = wined3ddesc.Type;
|
||||
pDesc->Usage = wined3ddesc.Usage;
|
||||
pDesc->Pool = wined3ddesc.Pool;
|
||||
pDesc->Size = wined3ddesc.Size;
|
||||
pDesc->Width = wined3ddesc.Width;
|
||||
pDesc->Height = wined3ddesc.Height;
|
||||
pDesc->Depth = wined3ddesc.Depth;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -197,26 +197,25 @@ static DWORD WINAPI IDirect3DVolumeTexture8Impl_GetLevelCount(LPDIRECT3DVOLUMETE
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE8 iface, UINT Level, D3DVOLUME_DESC* pDesc) {
|
||||
IDirect3DVolumeTexture8Impl *This = (IDirect3DVolumeTexture8Impl *)iface;
|
||||
WINED3DVOLUME_DESC wined3ddesc;
|
||||
UINT tmpInt = -1;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
/* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */
|
||||
wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format;
|
||||
wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type;
|
||||
wined3ddesc.Usage = &pDesc->Usage;
|
||||
wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool;
|
||||
wined3ddesc.Size = &tmpInt;
|
||||
wined3ddesc.Width = &pDesc->Width;
|
||||
wined3ddesc.Height = &pDesc->Height;
|
||||
wined3ddesc.Depth = &pDesc->Depth;
|
||||
|
||||
EnterCriticalSection(&d3d8_cs);
|
||||
hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, Level, &wined3ddesc);
|
||||
LeaveCriticalSection(&d3d8_cs);
|
||||
|
||||
if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(pDesc->Format);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format);
|
||||
pDesc->Type = wined3ddesc.Type;
|
||||
pDesc->Usage = wined3ddesc.Usage;
|
||||
pDesc->Pool = wined3ddesc.Pool;
|
||||
pDesc->Size = wined3ddesc.Size;
|
||||
pDesc->Width = wined3ddesc.Width;
|
||||
pDesc->Height = wined3ddesc.Height;
|
||||
pDesc->Depth = wined3ddesc.Depth;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -454,15 +454,8 @@ static HRESULT WINAPI reset_enum_callback(IWineD3DResource *resource, void *data
|
|||
break;
|
||||
|
||||
case D3DRTYPE_VOLUME:
|
||||
volume_desc.Format = &dummy_format;
|
||||
volume_desc.Type = &type;
|
||||
volume_desc.Usage = &dummy_dword;
|
||||
volume_desc.Pool = &pool;
|
||||
volume_desc.Size = &dummy_dword;
|
||||
volume_desc.Width = &dummy_dword;
|
||||
volume_desc.Height = &dummy_dword;
|
||||
volume_desc.Depth = &dummy_dword;
|
||||
IWineD3DVolume_GetDesc((IWineD3DVolume *) resource, &volume_desc);
|
||||
pool = volume_desc.Pool;
|
||||
break;
|
||||
|
||||
case D3DRTYPE_INDEXBUFFER:
|
||||
|
|
|
@ -167,29 +167,26 @@ static HRESULT WINAPI IDirect3DVolume9Impl_GetContainer(LPDIRECT3DVOLUME9 iface,
|
|||
static HRESULT WINAPI IDirect3DVolume9Impl_GetDesc(LPDIRECT3DVOLUME9 iface, D3DVOLUME_DESC* pDesc) {
|
||||
IDirect3DVolume9Impl *This = (IDirect3DVolume9Impl *)iface;
|
||||
WINED3DVOLUME_DESC wined3ddesc;
|
||||
UINT tmpInt = -1;
|
||||
WINED3DFORMAT format;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
/* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */
|
||||
wined3ddesc.Format = &format;
|
||||
wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type;
|
||||
wined3ddesc.Usage = &pDesc->Usage;
|
||||
wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool;
|
||||
wined3ddesc.Size = &tmpInt;
|
||||
wined3ddesc.Width = &pDesc->Width;
|
||||
wined3ddesc.Height = &pDesc->Height;
|
||||
wined3ddesc.Depth = &pDesc->Depth;
|
||||
|
||||
EnterCriticalSection(&d3d9_cs);
|
||||
|
||||
hr = IWineD3DVolume_GetDesc(This->wineD3DVolume, &wined3ddesc);
|
||||
|
||||
LeaveCriticalSection(&d3d9_cs);
|
||||
|
||||
if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format);
|
||||
pDesc->Type = wined3ddesc.Type;
|
||||
pDesc->Usage = wined3ddesc.Usage;
|
||||
pDesc->Pool = wined3ddesc.Pool;
|
||||
pDesc->Width = wined3ddesc.Width;
|
||||
pDesc->Height = wined3ddesc.Height;
|
||||
pDesc->Depth = wined3ddesc.Depth;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -281,29 +281,26 @@ static void WINAPI IDirect3DVolumeTexture9Impl_GenerateMipSubLevels(LPDIRECT3DVO
|
|||
static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(LPDIRECT3DVOLUMETEXTURE9 iface, UINT Level, D3DVOLUME_DESC* pDesc) {
|
||||
IDirect3DVolumeTexture9Impl *This = (IDirect3DVolumeTexture9Impl *)iface;
|
||||
WINED3DVOLUME_DESC wined3ddesc;
|
||||
UINT tmpInt = -1;
|
||||
WINED3DFORMAT format;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p) Relay\n", This);
|
||||
|
||||
/* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */
|
||||
wined3ddesc.Format = &format;
|
||||
wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type;
|
||||
wined3ddesc.Usage = &pDesc->Usage;
|
||||
wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool;
|
||||
wined3ddesc.Size = &tmpInt;
|
||||
wined3ddesc.Width = &pDesc->Width;
|
||||
wined3ddesc.Height = &pDesc->Height;
|
||||
wined3ddesc.Depth = &pDesc->Depth;
|
||||
|
||||
EnterCriticalSection(&d3d9_cs);
|
||||
|
||||
hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, Level, &wined3ddesc);
|
||||
|
||||
LeaveCriticalSection(&d3d9_cs);
|
||||
|
||||
if (SUCCEEDED(hr)) pDesc->Format = d3dformat_from_wined3dformat(format);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
pDesc->Format = d3dformat_from_wined3dformat(wined3ddesc.Format);
|
||||
pDesc->Type = wined3ddesc.Type;
|
||||
pDesc->Usage = wined3ddesc.Usage;
|
||||
pDesc->Pool = wined3ddesc.Pool;
|
||||
pDesc->Width = wined3ddesc.Width;
|
||||
pDesc->Height = wined3ddesc.Height;
|
||||
pDesc->Depth = wined3ddesc.Depth;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
|
|
@ -196,14 +196,15 @@ static HRESULT WINAPI IWineD3DVolumeImpl_GetDesc(IWineD3DVolume *iface, WINED3DV
|
|||
IWineD3DVolumeImpl *This = (IWineD3DVolumeImpl *)iface;
|
||||
TRACE("(%p) : copying into %p\n", This, pDesc);
|
||||
|
||||
*(pDesc->Format) = This->resource.format_desc->format;
|
||||
*(pDesc->Type) = This->resource.resourceType;
|
||||
*(pDesc->Usage) = This->resource.usage;
|
||||
*(pDesc->Pool) = This->resource.pool;
|
||||
*(pDesc->Size) = This->resource.size; /* dx8 only */
|
||||
*(pDesc->Width) = This->currentDesc.Width;
|
||||
*(pDesc->Height) = This->currentDesc.Height;
|
||||
*(pDesc->Depth) = This->currentDesc.Depth;
|
||||
pDesc->Format = This->resource.format_desc->format;
|
||||
pDesc->Type = This->resource.resourceType;
|
||||
pDesc->Usage = This->resource.usage;
|
||||
pDesc->Pool = This->resource.pool;
|
||||
pDesc->Size = This->resource.size; /* dx8 only */
|
||||
pDesc->Width = This->currentDesc.Width;
|
||||
pDesc->Height = This->currentDesc.Height;
|
||||
pDesc->Depth = This->currentDesc.Depth;
|
||||
|
||||
return WINED3D_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -1737,14 +1737,14 @@ typedef struct _WINED3DSURFACE_DESC
|
|||
|
||||
typedef struct _WINED3DVOLUME_DESC
|
||||
{
|
||||
WINED3DFORMAT *Format;
|
||||
WINED3DRESOURCETYPE *Type;
|
||||
DWORD *Usage;
|
||||
WINED3DPOOL *Pool;
|
||||
UINT *Size;
|
||||
UINT *Width;
|
||||
UINT *Height;
|
||||
UINT *Depth;
|
||||
WINED3DFORMAT Format;
|
||||
WINED3DRESOURCETYPE Type;
|
||||
DWORD Usage;
|
||||
WINED3DPOOL Pool;
|
||||
UINT Size;
|
||||
UINT Width;
|
||||
UINT Height;
|
||||
UINT Depth;
|
||||
} WINED3DVOLUME_DESC;
|
||||
|
||||
typedef struct _WINED3DCLIPSTATUS
|
||||
|
|
Loading…
Reference in New Issue