Henri Verbeet : wined3d: Directly call basetexture_apply_state_changes().

Alexandre Julliard julliard at winehq.org
Wed May 13 10:19:40 CDT 2009


Module: wine
Branch: master
Commit: 91c3a5eac195360e6598537594edfeccb685bdab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=91c3a5eac195360e6598537594edfeccb685bdab

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue May 12 16:19:55 2009 +0200

wined3d: Directly call basetexture_apply_state_changes().

All the implementations of IWineD3DBaseTexture::ApplyStateChanges() forward to
basetexture_apply_state_changes().

---

 dlls/wined3d/basetexture.c   |    4 +++-
 dlls/wined3d/cubetexture.c   |    9 ---------
 dlls/wined3d/state.c         |    5 +++--
 dlls/wined3d/texture.c       |    8 --------
 dlls/wined3d/volumetexture.c |   10 ----------
 include/wine/wined3d.idl     |    4 ----
 6 files changed, 6 insertions(+), 34 deletions(-)

diff --git a/dlls/wined3d/basetexture.c b/dlls/wined3d/basetexture.c
index caf2148..359e3d8 100644
--- a/dlls/wined3d/basetexture.c
+++ b/dlls/wined3d/basetexture.c
@@ -322,13 +322,15 @@ void basetexture_apply_state_changes(IWineD3DBaseTexture *iface,
     GLint textureDimensions = IWineD3DBaseTexture_GetTextureDimensions(iface);
     BOOL cond_np2 = IWineD3DBaseTexture_IsCondNP2(iface);
 
+    TRACE("iface %p, textureStates %p, samplerStates %p\n", iface, textureStates, samplerStates);
+
     if(This->baseTexture.is_srgb) {
         states = This->baseTexture.srgbstates;
     } else {
         states = This->baseTexture.states;
     }
 
-    /* ApplyStateChanges relies on the correct texture being bound and loaded. */
+    /* This function relies on the correct texture being bound and loaded. */
 
     if(samplerStates[WINED3DSAMP_ADDRESSU]      != states[WINED3DTEXSTA_ADDRESSU]) {
         state = samplerStates[WINED3DSAMP_ADDRESSU];
diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c
index ce5f6b6..f29db22 100644
--- a/dlls/wined3d/cubetexture.c
+++ b/dlls/wined3d/cubetexture.c
@@ -257,14 +257,6 @@ static BOOL WINAPI IWineD3DCubeTextureImpl_IsCondNP2(IWineD3DCubeTexture *iface)
     return FALSE;
 }
 
-static void WINAPI IWineD3DCubeTextureImpl_ApplyStateChanges(IWineD3DCubeTexture *iface, 
-                                                        const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1], 
-                                                        const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) {
-    TRACE("(%p) : relay to BaseTexture\n", iface);
-    basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates);
-}
-
-
 /* *******************************************
    IWineD3DCubeTexture IWineD3DCubeTexture parts follow
    ******************************************* */
@@ -399,7 +391,6 @@ const IWineD3DCubeTextureVtbl IWineD3DCubeTexture_Vtbl =
     IWineD3DCubeTextureImpl_BindTexture,
     IWineD3DCubeTextureImpl_GetTextureDimensions,
     IWineD3DCubeTextureImpl_IsCondNP2,
