Peter Beutner : d3d8: Fix GetDesc and GetLevelDesc for surfaces and textures.

Alexandre Julliard julliard at wine.codeweavers.com
Sat May 20 11:22:56 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 5c4a1fc8deae007c2469394ebccbffc878a73662
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=5c4a1fc8deae007c2469394ebccbffc878a73662

Author: Peter Beutner <p.beutner at gmx.net>
Date:   Fri May 19 14:17:56 2006 +0200

d3d8: Fix GetDesc and GetLevelDesc for surfaces and textures.

In DX8 the D3DSURFACE_DESC structure has a size field which needs to be set.

---

 dlls/d3d8/cubetexture.c |    5 ++---
 dlls/d3d8/surface.c     |    5 ++---
 dlls/d3d8/texture.c     |    5 ++---
 dlls/d3d8/volume.c      |    5 ++---
 4 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/dlls/d3d8/cubetexture.c b/dlls/d3d8/cubetexture.c
index 2498855..3f742fe 100644
--- a/dlls/d3d8/cubetexture.c
+++ b/dlls/d3d8/cubetexture.c
@@ -134,16 +134,15 @@ DWORD WINAPI IDirect3DCubeTexture8Impl_G
 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;
diff --git a/dlls/d3d8/surface.c b/dlls/d3d8/surface.c
index 4153ea1..d264ac2 100644
--- a/dlls/d3d8/surface.c
+++ b/dlls/d3d8/surface.c
@@ -156,16 +156,15 @@ HRESULT WINAPI IDirect3DSurface8Impl_Get
 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;
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c
index 736673a..c379489 100644
--- a/dlls/d3d8/texture.c
+++ b/dlls/d3d8/texture.c
@@ -135,16 +135,15 @@ HRESULT WINAPI IDirect3DTexture8Impl_Get
     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;
diff --git a/dlls/d3d8/volume.c b/dlls/d3d8/volume.c
index cbde666..bb7f5b1 100644
--- a/dlls/d3d8/volume.c
+++ b/dlls/d3d8/volume.c
@@ -132,16 +132,15 @@ HRESULT WINAPI IDirect3DVolume8Impl_GetC
 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;




More information about the wine-cvs mailing list