diff options
author | Brian Paul <[email protected]> | 2001-04-23 18:06:09 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2001-04-23 18:06:09 +0000 |
commit | ad608fe44d1593b4283719e885122260f2776212 (patch) | |
tree | 8d81f215730545f62bd31fe21f5ea8882ccedba0 | |
parent | cb6ae7b16b196a0995efd8aeaecc992785091fc6 (diff) |
fixed two mistakes in texture combine code
-rw-r--r-- | src/mesa/swrast/s_texture.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_texture.c b/src/mesa/swrast/s_texture.c index 218d47a8a29..b751d29b796 100644 --- a/src/mesa/swrast/s_texture.c +++ b/src/mesa/swrast/s_texture.c @@ -1,4 +1,4 @@ -/* $Id: s_texture.c,v 1.26 2001/04/19 22:40:45 brianp Exp $ */ +/* $Id: s_texture.c,v 1.27 2001/04/23 18:06:09 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1792,14 +1792,16 @@ texture_combine(const GLcontext *ctx, case GL_CONSTANT_EXT: { GLchan (*c)[4] = ccolor[j]; - GLchan red, green, blue; + GLchan red, green, blue, alpha; UNCLAMPED_FLOAT_TO_CHAN(red, textureUnit->EnvColor[0]); UNCLAMPED_FLOAT_TO_CHAN(green, textureUnit->EnvColor[1]); UNCLAMPED_FLOAT_TO_CHAN(blue, textureUnit->EnvColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(alpha, textureUnit->EnvColor[3]); for (i = 0; i < n; i++) { c[i][RCOMP] = red; c[i][GCOMP] = green; c[i][BCOMP] = blue; + c[i][ACOMP] = alpha; } argRGB[j] = (const GLchan (*)[4]) ccolor[j]; } @@ -1812,6 +1814,7 @@ texture_combine(const GLcontext *ctx, const GLchan (*src)[4] = argRGB[j]; GLchan (*dst)[4] = ccolor[j]; + /* point to new arg[j] storage */ argRGB[j] = (const GLchan (*)[4]) ccolor[j]; if (textureUnit->CombineOperandRGB[j] == GL_ONE_MINUS_SRC_COLOR) { @@ -1822,7 +1825,6 @@ texture_combine(const GLcontext *ctx, } } else if (textureUnit->CombineOperandRGB[j] == GL_SRC_ALPHA) { - src = (const GLchan (*)[4]) argA[j]; for (i = 0; i < n; i++) { dst[i][RCOMP] = src[i][ACOMP]; dst[i][GCOMP] = src[i][ACOMP]; @@ -1831,7 +1833,6 @@ texture_combine(const GLcontext *ctx, } else { ASSERT(textureUnit->CombineOperandRGB[j] ==GL_ONE_MINUS_SRC_ALPHA); - src = (const GLchan (*)[4]) argA[j]; for (i = 0; i < n; i++) { dst[i][RCOMP] = CHAN_MAX - src[i][ACOMP]; dst[i][GCOMP] = CHAN_MAX - src[i][ACOMP]; |