H. Verbeet : wined3d: Move binding the texture and dirtifying the sampler to its own function from surface_download_data ().

Alexandre Julliard julliard at winehq.org
Thu Jan 3 06:43:39 CST 2008


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

Author: H. Verbeet <hverbeet at gmail.com>
Date:   Wed Jan  2 19:52:22 2008 +0100

wined3d: Move binding the texture and dirtifying the sampler to its own function from surface_download_data().

---

 dlls/wined3d/surface.c |   22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 29bc21c..734568a 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -36,6 +36,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_surface);
 HRESULT d3dfmt_convert_surface(BYTE *src, BYTE *dst, UINT pitch, UINT width, UINT height, UINT outpitch, CONVERT_TYPES convert, IWineD3DSurfaceImpl *surf);
 static void d3dfmt_p8_init_palette(IWineD3DSurfaceImpl *This, BYTE table[256][4], BOOL colorkey);
 
+static void surface_bind_and_dirtify(IWineD3DSurfaceImpl *This) {
+    /* Make sure that a proper texture unit is selected, bind the texture
+     * and dirtify the sampler to restore the texture on the next draw. */
+    if (GL_SUPPORT(ARB_MULTITEXTURE)) {
+        GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
+        checkGLcall("glActiveTextureARB");
+    }
+    IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(0));
+    IWineD3DSurface_BindTexture((IWineD3DSurface *)This);
+}
+
 static void surface_download_data(IWineD3DSurfaceImpl *This) {
     IWineD3DDeviceImpl *myDevice = This->resource.wineD3DDevice;
 
@@ -52,15 +63,8 @@ static void surface_download_data(IWineD3DSurfaceImpl *This) {
     }
 
     ENTER_GL();
-            /* Make sure that a proper texture unit is selected, bind the texture
-    * and dirtify the sampler to restore the texture on the next draw
-            */
-    if (GL_SUPPORT(ARB_MULTITEXTURE)) {
-        GL_EXTCALL(glActiveTextureARB(GL_TEXTURE0_ARB));
-        checkGLcall("glActiveTextureARB");
-    }
-    IWineD3DDeviceImpl_MarkStateDirty(This->resource.wineD3DDevice, STATE_SAMPLER(0));
-    IWineD3DSurface_BindTexture((IWineD3DSurface *) This);
+
+    surface_bind_and_dirtify(This);
 
     if (This->resource.format == WINED3DFMT_DXT1 ||
             This->resource.format == WINED3DFMT_DXT2 || This->resource.format == WINED3DFMT_DXT3 ||




More information about the wine-cvs mailing list