Commit 5c4a1fc8 authored by Peter Beutner's avatar Peter Beutner Committed by Alexandre Julliard

d3d8: Fix GetDesc and GetLevelDesc for surfaces and textures.

In DX8 the D3DSURFACE_DESC structure has a size field which needs to be set.
parent 4a1375bd
......@@ -134,16 +134,15 @@ DWORD WINAPI IDirect3DCubeTexture8Impl_GetLevelCount(LPDIRECT3DCUBETEXTURE8 ifac
HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(LPDIRECT3DCUBETEXTURE8 iface, UINT Level, D3DSURFACE_DESC *pDesc) {
IDirect3DCubeTexture8Impl *This = (IDirect3DCubeTexture8Impl *)iface;
WINED3DSURFACE_DESC wined3ddesc;
UINT tmpInt = -1;
TRACE("(%p) Relay\n", This);
/* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */
/* 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 = &tmpInt;
wined3ddesc.Size = &pDesc->Size;
wined3ddesc.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pDesc->MultiSampleType;
wined3ddesc.MultiSampleQuality = NULL; /* DirectX9 only */
wined3ddesc.Width = &pDesc->Width;
......
......@@ -156,16 +156,15 @@ HRESULT WINAPI IDirect3DSurface8Impl_GetContainer(LPDIRECT3DSURFACE8 iface, REFI
HRESULT WINAPI IDirect3DSurface8Impl_GetDesc(LPDIRECT3DSURFACE8 iface, D3DSURFACE_DESC *pDesc) {
IDirect3DSurface8Impl *This = (IDirect3DSurface8Impl *)iface;
WINED3DSURFACE_DESC wined3ddesc;
UINT tmpInt = -1;
TRACE("(%p) Relay\n", This);
/* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */
/* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */
memset(&wined3ddesc, 0, sizeof(wined3ddesc));
wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format;
wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type;
wined3ddesc.Usage = &pDesc->Usage;
wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool;
wined3ddesc.Size = &tmpInt;
wined3ddesc.Size = &pDesc->Size;
wined3ddesc.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pDesc->MultiSampleType;
wined3ddesc.Width = &pDesc->Width;
wined3ddesc.Height = &pDesc->Height;
......
......@@ -135,16 +135,15 @@ HRESULT WINAPI IDirect3DTexture8Impl_GetLevelDesc(LPDIRECT3DTEXTURE8 iface, UINT
IDirect3DTexture8Impl *This = (IDirect3DTexture8Impl *)iface;
WINED3DSURFACE_DESC wined3ddesc;
UINT tmpInt = -1;
TRACE("(%p) Relay\n", This);
/* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */
/* As d3d8 and d3d9 structures differ, pass in ptrs to where data needs to go */
memset(&wined3ddesc, 0, sizeof(wined3ddesc));
wined3ddesc.Format = (WINED3DFORMAT *)&pDesc->Format;
wined3ddesc.Type = (WINED3DRESOURCETYPE *)&pDesc->Type;
wined3ddesc.Usage = &pDesc->Usage;
wined3ddesc.Pool = (WINED3DPOOL *) &pDesc->Pool;
wined3ddesc.Size = &tmpInt; /* required for d3d8 */
wined3ddesc.Size = &pDesc->Size;
wined3ddesc.MultiSampleType = (WINED3DMULTISAMPLE_TYPE *) &pDesc->MultiSampleType;
wined3ddesc.Width = &pDesc->Width;
wined3ddesc.Height = &pDesc->Height;
......
......@@ -132,16 +132,15 @@ HRESULT WINAPI IDirect3DVolume8Impl_GetContainer(LPDIRECT3DVOLUME8 iface, REFIID
HRESULT WINAPI IDirect3DVolume8Impl_GetDesc(LPDIRECT3DVOLUME8 iface, D3DVOLUME_DESC *pDesc) {
IDirect3DVolume8Impl *This = (IDirect3DVolume8Impl *)iface;
WINED3DVOLUME_DESC wined3ddesc;
UINT tmpInt = -1;
TRACE("(%p) Relay\n", This);
/* As d3d8 and d3d8 structures differ, pass in ptrs to where data needs to go */
/* 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 = &tmpInt;
wined3ddesc.Size = &pDesc->Size;
wined3ddesc.Width = &pDesc->Width;
wined3ddesc.Height = &pDesc->Height;
wined3ddesc.Depth = &pDesc->Depth;
......
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