Commit 67b7a573 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass a wined3d_state structure to set_tex_op().

parent d0f7edd2
...@@ -2057,10 +2057,9 @@ static void get_src_and_opr(DWORD arg, BOOL is_alpha, GLenum* source, GLenum* op ...@@ -2057,10 +2057,9 @@ static void get_src_and_opr(DWORD arg, BOOL is_alpha, GLenum* source, GLenum* op
} }
/* Setup the texture operations texture stage states */ /* Setup the texture operations texture stage states */
static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *iface, static void set_tex_op(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state,
BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) BOOL isAlpha, int Stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3)
{ {
const struct wined3d_gl_info *gl_info = context->gl_info;
GLenum src1, src2, src3; GLenum src1, src2, src3;
GLenum opr1, opr2, opr3; GLenum opr1, opr2, opr3;
GLenum comb_target; GLenum comb_target;
...@@ -2069,7 +2068,6 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if ...@@ -2069,7 +2068,6 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if
GLenum scal_target; GLenum scal_target;
GLenum opr=0, invopr, src3_target, opr3_target; GLenum opr=0, invopr, src3_target, opr3_target;
BOOL Handled = FALSE; BOOL Handled = FALSE;
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface;
TRACE("Alpha?(%d), Stage:%d Op(%s), a1(%d), a2(%d), a3(%d)\n", isAlpha, Stage, debug_d3dtop(op), arg1, arg2, arg3); TRACE("Alpha?(%d), Stage:%d Op(%s), a1(%d), a2(%d), a3(%d)\n", isAlpha, Stage, debug_d3dtop(op), arg1, arg2, arg3);
...@@ -2109,13 +2107,13 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if ...@@ -2109,13 +2107,13 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if
/* If a texture stage references an invalid texture unit the stage just /* If a texture stage references an invalid texture unit the stage just
* passes through the result from the previous stage */ * passes through the result from the previous stage */
if (is_invalid_op(&This->stateBlock->state, Stage, op, arg1, arg2, arg3)) if (is_invalid_op(state, Stage, op, arg1, arg2, arg3))
{ {
arg1 = WINED3DTA_CURRENT; arg1 = WINED3DTA_CURRENT;
op = WINED3DTOP_SELECTARG1; op = WINED3DTOP_SELECTARG1;
} }
if (isAlpha && !This->stateBlock->state.textures[Stage] && arg1 == WINED3DTA_TEXTURE) if (isAlpha && !state->textures[Stage] && arg1 == WINED3DTA_TEXTURE)
{ {
get_src_and_opr(WINED3DTA_DIFFUSE, isAlpha, &src1, &opr1); get_src_and_opr(WINED3DTA_DIFFUSE, isAlpha, &src1, &opr1);
} else { } else {
...@@ -3058,9 +3056,9 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if ...@@ -3058,9 +3056,9 @@ static void set_tex_op(const struct wined3d_context *context, IWineD3DDevice *if
DWORD op2; DWORD op2;
if (isAlpha) if (isAlpha)
op2 = This->stateBlock->state.texture_states[Stage][WINED3DTSS_COLOROP]; op2 = state->texture_states[Stage][WINED3DTSS_COLOROP];
else else
op2 = This->stateBlock->state.texture_states[Stage][WINED3DTSS_ALPHAOP]; op2 = state->texture_states[Stage][WINED3DTSS_ALPHAOP];
/* Note: If COMBINE4 in effect can't go back to combine! */ /* Note: If COMBINE4 in effect can't go back to combine! */
switch (op2) { switch (op2) {
...@@ -3155,7 +3153,7 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct ...@@ -3155,7 +3153,7 @@ static void tex_colorop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct
if (tex_used) texture_activate_dimensions(stage, stateblock, context); if (tex_used) texture_activate_dimensions(stage, stateblock, context);
} }
set_tex_op(context, (IWineD3DDevice *)stateblock->device, FALSE, stage, set_tex_op(gl_info, &stateblock->state, FALSE, stage,
stateblock->state.texture_states[stage][WINED3DTSS_COLOROP], stateblock->state.texture_states[stage][WINED3DTSS_COLOROP],
stateblock->state.texture_states[stage][WINED3DTSS_COLORARG1], stateblock->state.texture_states[stage][WINED3DTSS_COLORARG1],
stateblock->state.texture_states[stage][WINED3DTSS_COLORARG2], stateblock->state.texture_states[stage][WINED3DTSS_COLORARG2],
...@@ -3259,7 +3257,7 @@ void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d ...@@ -3259,7 +3257,7 @@ void tex_alphaop(DWORD state, IWineD3DStateBlockImpl *stateblock, struct wined3d
} }
else else
{ {
set_tex_op(context, (IWineD3DDevice *)stateblock->device, TRUE, stage, op, arg1, arg2, arg0); set_tex_op(gl_info, &stateblock->state, TRUE, stage, op, arg1, arg2, arg0);
} }
} }
......
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