Module: wine Branch: master Commit: f78d85ffe15ddaa73a4da4857f01065a0a733a07 URL: http://source.winehq.org/git/wine.git/?a=commit;h=f78d85ffe15ddaa73a4da4857f...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Mon Apr 26 21:33:03 2010 +0200
wined3d: Simply pass an IWineD3DSurfaceImpl pointer to surface_set_texture_target().
---
dlls/wined3d/cubetexture.c | 4 ++-- dlls/wined3d/surface.c | 18 ++++++++---------- dlls/wined3d/texture.c | 4 ++-- dlls/wined3d/wined3d_private.h | 2 +- 4 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 44f6196..c11e32b 100644 --- a/dlls/wined3d/cubetexture.c +++ b/dlls/wined3d/cubetexture.c @@ -126,7 +126,7 @@ static void cubetexture_cleanup(IWineD3DCubeTextureImpl *This) * surface doesn't try and release it. */ surface_set_texture_name(surface, 0, TRUE); surface_set_texture_name(surface, 0, FALSE); - surface_set_texture_target((IWineD3DSurface *)surface, 0); + surface_set_texture_target(surface, 0); IWineD3DSurface_SetContainer((IWineD3DSurface *)surface, NULL); IWineD3DSurface_Release((IWineD3DSurface *)surface); } @@ -559,7 +559,7 @@ HRESULT cubetexture_init(IWineD3DCubeTextureImpl *texture, UINT edge_length, UIN }
IWineD3DSurface_SetContainer(surface, (IWineD3DBase *)texture); - surface_set_texture_target(surface, cube_targets[j]); + surface_set_texture_target((IWineD3DSurfaceImpl *)surface, cube_targets[j]); texture->baseTexture.sub_resources[idx] = (IWineD3DResourceImpl *)surface; TRACE("Created surface level %u @ %p.\n", i, surface); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index efe5030..d5df8e2 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -499,25 +499,23 @@ void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint new_name, BOO surface_force_reload(surface); }
-void surface_set_texture_target(IWineD3DSurface *iface, GLenum target) +void surface_set_texture_target(IWineD3DSurfaceImpl *surface, GLenum target) { - IWineD3DSurfaceImpl *This = (IWineD3DSurfaceImpl *)iface; - - TRACE("(%p) : setting target %#x\n", This, target); + TRACE("surface %p, target %#x.\n", surface, target);
- if (This->texture_target != target) + if (surface->texture_target != target) { if (target == GL_TEXTURE_RECTANGLE_ARB) { - This->Flags &= ~SFLAG_NORMCOORD; + surface->Flags &= ~SFLAG_NORMCOORD; } - else if (This->texture_target == GL_TEXTURE_RECTANGLE_ARB) + else if (surface->texture_target == GL_TEXTURE_RECTANGLE_ARB) { - This->Flags |= SFLAG_NORMCOORD; + surface->Flags |= SFLAG_NORMCOORD; } } - This->texture_target = target; - surface_force_reload(This); + surface->texture_target = target; + surface_force_reload(surface); }
/* Context activation is done by the caller. */ diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 35d5e61..0de3f06 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -118,7 +118,7 @@ static void texture_cleanup(IWineD3DTextureImpl *This) * surface doesn't try and release it */ surface_set_texture_name(surface, 0, TRUE); surface_set_texture_name(surface, 0, FALSE); - surface_set_texture_target((IWineD3DSurface *)surface, 0); + surface_set_texture_target(surface, 0); IWineD3DSurface_SetContainer((IWineD3DSurface *)surface, NULL); IWineD3DSurface_Release((IWineD3DSurface *)surface); } @@ -612,7 +612,7 @@ HRESULT texture_init(IWineD3DTextureImpl *texture, UINT width, UINT height, UINT }
IWineD3DSurface_SetContainer(surface, (IWineD3DBase *)texture); - surface_set_texture_target(surface, texture->target); + surface_set_texture_target((IWineD3DSurfaceImpl *)surface, texture->target); texture->baseTexture.sub_resources[i] = (IWineD3DResourceImpl *)surface; TRACE("Created surface level %u @ %p.\n", i, surface); /* Calculate the next mipmap level. */ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6ada851..e8f8d6a 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2681,7 +2681,7 @@ void surface_modify_ds_location(IWineD3DSurfaceImpl *surface, DWORD location) DE void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, unsigned int width, unsigned int height) DECLSPEC_HIDDEN; void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN; -void surface_set_texture_target(IWineD3DSurface *iface, GLenum target) DECLSPEC_HIDDEN; +void surface_set_texture_target(IWineD3DSurfaceImpl *surface, GLenum target) DECLSPEC_HIDDEN;
BOOL getColorBits(const struct wined3d_format_desc *format_desc, short *redSize, short *greenSize, short *blueSize, short *alphaSize, short *totalSize) DECLSPEC_HIDDEN;