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

This commit is contained in:
H. Verbeet 2008-01-02 19:52:22 +01:00 committed by Alexandre Julliard
parent 2820ecc5fe
commit 6cab4c8005
1 changed files with 13 additions and 9 deletions

View File

@ -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 ||