Module: wine Branch: master Commit: fd8597b2bfba7063157bbf2059add9bd675fd777 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fd8597b2bfba7063157bbf2059...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Tue Jan 3 23:06:55 2012 +0100
wined3d: Get rid of the WINED3DSTENCILOP typedef.
---
dlls/wined3d/state.c | 38 ++++++++++++++++++++++++++++++++------ dlls/wined3d/stateblock.c | 12 ++++++------ dlls/wined3d/utils.c | 19 ------------------- dlls/wined3d/wined3d_private.h | 2 -- include/wine/wined3d.h | 21 ++++++++++----------- 5 files changed, 48 insertions(+), 44 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index c10997c..a68fae9 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -801,6 +801,32 @@ static void renderstate_stencil_twosided(struct wined3d_context *context, GLint checkGLcall("glStencilOp(...)"); }
+static GLenum gl_stencil_op(enum wined3d_stencil_op op) +{ + switch (op) + { + case WINED3D_STENCIL_OP_KEEP: + return GL_KEEP; + case WINED3D_STENCIL_OP_ZERO: + return GL_ZERO; + case WINED3D_STENCIL_OP_REPLACE: + return GL_REPLACE; + case WINED3D_STENCIL_OP_INCR_SAT: + return GL_INCR; + case WINED3D_STENCIL_OP_DECR_SAT: + return GL_DECR; + case WINED3D_STENCIL_OP_INVERT: + return GL_INVERT; + case WINED3D_STENCIL_OP_INCR: + return GL_INCR_WRAP_EXT; + case WINED3D_STENCIL_OP_DECR: + return GL_DECR_WRAP_EXT; + default: + FIXME("Unrecognized stencil op %#x.\n", op); + return GL_KEEP; + } +} + static void state_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id) { const struct wined3d_gl_info *gl_info = context->gl_info; @@ -833,12 +859,12 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_ func_ccw = GL_ALWAYS; ref = state->render_states[WINED3D_RS_STENCILREF]; mask = state->render_states[WINED3D_RS_STENCILMASK]; - stencilFail = StencilOp(state->render_states[WINED3D_RS_STENCILFAIL]); - depthFail = StencilOp(state->render_states[WINED3D_RS_STENCILZFAIL]); - stencilPass = StencilOp(state->render_states[WINED3D_RS_STENCILPASS]); - stencilFail_ccw = StencilOp(state->render_states[WINED3D_RS_CCW_STENCILFAIL]); - depthFail_ccw = StencilOp(state->render_states[WINED3D_RS_CCW_STENCILZFAIL]); - stencilPass_ccw = StencilOp(state->render_states[WINED3D_RS_CCW_STENCILPASS]); + stencilFail = gl_stencil_op(state->render_states[WINED3D_RS_STENCILFAIL]); + depthFail = gl_stencil_op(state->render_states[WINED3D_RS_STENCILZFAIL]); + stencilPass = gl_stencil_op(state->render_states[WINED3D_RS_STENCILPASS]); + stencilFail_ccw = gl_stencil_op(state->render_states[WINED3D_RS_CCW_STENCILFAIL]); + depthFail_ccw = gl_stencil_op(state->render_states[WINED3D_RS_CCW_STENCILZFAIL]); + stencilPass_ccw = gl_stencil_op(state->render_states[WINED3D_RS_CCW_STENCILPASS]);
TRACE("(onesided %d, twosided %d, ref %x, mask %x, " "GL_FRONT: func: %x, fail %x, zfail %x, zpass %x " diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 8da32c2..0f9d07c 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1153,9 +1153,9 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) state->render_states[WINED3D_RS_EDGEANTIALIAS] = FALSE; state->render_states[WINED3D_RS_RANGEFOGENABLE] = FALSE; state->render_states[WINED3D_RS_STENCILENABLE] = FALSE; - state->render_states[WINED3D_RS_STENCILFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3D_RS_STENCILZFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3D_RS_STENCILPASS] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_STENCILFAIL] = WINED3D_STENCIL_OP_KEEP; + state->render_states[WINED3D_RS_STENCILZFAIL] = WINED3D_STENCIL_OP_KEEP; + state->render_states[WINED3D_RS_STENCILPASS] = WINED3D_STENCIL_OP_KEEP; state->render_states[WINED3D_RS_STENCILREF] = 0; state->render_states[WINED3D_RS_STENCILMASK] = 0xffffffff; state->render_states[WINED3D_RS_STENCILFUNC] = WINED3D_CMP_ALWAYS; @@ -1226,9 +1226,9 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) state->render_states[WINED3D_RS_ADAPTIVETESS_W] = tmpfloat.d; state->render_states[WINED3D_RS_ENABLEADAPTIVETESSELLATION] = FALSE; state->render_states[WINED3D_RS_TWOSIDEDSTENCILMODE] = FALSE; - state->render_states[WINED3D_RS_CCW_STENCILFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3D_RS_CCW_STENCILZFAIL] = WINED3DSTENCILOP_KEEP; - state->render_states[WINED3D_RS_CCW_STENCILPASS] = WINED3DSTENCILOP_KEEP; + state->render_states[WINED3D_RS_CCW_STENCILFAIL] = WINED3D_STENCIL_OP_KEEP; + state->render_states[WINED3D_RS_CCW_STENCILZFAIL] = WINED3D_STENCIL_OP_KEEP; + state->render_states[WINED3D_RS_CCW_STENCILPASS] = WINED3D_STENCIL_OP_KEEP; state->render_states[WINED3D_RS_CCW_STENCILFUNC] = WINED3D_CMP_ALWAYS; state->render_states[WINED3D_RS_COLORWRITEENABLE1] = 0x0000000f; state->render_states[WINED3D_RS_COLORWRITEENABLE2] = 0x0000000f; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index a521f4b..2b00765 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -2477,25 +2477,6 @@ const char *debug_surflocation(DWORD flag) { return wine_dbg_sprintf("%s", buf[0] ? buf + 3 : "0"); }
-/***************************************************************************** - * Useful functions mapping GL <-> D3D values - */ -GLenum StencilOp(DWORD op) { - switch(op) { - case WINED3DSTENCILOP_KEEP : return GL_KEEP; - case WINED3DSTENCILOP_ZERO : return GL_ZERO; - case WINED3DSTENCILOP_REPLACE : return GL_REPLACE; - case WINED3DSTENCILOP_INCRSAT : return GL_INCR; - case WINED3DSTENCILOP_DECRSAT : return GL_DECR; - case WINED3DSTENCILOP_INVERT : return GL_INVERT; - case WINED3DSTENCILOP_INCR : return GL_INCR_WRAP_EXT; - case WINED3DSTENCILOP_DECR : return GL_DECR_WRAP_EXT; - default: - FIXME("Unrecognized stencil op %d\n", op); - return GL_KEEP; - } -} - BOOL is_invalid_op(const struct wined3d_state *state, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 1602bdd..fd21187 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2515,8 +2515,6 @@ const char *debug_d3dtop(WINED3DTEXTUREOP d3dtop) DECLSPEC_HIDDEN; void dump_color_fixup_desc(struct color_fixup_desc fixup) DECLSPEC_HIDDEN; const char *debug_surflocation(DWORD flag) DECLSPEC_HIDDEN;
-/* Routines for GL <-> D3D values */ -GLenum StencilOp(DWORD op) DECLSPEC_HIDDEN; BOOL is_invalid_op(const struct wined3d_state *state, int stage, WINED3DTEXTUREOP op, DWORD arg1, DWORD arg2, DWORD arg3) DECLSPEC_HIDDEN; void set_tex_op_nvrc(const struct wined3d_gl_info *gl_info, const struct wined3d_state *state, diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 6c06fc6..cb09168 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -469,18 +469,17 @@ enum wined3d_cull WINED3D_CULL_CCW = 3, };
-typedef enum _WINED3DSTENCILOP -{ - WINED3DSTENCILOP_KEEP = 1, - WINED3DSTENCILOP_ZERO = 2, - WINED3DSTENCILOP_REPLACE = 3, - WINED3DSTENCILOP_INCRSAT = 4, - WINED3DSTENCILOP_DECRSAT = 5, - WINED3DSTENCILOP_INVERT = 6, - WINED3DSTENCILOP_INCR = 7, - WINED3DSTENCILOP_DECR = 8, - WINED3DSTENCILOP_FORCE_DWORD = 0x7fffffff -} WINED3DSTENCILOP; +enum wined3d_stencil_op +{ + WINED3D_STENCIL_OP_KEEP = 1, + WINED3D_STENCIL_OP_ZERO = 2, + WINED3D_STENCIL_OP_REPLACE = 3, + WINED3D_STENCIL_OP_INCR_SAT = 4, + WINED3D_STENCIL_OP_DECR_SAT = 5, + WINED3D_STENCIL_OP_INVERT = 6, + WINED3D_STENCIL_OP_INCR = 7, + WINED3D_STENCIL_OP_DECR = 8, +};
typedef enum _WINED3DMATERIALCOLORSOURCE {