diff --git a/dlls/wined3d/cubetexture.c b/dlls/wined3d/cubetexture.c index 44f61968d16..c11e32ba8fb 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 efe5030d5c7..d5df8e28b5d 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("surface %p, target %#x.\n", surface, target); - TRACE("(%p) : setting target %#x\n", This, 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 35d5e610589..0de3f069889 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 6ada85119fc..e8f8d6a0b78 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;