From bd9b2be8284fda3f8aac235908ded118b5648a38 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 8 Mar 2009 17:58:54 -0600 Subject: mesa: texture combine clean-ups Use MAX_COMBINER_TERMS instead of 4. Rename some vars. Update comments. --- src/mesa/main/texenv.c | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'src/mesa/main/texenv.c') diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index c2960fc820..4d511f2f7e 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -184,7 +184,7 @@ set_combiner_source(GLcontext *ctx, struct gl_texture_unit *texUnit, GLenum pname, GLenum param) { - GLuint src; + GLuint term; GLboolean alpha, legal; if (!ctx->Extensions.EXT_texture_env_combine && @@ -194,24 +194,24 @@ set_combiner_source(GLcontext *ctx, } /* - * Translate pname to (src, alpha). + * Translate pname to (term, alpha). */ switch (pname) { case GL_SOURCE0_RGB: - src = 0; + term = 0; alpha = GL_FALSE; break; case GL_SOURCE1_RGB: - src = 1; + term = 1; alpha = GL_FALSE; break; case GL_SOURCE2_RGB: - src = 2; + term = 2; alpha = GL_FALSE; break; case GL_SOURCE3_RGB_NV: if (ctx->Extensions.NV_texture_env_combine4) { - src = 3; + term = 3; alpha = GL_FALSE; } else { @@ -220,20 +220,20 @@ set_combiner_source(GLcontext *ctx, } break; case GL_SOURCE0_ALPHA: - src = 0; + term = 0; alpha = GL_TRUE; break; case GL_SOURCE1_ALPHA: - src = 1; + term = 1; alpha = GL_TRUE; break; case GL_SOURCE2_ALPHA: - src = 2; + term = 2; alpha = GL_TRUE; break; case GL_SOURCE3_ALPHA_NV: if (ctx->Extensions.NV_texture_env_combine4) { - src = 3; + term = 3; alpha = GL_TRUE; } else { @@ -246,7 +246,7 @@ set_combiner_source(GLcontext *ctx, return; } - assert(src < 4); + assert(term < MAX_COMBINER_TERMS); /* * Error-check param (the source term) @@ -288,9 +288,9 @@ set_combiner_source(GLcontext *ctx, FLUSH_VERTICES(ctx, _NEW_TEXTURE); if (alpha) - texUnit->Combine.SourceA[src] = param; + texUnit->Combine.SourceA[term] = param; else - texUnit->Combine.SourceRGB[src] = param; + texUnit->Combine.SourceRGB[term] = param; } @@ -300,7 +300,7 @@ set_combiner_operand(GLcontext *ctx, struct gl_texture_unit *texUnit, GLenum pname, GLenum param) { - GLuint op; + GLuint term; GLboolean alpha, legal; if (!ctx->Extensions.EXT_texture_env_combine && @@ -311,16 +311,16 @@ set_combiner_operand(GLcontext *ctx, switch (pname) { case GL_OPERAND0_RGB: - op = 0; + term = 0; alpha = GL_FALSE; break; case GL_OPERAND1_RGB: - op = 1; + term = 1; alpha = GL_FALSE; break; case GL_OPERAND2_RGB: if (ctx->Extensions.ARB_texture_env_combine) { - op = 2; + term = 2; alpha = GL_FALSE; } else { @@ -330,7 +330,7 @@ set_combiner_operand(GLcontext *ctx, break; case GL_OPERAND3_RGB_NV: if (ctx->Extensions.NV_texture_env_combine4) { - op = 3; + term = 3; alpha = GL_FALSE; } else { @@ -339,16 +339,16 @@ set_combiner_operand(GLcontext *ctx, } break; case GL_OPERAND0_ALPHA: - op = 0; + term = 0; alpha = GL_TRUE; break; case GL_OPERAND1_ALPHA: - op = 1; + term = 1; alpha = GL_TRUE; break; case GL_OPERAND2_ALPHA: if (ctx->Extensions.ARB_texture_env_combine) { - op = 2; + term = 2; alpha = GL_TRUE; } else { @@ -358,7 +358,7 @@ set_combiner_operand(GLcontext *ctx, break; case GL_OPERAND3_ALPHA_NV: if (ctx->Extensions.NV_texture_env_combine4) { - op = 3; + term = 3; alpha = GL_TRUE; } else { @@ -371,7 +371,7 @@ set_combiner_operand(GLcontext *ctx, return; } - assert(op < 4); + assert(term < MAX_COMBINER_TERMS); /* * Error-check param (the source operand) @@ -397,9 +397,9 @@ set_combiner_operand(GLcontext *ctx, FLUSH_VERTICES(ctx, _NEW_TEXTURE); if (alpha) - texUnit->Combine.OperandA[op] = param; + texUnit->Combine.OperandA[term] = param; else - texUnit->Combine.OperandRGB[op] = param; + texUnit->Combine.OperandRGB[term] = param; } -- cgit v1.2.3