From 6b50a004ffb885dd86dd611979348bdf69b1151c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Apr 2002 01:40:18 +0000 Subject: blend_add() modified for GLfloat channels --- src/mesa/swrast/s_blend.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_blend.c b/src/mesa/swrast/s_blend.c index 5fa76322dc..73c03d1a63 100644 --- a/src/mesa/swrast/s_blend.c +++ b/src/mesa/swrast/s_blend.c @@ -1,4 +1,4 @@ -/* $Id: s_blend.c,v 1.16 2002/04/02 23:36:51 brianp Exp $ */ +/* $Id: s_blend.c,v 1.17 2002/04/04 01:40:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -28,6 +28,7 @@ #include "glheader.h" #include "context.h" +#include "colormac.h" #include "macros.h" #include "s_alphabuf.h" @@ -60,10 +61,7 @@ blend_noop( GLcontext *ctx, GLuint n, const GLubyte mask[], for (i = 0; i < n; i++) { if (mask[i]) { - rgba[i][RCOMP] = dest[i][RCOMP]; - rgba[i][GCOMP] = dest[i][GCOMP]; - rgba[i][BCOMP] = dest[i][BCOMP]; - rgba[i][ACOMP] = dest[i][ACOMP]; + COPY_CHAN4( rgba[i], dest[i] ); } } } @@ -142,6 +140,7 @@ blend_transparency( GLcontext *ctx, GLuint n, const GLubyte mask[], const GLint g = DIV255((rgba[i][GCOMP] - dest[i][GCOMP]) * t) + dest[i][GCOMP]; const GLint b = DIV255((rgba[i][BCOMP] - dest[i][BCOMP]) * t) + dest[i][BCOMP]; const GLint a = DIV255((rgba[i][ACOMP] - dest[i][ACOMP]) * t) + dest[i][ACOMP]; + #undef DIV255 #elif CHAN_BITS == 16 const GLfloat tt = (GLfloat) t / CHAN_MAXF; @@ -187,6 +186,16 @@ blend_add( GLcontext *ctx, GLuint n, const GLubyte mask[], for (i=0;i