Commit c4b73c45 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Get rid of the IWineD3DSurface typedefs.

parent 1c1de920
...@@ -6862,7 +6862,7 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv, ...@@ -6862,7 +6862,7 @@ static GLuint gen_p8_shader(struct arbfp_blit_priv *priv,
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void upload_palette(IWineD3DSurfaceImpl *surface) static void upload_palette(struct wined3d_surface *surface)
{ {
BYTE table[256][4]; BYTE table[256][4];
IWineD3DDeviceImpl *device = surface->resource.device; IWineD3DDeviceImpl *device = surface->resource.device;
...@@ -7051,7 +7051,7 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_ ...@@ -7051,7 +7051,7 @@ static GLuint gen_yuv_shader(struct arbfp_blit_priv *priv, const struct wined3d_
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static HRESULT arbfp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, IWineD3DSurfaceImpl *surface) static HRESULT arbfp_blit_set(void *blit_priv, const struct wined3d_gl_info *gl_info, struct wined3d_surface *surface)
{ {
GLenum shader; GLenum shader;
float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f}; float size[4] = {(float) surface->pow2Width, (float) surface->pow2Height, 1.0f, 1.0f};
...@@ -7195,9 +7195,8 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum win ...@@ -7195,9 +7195,8 @@ static BOOL arbfp_blit_supported(const struct wined3d_gl_info *gl_info, enum win
} }
} }
HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_surface, const RECT *src_rect, HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, struct wined3d_surface *src_surface, const RECT *src_rect,
IWineD3DSurfaceImpl *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op, struct wined3d_surface *dst_surface, const RECT *dst_rect_in, enum wined3d_blit_op blit_op, DWORD Filter)
DWORD Filter)
{ {
struct wined3d_context *context; struct wined3d_context *context;
RECT dst_rect = *dst_rect_in; RECT dst_rect = *dst_rect_in;
...@@ -7236,7 +7235,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_ ...@@ -7236,7 +7235,7 @@ HRESULT arbfp_blit_surface(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *src_
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *dst_surface, static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, struct wined3d_surface *dst_surface,
const RECT *dst_rect, const WINED3DCOLORVALUE *color) const RECT *dst_rect, const WINED3DCOLORVALUE *color)
{ {
FIXME("Color filling not implemented by arbfp_blit\n"); FIXME("Color filling not implemented by arbfp_blit\n");
...@@ -7245,7 +7244,7 @@ static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurface ...@@ -7245,7 +7244,7 @@ static HRESULT arbfp_blit_color_fill(IWineD3DDeviceImpl *device, IWineD3DSurface
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static HRESULT arbfp_blit_depth_fill(IWineD3DDeviceImpl *device, static HRESULT arbfp_blit_depth_fill(IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *surface, const RECT *rect, float depth) struct wined3d_surface *surface, const RECT *rect, float depth)
{ {
FIXME("Depth filling not implemented by arbfp_blit.\n"); FIXME("Depth filling not implemented by arbfp_blit.\n");
return WINED3DERR_INVALIDCALL; return WINED3DERR_INVALIDCALL;
......
...@@ -113,7 +113,7 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo) ...@@ -113,7 +113,7 @@ static void context_destroy_fbo(struct wined3d_context *context, GLuint *fbo)
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_apply_attachment_filter_states(const struct wined3d_context *context, static void context_apply_attachment_filter_states(const struct wined3d_context *context,
IWineD3DSurfaceImpl *surface, DWORD location) struct wined3d_surface *surface, DWORD location)
{ {
/* Update base texture states array */ /* Update base texture states array */
if (surface->container.type == WINED3D_CONTAINER_TEXTURE) if (surface->container.type == WINED3D_CONTAINER_TEXTURE)
...@@ -191,7 +191,7 @@ static void context_apply_attachment_filter_states(const struct wined3d_context ...@@ -191,7 +191,7 @@ static void context_apply_attachment_filter_states(const struct wined3d_context
/* GL locking is done by the caller */ /* GL locking is done by the caller */
void context_attach_depth_stencil_fbo(struct wined3d_context *context, void context_attach_depth_stencil_fbo(struct wined3d_context *context,
GLenum fbo_target, IWineD3DSurfaceImpl *depth_stencil, BOOL use_render_buffer) GLenum fbo_target, struct wined3d_surface *depth_stencil, BOOL use_render_buffer)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
...@@ -263,7 +263,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context, ...@@ -263,7 +263,7 @@ void context_attach_depth_stencil_fbo(struct wined3d_context *context,
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_attach_surface_fbo(const struct wined3d_context *context, static void context_attach_surface_fbo(const struct wined3d_context *context,
GLenum fbo_target, DWORD idx, IWineD3DSurfaceImpl *surface, DWORD location) GLenum fbo_target, DWORD idx, struct wined3d_surface *surface, DWORD location)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
...@@ -308,9 +308,12 @@ void context_check_fbo_status(struct wined3d_context *context, GLenum target) ...@@ -308,9 +308,12 @@ void context_check_fbo_status(struct wined3d_context *context, GLenum target)
if (status == GL_FRAMEBUFFER_COMPLETE) if (status == GL_FRAMEBUFFER_COMPLETE)
{ {
TRACE("FBO complete\n"); TRACE("FBO complete\n");
} else { }
IWineD3DSurfaceImpl *attachment; else
{
struct wined3d_surface *attachment;
unsigned int i; unsigned int i;
FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status); FIXME("FBO status %s (%#x)\n", debug_fbostatus(status), status);
if (!context->current_fbo) if (!context->current_fbo)
...@@ -344,7 +347,7 @@ void context_check_fbo_status(struct wined3d_context *context, GLenum target) ...@@ -344,7 +347,7 @@ void context_check_fbo_status(struct wined3d_context *context, GLenum target)
} }
static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *context, static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *context,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, DWORD location) struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil, DWORD location)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry; struct fbo_entry *entry;
...@@ -362,7 +365,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex ...@@ -362,7 +365,7 @@ static struct fbo_entry *context_create_fbo_entry(struct wined3d_context *contex
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum target, static void context_reuse_fbo_entry(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil,
DWORD location, struct fbo_entry *entry) DWORD location, struct fbo_entry *entry)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
...@@ -393,7 +396,7 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb ...@@ -393,7 +396,7 @@ static void context_destroy_fbo_entry(struct wined3d_context *context, struct fb
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context, GLenum target, static struct fbo_entry *context_find_fbo_entry(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, DWORD location) struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil, DWORD location)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry; struct fbo_entry *entry;
...@@ -474,7 +477,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ ...@@ -474,7 +477,7 @@ static void context_apply_fbo_entry(struct wined3d_context *context, GLenum targ
/* GL locking is done by the caller */ /* GL locking is done by the caller */
static void context_apply_fbo_state(struct wined3d_context *context, GLenum target, static void context_apply_fbo_state(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl **render_targets, IWineD3DSurfaceImpl *depth_stencil, DWORD location) struct wined3d_surface **render_targets, struct wined3d_surface *depth_stencil, DWORD location)
{ {
struct fbo_entry *entry, *entry2; struct fbo_entry *entry, *entry2;
...@@ -503,7 +506,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ ...@@ -503,7 +506,7 @@ static void context_apply_fbo_state(struct wined3d_context *context, GLenum targ
/* GL locking is done by the caller */ /* GL locking is done by the caller */
void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target, void context_apply_fbo_state_blit(struct wined3d_context *context, GLenum target,
IWineD3DSurfaceImpl *render_target, IWineD3DSurfaceImpl *depth_stencil, DWORD location) struct wined3d_surface *render_target, struct wined3d_surface *depth_stencil, DWORD location)
{ {
if (location != SFLAG_INDRAWABLE || surface_is_offscreen(render_target)) if (location != SFLAG_INDRAWABLE || surface_is_offscreen(render_target))
{ {
...@@ -650,7 +653,7 @@ void context_free_event_query(struct wined3d_event_query *query) ...@@ -650,7 +653,7 @@ void context_free_event_query(struct wined3d_event_query *query)
typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry); typedef void (context_fbo_entry_func_t)(struct wined3d_context *context, struct fbo_entry *entry);
static void context_enum_surface_fbo_entries(IWineD3DDeviceImpl *device, static void context_enum_surface_fbo_entries(IWineD3DDeviceImpl *device,
IWineD3DSurfaceImpl *surface, context_fbo_entry_func_t *callback) struct wined3d_surface *surface, context_fbo_entry_func_t *callback)
{ {
UINT i; UINT i;
...@@ -727,7 +730,7 @@ void context_resource_unloaded(struct IWineD3DDeviceImpl *device, ...@@ -727,7 +730,7 @@ void context_resource_unloaded(struct IWineD3DDeviceImpl *device,
} }
} }
void context_surface_update(struct wined3d_context *context, IWineD3DSurfaceImpl *surface) void context_surface_update(struct wined3d_context *context, struct wined3d_surface *surface)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
struct fbo_entry *entry = context->current_fbo; struct fbo_entry *entry = context->current_fbo;
...@@ -1326,7 +1329,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc, ...@@ -1326,7 +1329,7 @@ static int WineD3D_ChoosePixelFormat(IWineD3DDeviceImpl *This, HDC hdc,
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
struct wined3d_context *context_create(struct wined3d_swapchain *swapchain, struct wined3d_context *context_create(struct wined3d_swapchain *swapchain,
IWineD3DSurfaceImpl *target, const struct wined3d_format *ds_format) struct wined3d_surface *target, const struct wined3d_format *ds_format)
{ {
IWineD3DDeviceImpl *device = swapchain->device; IWineD3DDeviceImpl *device = swapchain->device;
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
...@@ -1915,7 +1918,7 @@ static void SetupForBlit(IWineD3DDeviceImpl *This, struct wined3d_context *conte ...@@ -1915,7 +1918,7 @@ static void SetupForBlit(IWineD3DDeviceImpl *This, struct wined3d_context *conte
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSurfaceImpl *target) static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, struct wined3d_surface *target)
{ {
struct wined3d_context *current_context = context_get_current(); struct wined3d_context *current_context = context_get_current();
struct wined3d_context *context; struct wined3d_context *context;
...@@ -1968,7 +1971,7 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur ...@@ -1968,7 +1971,7 @@ static struct wined3d_context *FindContext(IWineD3DDeviceImpl *This, IWineD3DSur
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_count, IWineD3DSurfaceImpl **rts) static void context_apply_draw_buffers(struct wined3d_context *context, UINT rt_count, struct wined3d_surface **rts)
{ {
if (!rt_count) if (!rt_count)
{ {
...@@ -2058,9 +2061,10 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing, ...@@ -2058,9 +2061,10 @@ static BOOL match_depth_stencil_format(const struct wined3d_format *existing,
if(required_stencil && required_stencil != existing_stencil) return FALSE; if(required_stencil && required_stencil != existing_stencil) return FALSE;
return TRUE; return TRUE;
} }
/* The caller provides a context */ /* The caller provides a context */
static void context_validate_onscreen_formats(IWineD3DDeviceImpl *device, static void context_validate_onscreen_formats(IWineD3DDeviceImpl *device,
struct wined3d_context *context, IWineD3DSurfaceImpl *depth_stencil) struct wined3d_context *context, struct wined3d_surface *depth_stencil)
{ {
/* Onscreen surfaces are always in a swapchain */ /* Onscreen surfaces are always in a swapchain */
struct wined3d_swapchain *swapchain = context->current_rt->container.u.swapchain; struct wined3d_swapchain *swapchain = context->current_rt->container.u.swapchain;
...@@ -2122,7 +2126,7 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp ...@@ -2122,7 +2126,7 @@ void context_apply_blit_state(struct wined3d_context *context, IWineD3DDeviceImp
} }
static BOOL context_validate_rt_config(UINT rt_count, static BOOL context_validate_rt_config(UINT rt_count,
IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *ds) struct wined3d_surface **rts, struct wined3d_surface *ds)
{ {
unsigned int i; unsigned int i;
...@@ -2140,7 +2144,7 @@ static BOOL context_validate_rt_config(UINT rt_count, ...@@ -2140,7 +2144,7 @@ static BOOL context_validate_rt_config(UINT rt_count,
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
BOOL context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device, BOOL context_apply_clear_state(struct wined3d_context *context, IWineD3DDeviceImpl *device,
UINT rt_count, IWineD3DSurfaceImpl **rts, IWineD3DSurfaceImpl *depth_stencil) UINT rt_count, struct wined3d_surface **rts, struct wined3d_surface *depth_stencil)
{ {
const struct StateEntry *state_table = device->StateTable; const struct StateEntry *state_table = device->StateTable;
UINT i; UINT i;
...@@ -2284,7 +2288,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp ...@@ -2284,7 +2288,7 @@ BOOL context_apply_draw_state(struct wined3d_context *context, IWineD3DDeviceImp
} }
static void context_setup_target(IWineD3DDeviceImpl *device, static void context_setup_target(IWineD3DDeviceImpl *device,
struct wined3d_context *context, IWineD3DSurfaceImpl *target) struct wined3d_context *context, struct wined3d_surface *target)
{ {
BOOL old_render_offscreen = context->render_offscreen, render_offscreen; BOOL old_render_offscreen = context->render_offscreen, render_offscreen;
const struct StateEntry *StateTable = device->StateTable; const struct StateEntry *StateTable = device->StateTable;
...@@ -2349,7 +2353,7 @@ static void context_setup_target(IWineD3DDeviceImpl *device, ...@@ -2349,7 +2353,7 @@ static void context_setup_target(IWineD3DDeviceImpl *device,
} }
/* Do not call while under the GL lock. */ /* Do not call while under the GL lock. */
struct wined3d_context *context_acquire(IWineD3DDeviceImpl *device, IWineD3DSurfaceImpl *target) struct wined3d_context *context_acquire(IWineD3DDeviceImpl *device, struct wined3d_surface *target)
{ {
struct wined3d_context *current_context = context_get_current(); struct wined3d_context *current_context = context_get_current();
struct wined3d_context *context; struct wined3d_context *context;
......
...@@ -571,7 +571,7 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx, ...@@ -571,7 +571,7 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx,
/* Invalidate the back buffer memory so LockRect will read it the next time */ /* Invalidate the back buffer memory so LockRect will read it the next time */
for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i) for (i = 0; i < device->adapter->gl_info.limits.buffers; ++i)
{ {
IWineD3DSurfaceImpl *target = device->render_targets[i]; struct wined3d_surface *target = device->render_targets[i];
if (target) if (target)
{ {
surface_load_location(target, SFLAG_INDRAWABLE, NULL); surface_load_location(target, SFLAG_INDRAWABLE, NULL);
...@@ -608,7 +608,7 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx, ...@@ -608,7 +608,7 @@ void drawPrimitive(IWineD3DDeviceImpl *device, UINT index_count, UINT StartIdx,
DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN; DWORD location = context->render_offscreen ? SFLAG_DS_OFFSCREEN : SFLAG_DS_ONSCREEN;
if (state->render_states[WINED3DRS_ZWRITEENABLE] || state->render_states[WINED3DRS_ZENABLE]) if (state->render_states[WINED3DRS_ZWRITEENABLE] || state->render_states[WINED3DRS_ZENABLE])
{ {
IWineD3DSurfaceImpl *ds = device->depth_stencil; struct wined3d_surface *ds = device->depth_stencil;
RECT current_rect, draw_rect, r; RECT current_rect, draw_rect, r;
if (location == SFLAG_DS_ONSCREEN && ds != device->onscreen_depth_stencil) if (location == SFLAG_DS_ONSCREEN && ds != device->onscreen_depth_stencil)
......
...@@ -135,7 +135,7 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette, ...@@ -135,7 +135,7 @@ HRESULT CDECL wined3d_palette_set_entries(struct wined3d_palette *palette,
{ {
if (resource->resourceType == WINED3DRTYPE_SURFACE) if (resource->resourceType == WINED3DRTYPE_SURFACE)
{ {
IWineD3DSurfaceImpl *surface = surface_from_resource(resource); struct wined3d_surface *surface = surface_from_resource(resource);
if (surface->palette == palette) if (surface->palette == palette)
surface->surface_ops->surface_realize_palette(surface); surface->surface_ops->surface_realize_palette(surface);
} }
......
...@@ -1872,7 +1872,7 @@ void find_ps_compile_args(const struct wined3d_state *state, ...@@ -1872,7 +1872,7 @@ void find_ps_compile_args(const struct wined3d_state *state,
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */ memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
if (state->render_states[WINED3DRS_SRGBWRITEENABLE]) if (state->render_states[WINED3DRS_SRGBWRITEENABLE])
{ {
IWineD3DSurfaceImpl *rt = device->render_targets[0]; struct wined3d_surface *rt = device->render_targets[0];
if (rt->resource.format->flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1; if (rt->resource.format->flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1;
} }
......
...@@ -242,7 +242,7 @@ static void state_ambient(DWORD state, struct wined3d_stateblock *stateblock, st ...@@ -242,7 +242,7 @@ static void state_ambient(DWORD state, struct wined3d_stateblock *stateblock, st
static void state_blend(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context) static void state_blend(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{ {
IWineD3DSurfaceImpl *target = stateblock->device->render_targets[0]; struct wined3d_surface *target = stateblock->device->render_targets[0];
const struct wined3d_gl_info *gl_info = context->gl_info; const struct wined3d_gl_info *gl_info = context->gl_info;
int srcBlend = GL_ZERO; int srcBlend = GL_ZERO;
int dstBlend = GL_ZERO; int dstBlend = GL_ZERO;
...@@ -503,7 +503,7 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru ...@@ -503,7 +503,7 @@ static void state_alpha(DWORD state, struct wined3d_stateblock *stateblock, stru
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB) if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{ {
IWineD3DSurfaceImpl *surf = surface_from_resource(texture->sub_resources[0]); struct wined3d_surface *surf = surface_from_resource(texture->sub_resources[0]);
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT) if (surf->CKeyFlags & WINEDDSD_CKSRCBLT)
{ {
...@@ -1751,7 +1751,7 @@ static void state_depthbias(DWORD state, struct wined3d_stateblock *stateblock, ...@@ -1751,7 +1751,7 @@ static void state_depthbias(DWORD state, struct wined3d_stateblock *stateblock,
if (stateblock->state.render_states[WINED3DRS_SLOPESCALEDEPTHBIAS] if (stateblock->state.render_states[WINED3DRS_SLOPESCALEDEPTHBIAS]
|| stateblock->state.render_states[WINED3DRS_DEPTHBIAS]) || stateblock->state.render_states[WINED3DRS_DEPTHBIAS])
{ {
IWineD3DSurfaceImpl *depth = stateblock->device->depth_stencil; struct wined3d_surface *depth = stateblock->device->depth_stencil;
float scale; float scale;
union union
...@@ -3182,7 +3182,7 @@ void tex_alphaop(DWORD state, struct wined3d_stateblock *stateblock, struct wine ...@@ -3182,7 +3182,7 @@ void tex_alphaop(DWORD state, struct wined3d_stateblock *stateblock, struct wine
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB) if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{ {
IWineD3DSurfaceImpl *surf = surface_from_resource(texture->sub_resources[0]); struct wined3d_surface *surf = surface_from_resource(texture->sub_resources[0]);
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask) if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask)
{ {
...@@ -4718,7 +4718,7 @@ static void vertexdeclaration(DWORD state_id, struct wined3d_stateblock *statebl ...@@ -4718,7 +4718,7 @@ static void vertexdeclaration(DWORD state_id, struct wined3d_stateblock *statebl
static void viewport_miscpart(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context) static void viewport_miscpart(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{ {
IWineD3DSurfaceImpl *target = stateblock->device->render_targets[0]; struct wined3d_surface *target = stateblock->device->render_targets[0];
UINT width, height; UINT width, height;
WINED3DVIEWPORT vp = stateblock->state.viewport; WINED3DVIEWPORT vp = stateblock->state.viewport;
...@@ -4874,7 +4874,7 @@ static void light(DWORD state, struct wined3d_stateblock *stateblock, struct win ...@@ -4874,7 +4874,7 @@ static void light(DWORD state, struct wined3d_stateblock *stateblock, struct win
static void scissorrect(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context) static void scissorrect(DWORD state, struct wined3d_stateblock *stateblock, struct wined3d_context *context)
{ {
IWineD3DSurfaceImpl *target = stateblock->device->render_targets[0]; struct wined3d_surface *target = stateblock->device->render_targets[0];
RECT *pRect = &stateblock->state.scissor_rect; RECT *pRect = &stateblock->state.scissor_rect;
UINT height; UINT height;
UINT width; UINT width;
......
...@@ -1092,7 +1092,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) ...@@ -1092,7 +1092,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
} tmpfloat; } tmpfloat;
unsigned int i; unsigned int i;
struct wined3d_swapchain *swapchain; struct wined3d_swapchain *swapchain;
IWineD3DSurface *backbuffer; struct wined3d_surface *backbuffer;
HRESULT hr; HRESULT hr;
TRACE("stateblock %p.\n", stateblock); TRACE("stateblock %p.\n", stateblock);
......
...@@ -152,7 +152,7 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, ...@@ -152,7 +152,7 @@ HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
} }
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
IWineD3DSurface *dst_surface) struct wined3d_surface *dst_surface)
{ {
POINT offset = {0, 0}; POINT offset = {0, 0};
...@@ -167,7 +167,7 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc ...@@ -167,7 +167,7 @@ HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapc
} }
HRESULT CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, HRESULT CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain,
UINT back_buffer_idx, WINED3DBACKBUFFER_TYPE type, IWineD3DSurface **back_buffer) UINT back_buffer_idx, WINED3DBACKBUFFER_TYPE type, struct wined3d_surface **back_buffer)
{ {
TRACE("swapchain %p, back_buffer_idx %u, type %#x, back_buffer %p.\n", TRACE("swapchain %p, back_buffer_idx %u, type %#x, back_buffer %p.\n",
swapchain, back_buffer_idx, type, back_buffer); swapchain, back_buffer_idx, type, back_buffer);
...@@ -280,7 +280,7 @@ HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *s ...@@ -280,7 +280,7 @@ HRESULT CDECL wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *s
static void swapchain_blit(struct wined3d_swapchain *swapchain, static void swapchain_blit(struct wined3d_swapchain *swapchain,
struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect) struct wined3d_context *context, const RECT *src_rect, const RECT *dst_rect)
{ {
IWineD3DSurfaceImpl *backbuffer = swapchain->back_buffers[0]; struct wined3d_surface *backbuffer = swapchain->back_buffers[0];
IWineD3DDeviceImpl *device = swapchain->device; IWineD3DDeviceImpl *device = swapchain->device;
UINT src_w = src_rect->right - src_rect->left; UINT src_w = src_rect->right - src_rect->left;
UINT src_h = src_rect->bottom - src_rect->top; UINT src_h = src_rect->bottom - src_rect->top;
...@@ -424,7 +424,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R ...@@ -424,7 +424,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
/* Render the cursor onto the back buffer, using our nifty directdraw blitting code :-) */ /* Render the cursor onto the back buffer, using our nifty directdraw blitting code :-) */
if (swapchain->device->bCursorVisible && swapchain->device->cursorTexture) if (swapchain->device->bCursorVisible && swapchain->device->cursorTexture)
{ {
IWineD3DSurfaceImpl cursor; struct wined3d_surface cursor;
RECT destRect = RECT destRect =
{ {
swapchain->device->xScreenSpace - swapchain->device->xHotSpot, swapchain->device->xScreenSpace - swapchain->device->xHotSpot,
...@@ -581,8 +581,8 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R ...@@ -581,8 +581,8 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
/* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying /* Both memory copies of the surfaces are ok, flip them around too instead of dirtifying
* Doesn't work with render_to_fbo because we're not flipping * Doesn't work with render_to_fbo because we're not flipping
*/ */
IWineD3DSurfaceImpl *front = swapchain->front_buffer; struct wined3d_surface *front = swapchain->front_buffer;
IWineD3DSurfaceImpl *back = swapchain->back_buffers[0]; struct wined3d_surface *back = swapchain->back_buffers[0];
if(front->resource.size == back->resource.size) { if(front->resource.size == back->resource.size) {
DWORD fbflags; DWORD fbflags;
...@@ -643,7 +643,7 @@ static const struct wined3d_swapchain_ops swapchain_gl_ops = ...@@ -643,7 +643,7 @@ static const struct wined3d_swapchain_ops swapchain_gl_ops =
/* Helper function that blits the front buffer contents to the target window. */ /* Helper function that blits the front buffer contents to the target window. */
void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect) void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect)
{ {
IWineD3DSurfaceImpl *front; struct wined3d_surface *front;
POINT offset = {0, 0}; POINT offset = {0, 0};
HDC src_dc, dst_dc; HDC src_dc, dst_dc;
RECT draw_rect; RECT draw_rect;
...@@ -720,7 +720,7 @@ void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect) ...@@ -720,7 +720,7 @@ void x11_copy_to_screen(struct wined3d_swapchain *swapchain, const RECT *rect)
static HRESULT swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in, static HRESULT swapchain_gdi_present(struct wined3d_swapchain *swapchain, const RECT *src_rect_in,
const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags) const RECT *dst_rect_in, const RGNDATA *dirty_region, DWORD flags)
{ {
IWineD3DSurfaceImpl *front, *back; struct wined3d_surface *front, *back;
if (!swapchain->back_buffers) if (!swapchain->back_buffers)
{ {
...@@ -900,7 +900,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf ...@@ -900,7 +900,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf
swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight, swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight,
swapchain->presentParms.BackBufferFormat, swapchain->presentParms.MultiSampleType, swapchain->presentParms.BackBufferFormat, swapchain->presentParms.MultiSampleType,
swapchain->presentParms.MultiSampleQuality, TRUE /* Lockable */, swapchain->presentParms.MultiSampleQuality, TRUE /* Lockable */,
(IWineD3DSurface **)&swapchain->front_buffer); &swapchain->front_buffer);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create front buffer, hr %#x.\n", hr); WARN("Failed to create front buffer, hr %#x.\n", hr);
...@@ -1011,7 +1011,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf ...@@ -1011,7 +1011,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf
swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight, swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight,
swapchain->presentParms.BackBufferFormat, swapchain->presentParms.MultiSampleType, swapchain->presentParms.BackBufferFormat, swapchain->presentParms.MultiSampleType,
swapchain->presentParms.MultiSampleQuality, TRUE /* Lockable */, swapchain->presentParms.MultiSampleQuality, TRUE /* Lockable */,
(IWineD3DSurface **)&swapchain->back_buffers[i]); &swapchain->back_buffers[i]);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create back buffer %u, hr %#x.\n", i, hr); WARN("Failed to create back buffer %u, hr %#x.\n", i, hr);
...@@ -1032,7 +1032,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf ...@@ -1032,7 +1032,7 @@ HRESULT swapchain_init(struct wined3d_swapchain *swapchain, WINED3DSURFTYPE surf
swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight, swapchain->presentParms.BackBufferWidth, swapchain->presentParms.BackBufferHeight,
swapchain->presentParms.AutoDepthStencilFormat, swapchain->presentParms.MultiSampleType, swapchain->presentParms.AutoDepthStencilFormat, swapchain->presentParms.MultiSampleType,
swapchain->presentParms.MultiSampleQuality, FALSE /* FIXME: Discard */, swapchain->presentParms.MultiSampleQuality, FALSE /* FIXME: Discard */,
(IWineD3DSurface **)&device->auto_depth_stencil); &device->auto_depth_stencil);
if (FAILED(hr)) if (FAILED(hr))
{ {
WARN("Failed to create the auto depth stencil, hr %#x.\n", hr); WARN("Failed to create the auto depth stencil, hr %#x.\n", hr);
......
...@@ -627,7 +627,7 @@ static HRESULT texture2d_bind(struct wined3d_texture *texture, ...@@ -627,7 +627,7 @@ static HRESULT texture2d_bind(struct wined3d_texture *texture,
for (i = 0; i < sub_count; ++i) for (i = 0; i < sub_count; ++i)
{ {
IWineD3DSurfaceImpl *surface = surface_from_resource(texture->sub_resources[i]); struct wined3d_surface *surface = surface_from_resource(texture->sub_resources[i]);
surface_set_texture_name(surface, gl_tex->name, srgb_tex); surface_set_texture_name(surface, gl_tex->name, srgb_tex);
} }
...@@ -709,7 +709,7 @@ static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB ...@@ -709,7 +709,7 @@ static void texture2d_preload(struct wined3d_texture *texture, enum WINED3DSRGB
{ {
for (i = 0; i < sub_count; ++i) for (i = 0; i < sub_count; ++i)
{ {
IWineD3DSurfaceImpl *surface = surface_from_resource(texture->sub_resources[i]); struct wined3d_surface *surface = surface_from_resource(texture->sub_resources[i]);
if (palette9_changed(surface)) if (palette9_changed(surface))
{ {
...@@ -750,7 +750,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub ...@@ -750,7 +750,7 @@ static void texture2d_sub_resource_add_dirty_region(struct wined3d_resource *sub
static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource) static void texture2d_sub_resource_cleanup(struct wined3d_resource *sub_resource)
{ {
IWineD3DSurfaceImpl *surface = surface_from_resource(sub_resource); struct wined3d_surface *surface = surface_from_resource(sub_resource);
/* Clean out the texture name we gave to the surface so that the /* Clean out the texture name we gave to the surface so that the
* surface doesn't try and release it. */ * surface doesn't try and release it. */
...@@ -773,7 +773,7 @@ static void texture2d_unload(struct wined3d_resource *resource) ...@@ -773,7 +773,7 @@ static void texture2d_unload(struct wined3d_resource *resource)
for (i = 0; i < sub_count; ++i) for (i = 0; i < sub_count; ++i)
{ {
struct wined3d_resource *sub_resource = texture->sub_resources[i]; struct wined3d_resource *sub_resource = texture->sub_resources[i];
IWineD3DSurfaceImpl *surface = surface_from_resource(sub_resource); struct wined3d_surface *surface = surface_from_resource(sub_resource);
sub_resource->resource_ops->resource_unload(sub_resource); sub_resource->resource_ops->resource_unload(sub_resource);
surface_set_texture_name(surface, 0, FALSE); /* Delete RGB name */ surface_set_texture_name(surface, 0, FALSE); /* Delete RGB name */
...@@ -893,7 +893,7 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT ...@@ -893,7 +893,7 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT
GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB,
}; };
UINT idx = j * texture->level_count + i; UINT idx = j * texture->level_count + i;
IWineD3DSurface *surface; struct wined3d_surface *surface;
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w, hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_w,
format_id, usage, pool, i /* Level */, j, &surface); format_id, usage, pool, i /* Level */, j, &surface);
...@@ -904,9 +904,9 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT ...@@ -904,9 +904,9 @@ HRESULT cubetexture_init(struct wined3d_texture *texture, UINT edge_length, UINT
return hr; return hr;
} }
surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, texture); surface_set_container(surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target((IWineD3DSurfaceImpl *)surface, cube_targets[j]); surface_set_texture_target(surface, cube_targets[j]);
texture->sub_resources[idx] = &((IWineD3DSurfaceImpl *)surface)->resource; texture->sub_resources[idx] = &surface->resource;
TRACE("Created surface level %u @ %p.\n", i, surface); TRACE("Created surface level %u @ %p.\n", i, surface);
} }
tmp_w = max(1, tmp_w >> 1); tmp_w = max(1, tmp_w >> 1);
...@@ -1048,7 +1048,7 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U ...@@ -1048,7 +1048,7 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U
tmp_h = height; tmp_h = height;
for (i = 0; i < texture->level_count; ++i) for (i = 0; i < texture->level_count; ++i)
{ {
IWineD3DSurface *surface; struct wined3d_surface *surface;
/* Use the callback to create the texture surface. */ /* Use the callback to create the texture surface. */
hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h, hr = IWineD3DDeviceParent_CreateSurface(device->device_parent, parent, tmp_w, tmp_h,
...@@ -1060,9 +1060,9 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U ...@@ -1060,9 +1060,9 @@ HRESULT texture_init(struct wined3d_texture *texture, UINT width, UINT height, U
return hr; return hr;
} }
surface_set_container((IWineD3DSurfaceImpl *)surface, WINED3D_CONTAINER_TEXTURE, texture); surface_set_container(surface, WINED3D_CONTAINER_TEXTURE, texture);
surface_set_texture_target((IWineD3DSurfaceImpl *)surface, texture->target); surface_set_texture_target(surface, texture->target);
texture->sub_resources[i] = &((IWineD3DSurfaceImpl *)surface)->resource; texture->sub_resources[i] = &surface->resource;
TRACE("Created surface level %u @ %p.\n", i, surface); TRACE("Created surface level %u @ %p.\n", i, surface);
/* Calculate the next mipmap level. */ /* Calculate the next mipmap level. */
tmp_w = max(1, tmp_w >> 1); tmp_w = max(1, tmp_w >> 1);
......
...@@ -2771,7 +2771,7 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett ...@@ -2771,7 +2771,7 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
DWORD ttff; DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2; DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
IWineD3DDeviceImpl *device = stateblock->device; IWineD3DDeviceImpl *device = stateblock->device;
IWineD3DSurfaceImpl *rt = device->render_targets[0]; struct wined3d_surface *rt = device->render_targets[0];
const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
for (i = 0; i < gl_info->limits.texture_stages; ++i) for (i = 0; i < gl_info->limits.texture_stages; ++i)
...@@ -2866,7 +2866,7 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett ...@@ -2866,7 +2866,7 @@ void gen_ffp_frag_op(struct wined3d_stateblock *stateblock, struct ffp_frag_sett
if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB) if (texture_dimensions == GL_TEXTURE_2D || texture_dimensions == GL_TEXTURE_RECTANGLE_ARB)
{ {
IWineD3DSurfaceImpl *surf = surface_from_resource(texture->sub_resources[0]); struct wined3d_surface *surf = surface_from_resource(texture->sub_resources[0]);
if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask) if (surf->CKeyFlags & WINEDDSD_CKSRCBLT && !surf->resource.format->alpha_mask)
{ {
......
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