diff options
author | Oliver McFadden <[email protected]> | 2007-05-11 21:31:22 +0000 |
---|---|---|
committer | Oliver McFadden <[email protected]> | 2007-05-11 21:41:16 +0000 |
commit | bcaf8fc7b10327fd7936b22ec9b552e93497cee4 (patch) | |
tree | 3a59ffb77b961764b9b0621d3f3906b5f8984b2e /src | |
parent | ef29d6af6c24487a66155586feb9ab3eb0c3a229 (diff) |
r300: Cleaned up the blend factor function.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/r300/r300_state.c | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 4f25ff7e812..625797b4b9f 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -97,60 +97,58 @@ static void r300BlendColor(GLcontext * ctx, const GLfloat cf[4]) */ static int blend_factor(GLenum factor, GLboolean is_src) { - int func; - switch (factor) { case GL_ZERO: - func = R300_BLEND_GL_ZERO; + return R300_BLEND_GL_ZERO; break; case GL_ONE: - func = R300_BLEND_GL_ONE; + return R300_BLEND_GL_ONE; break; case GL_DST_COLOR: - func = R300_BLEND_GL_DST_COLOR; + return R300_BLEND_GL_DST_COLOR; break; case GL_ONE_MINUS_DST_COLOR: - func = R300_BLEND_GL_ONE_MINUS_DST_COLOR; + return R300_BLEND_GL_ONE_MINUS_DST_COLOR; break; case GL_SRC_COLOR: - func = R300_BLEND_GL_SRC_COLOR; + return R300_BLEND_GL_SRC_COLOR; break; case GL_ONE_MINUS_SRC_COLOR: - func = R300_BLEND_GL_ONE_MINUS_SRC_COLOR; + return R300_BLEND_GL_ONE_MINUS_SRC_COLOR; break; case GL_SRC_ALPHA: - func = R300_BLEND_GL_SRC_ALPHA; + return R300_BLEND_GL_SRC_ALPHA; break; case GL_ONE_MINUS_SRC_ALPHA: - func = R300_BLEND_GL_ONE_MINUS_SRC_ALPHA; + return R300_BLEND_GL_ONE_MINUS_SRC_ALPHA; break; case GL_DST_ALPHA: - func = R300_BLEND_GL_DST_ALPHA; + return R300_BLEND_GL_DST_ALPHA; break; case GL_ONE_MINUS_DST_ALPHA: - func = R300_BLEND_GL_ONE_MINUS_DST_ALPHA; + return R300_BLEND_GL_ONE_MINUS_DST_ALPHA; break; case GL_SRC_ALPHA_SATURATE: - func = (is_src) ? R300_BLEND_GL_SRC_ALPHA_SATURATE : + return (is_src) ? R300_BLEND_GL_SRC_ALPHA_SATURATE : R300_BLEND_GL_ZERO; break; case GL_CONSTANT_COLOR: - func = R300_BLEND_GL_CONST_COLOR; + return R300_BLEND_GL_CONST_COLOR; break; case GL_ONE_MINUS_CONSTANT_COLOR: - func = R300_BLEND_GL_ONE_MINUS_CONST_COLOR; + return R300_BLEND_GL_ONE_MINUS_CONST_COLOR; break; case GL_CONSTANT_ALPHA: - func = R300_BLEND_GL_CONST_ALPHA; + return R300_BLEND_GL_CONST_ALPHA; break; case GL_ONE_MINUS_CONSTANT_ALPHA: - func = R300_BLEND_GL_ONE_MINUS_CONST_ALPHA; + return R300_BLEND_GL_ONE_MINUS_CONST_ALPHA; break; default: fprintf(stderr, "unknown blend factor %x\n", factor); - func = (is_src) ? R300_BLEND_GL_ONE : R300_BLEND_GL_ZERO; + return (is_src) ? R300_BLEND_GL_ONE : R300_BLEND_GL_ZERO; + break; } - return func; } /** |