-    IWineD3DCubeTextureImpl_ApplyStateChanges,
     /* IWineD3DCubeTexture */
     IWineD3DCubeTextureImpl_Destroy,
     IWineD3DCubeTextureImpl_GetLevelDesc,
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index ad1593c..e9f664c 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -3308,7 +3308,7 @@ static void sampler_texmatrix(DWORD state, IWineD3DStateBlockImpl *stateblock, W
 
     if(!texture) return;
     /* The fixed function np2 texture emulation uses the texture matrix to fix up the coordinates
-     * IWineD3DBaseTexture::ApplyStateChanges multiplies the set matrix with a fixup matrix. Before the
+     * basetexture_apply_state_changes() multiplies the set matrix with a fixup matrix. Before the
      * scaling is reapplied or removed, the texture matrix has to be reapplied
      *
      * The mapped stage is already active because the sampler() function below, which is part of the
@@ -3356,7 +3356,8 @@ static void sampler(DWORD state, IWineD3DStateBlockImpl *stateblock, WineD3DCont
         IWineD3DBaseTextureImpl *tex_impl = (IWineD3DBaseTextureImpl *) stateblock->textures[sampler];
         tex_impl->baseTexture.internal_preload(stateblock->textures[sampler], srgb ? SRGB_SRGB : SRGB_RGB);
         IWineD3DBaseTexture_BindTexture(stateblock->textures[sampler], srgb);
-        IWineD3DBaseTexture_ApplyStateChanges(stateblock->textures[sampler], stateblock->textureState[sampler], stateblock->samplerState[sampler]);
+        basetexture_apply_state_changes(stateblock->textures[sampler],
+                stateblock->textureState[sampler], stateblock->samplerState[sampler]);
 
         if (GL_SUPPORT(EXT_TEXTURE_LOD_BIAS)) {
             tmpvalue.d = stateblock->samplerState[sampler][WINED3DSAMP_MIPMAPLODBIAS];
diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index dda4353..5981a33 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -271,13 +271,6 @@ static BOOL WINAPI IWineD3DTextureImpl_IsCondNP2(IWineD3DTexture *iface) {
     return This->cond_np2;
 }
 
-static void WINAPI IWineD3DTextureImpl_ApplyStateChanges(IWineD3DTexture *iface,
-                                                   const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1],
-                                                   const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) {
-    TRACE("(%p) : relay to BaseTexture\n", iface);
-    basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates);
-}
-
 /* *******************************************
    IWineD3DTexture IWineD3DTexture parts follow
    ******************************************* */
@@ -401,7 +394,6 @@ const IWineD3DTextureVtbl IWineD3DTexture_Vtbl =
     IWineD3DTextureImpl_BindTexture,
     IWineD3DTextureImpl_GetTextureDimensions,
     IWineD3DTextureImpl_IsCondNP2,
-    IWineD3DTextureImpl_ApplyStateChanges,
     /* IWineD3DTexture */
     IWineD3DTextureImpl_Destroy,
     IWineD3DTextureImpl_GetLevelDesc,
diff --git a/dlls/wined3d/volumetexture.c b/dlls/wined3d/volumetexture.c
index 41a1160..680df93 100644
--- a/dlls/wined3d/volumetexture.c
+++ b/dlls/wined3d/volumetexture.c
@@ -211,15 +211,6 @@ static BOOL WINAPI IWineD3DVolumeTextureImpl_IsCondNP2(IWineD3DVolumeTexture *if
     return FALSE;
 }
 
-static void WINAPI IWineD3DVolumeTextureImpl_ApplyStateChanges(IWineD3DVolumeTexture *iface,
-                                                        const DWORD textureStates[WINED3D_HIGHEST_TEXTURE_STATE + 1],
-                                                        const DWORD samplerStates[WINED3D_HIGHEST_SAMPLER_STATE + 1]) {
-    IWineD3DVolumeTextureImpl *This = (IWineD3DVolumeTextureImpl *)iface;
-    TRACE("(%p) : nothing to do, passing to base texture\n", This);
-    basetexture_apply_state_changes((IWineD3DBaseTexture *)iface, textureStates, samplerStates);
-}
-
-
 /* *******************************************
    IWineD3DVolumeTexture IWineD3DVolumeTexture parts follow
    ******************************************* */
@@ -330,7 +321,6 @@ const IWineD3DVolumeTextureVtbl IWineD3DVolumeTexture_Vtbl =
     IWineD3DVolumeTextureImpl_BindTexture,
     IWineD3DVolumeTextureImpl_GetTextureDimensions,
     IWineD3DVolumeTextureImpl_IsCondNP2,
-    IWineD3DVolumeTextureImpl_ApplyStateChanges,
     /* volume texture */
     IWineD3DVolumeTextureImpl_Destroy,
     IWineD3DVolumeTextureImpl_GetLevelDesc,
diff --git a/include/wine/wined3d.idl b/include/wine/wined3d.idl
index 3845ded..7a476e8 100644
--- a/include/wine/wined3d.idl
+++ b/include/wine/wined3d.idl
@@ -2616,10 +2616,6 @@ interface IWineD3DBaseTexture : IWineD3DResource
     );
     BOOL IsCondNP2(
     );
-    void ApplyStateChanges(
-        const DWORD texture_states[WINED3D_HIGHEST_TEXTURE_STATE + 1],
-        const DWORD sampler_states[WINED3D_HIGHEST_SAMPLER_STATE + 1]
-    );
 }
 
 [




More information about the wine-cvs mailing list