Commit 85f23485 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the IWineD3DBase requirement for surface_set_container().

This made sense back when we needed the container's parent and didn't know the container's type, but neither of those is true anymore.
parent ae898e0b
...@@ -457,7 +457,7 @@ HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UIN ...@@ -457,7 +457,7 @@ HRESULT cubetexture_init(IWineD3DBaseTextureImpl *texture, UINT edge_length, UIN
return hr; return hr;
} }
surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, (IWineD3DBase *)texture); surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target((IWineD3DSurfaceImpl *)surface, cube_targets[j]); surface_set_texture_target((IWineD3DSurfaceImpl *)surface, cube_targets[j]);
texture->baseTexture.sub_resources[idx] = &((IWineD3DSurfaceImpl *)surface)->resource; texture->baseTexture.sub_resources[idx] = &((IWineD3DSurfaceImpl *)surface)->resource;
TRACE("Created surface level %u @ %p.\n", i, surface); TRACE("Created surface level %u @ %p.\n", i, surface);
......
...@@ -92,7 +92,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This) ...@@ -92,7 +92,7 @@ static void surface_cleanup(IWineD3DSurfaceImpl *This)
resource_cleanup(&This->resource); resource_cleanup(&This->resource);
} }
void surface_set_container(IWineD3DSurfaceImpl *surface, enum wined3d_container_type type, IWineD3DBase *container) void surface_set_container(IWineD3DSurfaceImpl *surface, enum wined3d_container_type type, void *container)
{ {
TRACE("surface %p, container %p.\n", surface, container); TRACE("surface %p, container %p.\n", surface, container);
......
...@@ -596,7 +596,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface ...@@ -596,7 +596,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
goto err; goto err;
} }
surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain); surface_set_container(swapchain->front_buffer, WINED3D_CONTAINER_SWAPCHAIN, swapchain);
if (surface_type == SURFACE_OPENGL) if (surface_type == SURFACE_OPENGL)
{ {
surface_modify_location(swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE); surface_modify_location(swapchain->front_buffer, SFLAG_INDRAWABLE, TRUE);
...@@ -711,7 +711,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface ...@@ -711,7 +711,7 @@ HRESULT swapchain_init(IWineD3DSwapChainImpl *swapchain, WINED3DSURFTYPE surface
goto err; goto err;
} }
surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_SWAPCHAIN, (IWineD3DBase *)swapchain); surface_set_container(swapchain->back_buffers[i], WINED3D_CONTAINER_SWAPCHAIN, swapchain);
} }
} }
......
...@@ -521,7 +521,7 @@ HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height, ...@@ -521,7 +521,7 @@ HRESULT texture_init(IWineD3DBaseTextureImpl *texture, UINT width, UINT height,
return hr; return hr;
} }
surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, (IWineD3DBase *)texture); surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target((IWineD3DSurfaceImpl *)surface, texture->baseTexture.target); surface_set_texture_target((IWineD3DSurfaceImpl *)surface, texture->baseTexture.target);
texture->baseTexture.sub_resources[i] = &((IWineD3DSurfaceImpl *)surface)->resource; texture->baseTexture.sub_resources[i] = &((IWineD3DSurfaceImpl *)surface)->resource;
TRACE("Created surface level %u @ %p.\n", i, surface); TRACE("Created surface level %u @ %p.\n", i, surface);
......
...@@ -2044,9 +2044,9 @@ struct wined3d_subresource_container ...@@ -2044,9 +2044,9 @@ struct wined3d_subresource_container
enum wined3d_container_type type; enum wined3d_container_type type;
union union
{ {
struct IWineD3DBase *base;
struct IWineD3DSwapChainImpl *swapchain; struct IWineD3DSwapChainImpl *swapchain;
struct IWineD3DBaseTextureImpl *texture; struct IWineD3DBaseTextureImpl *texture;
void *base;
} u; } u;
}; };
...@@ -2157,7 +2157,7 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface, ...@@ -2157,7 +2157,7 @@ void surface_prepare_texture(IWineD3DSurfaceImpl *surface,
void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface, void surface_set_compatible_renderbuffer(IWineD3DSurfaceImpl *surface,
unsigned int width, unsigned int height) DECLSPEC_HIDDEN; unsigned int width, unsigned int height) DECLSPEC_HIDDEN;
void surface_set_container(IWineD3DSurfaceImpl *surface, void surface_set_container(IWineD3DSurfaceImpl *surface,
enum wined3d_container_type type, IWineD3DBase *container) DECLSPEC_HIDDEN; enum wined3d_container_type type, void *container) DECLSPEC_HIDDEN;
void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN; void surface_set_texture_name(IWineD3DSurfaceImpl *surface, GLuint name, BOOL srgb_name) DECLSPEC_HIDDEN;
void surface_set_texture_target(IWineD3DSurfaceImpl *surface, GLenum target) DECLSPEC_HIDDEN; void surface_set_texture_target(IWineD3DSurfaceImpl *surface, GLenum target) DECLSPEC_HIDDEN;
void surface_translate_drawable_coords(IWineD3DSurfaceImpl *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN; void surface_translate_drawable_coords(IWineD3DSurfaceImpl *surface, HWND window, RECT *rect) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment