[PATCH 2/4] wined3d: Move the GetLevelDesc() functions to the IWineD3DBaseTexture interface.

Henri Verbeet hverbeet at codeweavers.com
Tue Mar 8 12:41:06 CST 2011


---
 dlls/d3d8/cubetexture.c      |    2 +-
 dlls/d3d8/texture.c          |    2 +-
 dlls/d3d8/volumetexture.c    |    2 +-
 dlls/d3d9/cubetexture.c      |    2 +-
 dlls/d3d9/texture.c          |    2 +-
 dlls/d3d9/volumetexture.c    |    2 +-
 dlls/ddraw/device.c          |    6 +++---
 dlls/wined3d/cubetexture.c   |    4 ++--
 dlls/wined3d/texture.c       |    4 ++--
 dlls/wined3d/volumetexture.c |    5 ++---
 include/wine/wined3d.idl     |   16 ++++------------
 11 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/dlls/d3d8/cubetexture.c b/dlls/d3d8/cubetexture.c
index 6c70afb..298988d 100644
--- a/dlls/d3d8/cubetexture.c
+++ b/dlls/d3d8/cubetexture.c
@@ -260,7 +260,7 @@ static HRESULT WINAPI IDirect3DCubeTexture8Impl_GetLevelDesc(IDirect3DCubeTextur
     TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
 
     wined3d_mutex_lock();
-    hr = IWineD3DCubeTexture_GetLevelDesc(This->wineD3DCubeTexture, level, &wined3d_desc);
+    hr = IWineD3DCubeTexture_GetSubResourceDesc(This->wineD3DCubeTexture, level, &wined3d_desc);
     wined3d_mutex_unlock();
 
     if (SUCCEEDED(hr))
diff --git a/dlls/d3d8/texture.c b/dlls/d3d8/texture.c
index c358ed0..c7bc4bd 100644
--- a/dlls/d3d8/texture.c
+++ b/dlls/d3d8/texture.c
@@ -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();
-    hr = IWineD3DTexture_GetLevelDesc(This->wineD3DTexture, level, &wined3d_desc);
+    hr = IWineD3DTexture_GetSubResourceDesc(This->wineD3DTexture, level, &wined3d_desc);
     wined3d_mutex_unlock();
 
     if (SUCCEEDED(hr))
diff --git a/dlls/d3d8/volumetexture.c b/dlls/d3d8/volumetexture.c
index 3e2ee58..6b4ce3a 100644
--- a/dlls/d3d8/volumetexture.c
+++ b/dlls/d3d8/volumetexture.c
@@ -234,7 +234,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture8Impl_GetLevelDesc(IDirect3DVolumeTe
     TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
 
     wined3d_mutex_lock();
-    hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, level, &wined3d_desc);
+    hr = IWineD3DVolumeTexture_GetSubResourceDesc(This->wineD3DVolumeTexture, level, &wined3d_desc);
     wined3d_mutex_unlock();
 
     if (SUCCEEDED(hr))
diff --git a/dlls/d3d9/cubetexture.c b/dlls/d3d9/cubetexture.c
index 583efb1..eacc61e 100644
--- a/dlls/d3d9/cubetexture.c
+++ b/dlls/d3d9/cubetexture.c
@@ -276,7 +276,7 @@ static HRESULT WINAPI IDirect3DCubeTexture9Impl_GetLevelDesc(IDirect3DCubeTextur
     TRACE("iface %p, level %u, desc %p.\n", iface, level, desc);
 
     wined3d_mutex_lock();
-    hr = IWineD3DCubeTexture_GetLevelDesc(This->wineD3DCubeTexture, level, &wined3d_desc);
+    hr = IWineD3DCubeTexture_GetSubResourceDesc(This->wineD3DCubeTexture, level, &wined3d_desc);
     wined3d_mutex_unlock();
 
     if (SUCCEEDED(hr))
diff --git a/dlls/d3d9/texture.c b/dlls/d3d9/texture.c
index c7696a3..e94a172 100644
--- a/dlls/d3d9/texture.c
+++ b/dlls/d3d9/texture.c
@@ -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();
-    hr = IWineD3DTexture_GetLevelDesc(This->wineD3DTexture, level, &wined3d_desc);
+    hr = IWineD3DTexture_GetSubResourceDesc(This->wineD3DTexture, level, &wined3d_desc);
     wined3d_mutex_unlock();
 
     if (SUCCEEDED(hr))
diff --git a/dlls/d3d9/volumetexture.c b/dlls/d3d9/volumetexture.c
index b1b43a9..c976e87 100644
--- a/dlls/d3d9/volumetexture.c
+++ b/dlls/d3d9/volumetexture.c
@@ -298,7 +298,7 @@ static HRESULT WINAPI IDirect3DVolumeTexture9Impl_GetLevelDesc(IDirect3DVolumeTe
 
     wined3d_mutex_lock();
 
-    hr = IWineD3DVolumeTexture_GetLevelDesc(This->wineD3DVolumeTexture, level, &wined3d_desc);
+    hr = IWineD3DVolumeTexture_GetSubResourceDesc(This->wineD3DVolumeTexture, level, &wined3d_desc);
 
     wined3d_mutex_unlock();
 
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
index 9632947..b55994d 100644
--- a/dlls/ddraw/device.c
+++ b/dlls/ddraw/device.c
@@ -2506,7 +2506,7 @@ IDirect3DDeviceImpl_3_GetRenderState(IDirect3DDevice3 *iface,
 
                 if(hr == WINED3D_OK && tex)
                 {
-                    hr = IWineD3DTexture_GetLevelDesc((IWineD3DTexture*) tex, 0, &desc);
+                    hr = IWineD3DBaseTexture_GetSubResourceDesc(tex, 0, &desc);
                     if (SUCCEEDED(hr))
                     {
                         ddfmt.dwSize = sizeof(ddfmt);
@@ -2815,7 +2815,7 @@ IDirect3DDeviceImpl_3_SetRenderState(IDirect3DDevice3 *iface,
                     if(hr == WINED3D_OK && tex)
                     {
                         memset(&desc, 0, sizeof(desc));
-                        hr = IWineD3DTexture_GetLevelDesc((IWineD3DTexture*) tex, 0, &desc);
+                        hr = IWineD3DBaseTexture_GetSubResourceDesc(tex, 0, &desc);
                         if (SUCCEEDED(hr))
                         {
                             ddfmt.dwSize = sizeof(ddfmt);
@@ -4588,7 +4588,7 @@ IDirect3DDeviceImpl_3_SetTexture(IDirect3DDevice3 *iface,
         if(result == WINED3D_OK && tex)
         {
             memset(&desc, 0, sizeof(desc));
-            result = IWineD3DTexture_GetLevelDesc((IWineD3DTexture*) tex, 0, &desc);
+            result = IWineD3DBaseTexture_GetSubResourceDesc(tex, 0, &desc);
             if (SUCCEEDED(result))
             {
                 ddfmt.dwSize = sizeof(ddfmt);
diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c
index 5df720c..d4e5d21 100644
--- a/dlls/wined3d/cubetexture.c
+++ b/dlls/wined3d/cubetexture.c
@@ -326,7 +326,7 @@ static BOOL WINAPI IWineD3DCubeTextureImpl_IsCondNP2(IWineD3DCubeTexture *iface)
     return FALSE;
 }
 
-static HRESULT WINAPI IWineD3DCubeTextureImpl_GetLevelDesc(IWineD3DCubeTexture *iface,
+static HRESULT WINAPI IWineD3DCubeTextureImpl_GetSubResourceDesc(IWineD3DCubeTexture *iface,
         UINT sub_resource_idx, struct wined3d_resource_desc *desc)
 {
     IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@@ -450,8 +450,8 @@ static const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
     IWineD3DCubeTextureImpl_GetAutoGenFilterType,
     IWineD3DCubeTextureImpl_GenerateMipSubLevels,
     IWineD3DCubeTextureImpl_IsCondNP2,
+    IWineD3DCubeTextureImpl_GetSubResourceDesc,
     /* IWineD3DCubeTexture */
-    IWineD3DCubeTextureImpl_GetLevelDesc,
     IWineD3DCubeTextureImpl_GetCubeMapSurface,
     IWineD3DCubeTextureImpl_Map,
     IWineD3DCubeTextureImpl_Unmap,
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index 1af3412..7a78ad8 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -351,7 +351,7 @@ static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) {
     return This->cond_np2;
 }
 
-static HRESULT WINAPI IWineD3DTextureImpl_GetLevelDesc(IWineD3DTexture *iface,
+static HRESULT WINAPI IWineD3DTextureImpl_GetSubResourceDesc(IWineD3DTexture *iface,
         UINT sub_resource_idx, struct wined3d_resource_desc *desc)
 {
     IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@@ -468,8 +468,8 @@ static const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
     IWineD3DTextureImpl_GetAutoGenFilterType,
     IWineD3DTextureImpl_GenerateMipSubLevels,
     IWineD3DTextureImpl_IsCondNP2,
+    IWineD3DTextureImpl_GetSubResourceDesc,
     /* IWineD3DTexture */
-    IWineD3DTextureImpl_GetLevelDesc,
     IWineD3DTextureImpl_GetSurfaceLevel,
     IWineD3DTextureImpl_Map,
     IWineD3DTextureImpl_Unmap,
diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c
index 9c6b57d..78ded41 100644
--- a/dlls/wined3d/volumetexture.c
+++ b/dlls/wined3d/volumetexture.c
@@ -263,7 +263,7 @@ static BOOL WINAPI IWineD3DVolumeTextureImpl_IsCondNP2(IWineD3DVolumeTexture *if
     return FALSE;
 }
 
-static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetLevelDesc(IWineD3DVolumeTexture *iface,
+static HRESULT WINAPI IWineD3DVolumeTextureImpl_GetSubResourceDesc(IWineD3DVolumeTexture *iface,
         UINT sub_resource_idx, struct wined3d_resource_desc *desc)
 {
     IWineD3DBaseTextureImpl *texture = (IWineD3DBaseTextureImpl *)iface;
@@ -380,10 +380,9 @@ static const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
     IWineD3DVolumeTextureImpl_SetAutoGenFilterType,
     IWineD3DVolumeTextureImpl_GetAutoGenFilterType,
     IWineD3DVolumeTextureImpl_GenerateMipSubLevels,
-    /* not in d3d */
     IWineD3DVolumeTextureImpl_IsCondNP2,
+    IWineD3DVolumeTextureImpl_GetSubResourceDesc,
     /* volume texture */
-    IWineD3DVolumeTextureImpl_GetLevelDesc,
     IWineD3DVolumeTextureImpl_GetVolumeLevel,
     IWineD3DVolumeTextureImpl_Map,
     IWineD3DVolumeTextureImpl_Unmap,
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 36addd6..8acc0bb 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2362,6 +2362,10 @@ interface IWineD3DBaseTexture : IWineD3DResource
     );
     BOOL IsCondNP2(
     );
+    HRESULT GetSubResourceDesc(
+        [in] UINT sub_resource_idx,
+        [out] struct wined3d_resource_desc *desc
+    );
 }
 
 [
@@ -2371,10 +2375,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
 ]
 interface IWineD3DTexture : IWineD3DBaseTexture
 {
-    HRESULT GetLevelDesc(
-        [in] UINT sub_resource_idx,
-        [out] struct wined3d_resource_desc *desc
-    );
     HRESULT GetSurfaceLevel(
         [in] UINT sub_resource_idx,
         [out] IWineD3DSurface **surface
@@ -2400,10 +2400,6 @@ interface IWineD3DTexture : IWineD3DBaseTexture
 ]
 interface IWineD3DCubeTexture : IWineD3DBaseTexture
 {
-    HRESULT GetLevelDesc(
-        [in] UINT sub_resource_idx,
-        [out] struct wined3d_resource_desc *desc
-    );
     HRESULT GetCubeMapSurface(
         [in] UINT sub_resource_idx,
         [out] IWineD3DSurface **surface
@@ -2430,10 +2426,6 @@ interface IWineD3DCubeTexture : IWineD3DBaseTexture
 ]
 interface IWineD3DVolumeTexture : IWineD3DBaseTexture
 {
-    HRESULT GetLevelDesc(
-        [in] UINT sub_resource_idx,
-        [out] struct wined3d_resource_desc *desc
-    );
     HRESULT GetVolumeLevel(
         [in] UINT sub_resource_idx,
         [out] IWineD3DVolume **volume
-- 
1.7.3.4




More information about the wine-patches mailing list