r300: Cleaned up the blend factor function.
authorOliver McFadden <z3ro.geek@gmail.com>
Fri, 11 May 2007 21:31:22 +0000 (21:31 +0000)
committerOliver McFadden <z3ro.geek@gmail.com>
Fri, 11 May 2007 21:41:16 +0000 (21:41 +0000)
src/mesa/drivers/dri/r300/r300_state.c

index 4f25ff7e812a87f00c4c11cf6091b62f88a2f9a8..625797b4b9ff2a9fa84bfead72049ec0f6366b85 100644 (file)
@@ -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;
 }
 
 /**