-/* $Id: accum.c,v 1.17 2000/03/19 01:10:11 brianp Exp $ */
+/* $Id: accum.c,v 1.21 2000/06/19 00:42:24 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.3
*
- * Copyright (C) 1999 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAccum");
- if (ctx->Visual->AccumBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
+ if (ctx->Visual->AccumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) {
gl_error(ctx, GL_INVALID_OPERATION, "glAccum");
return;
}
switch (op) {
case GL_ADD:
- {
+ if (value != 0.0F) {
const GLaccum intVal = (GLaccum) (value * acc_scale);
GLuint j;
/* Leave optimized accum buffer mode */
break;
case GL_MULT:
- {
+ if (value != 1.0F) {
GLuint j;
/* Leave optimized accum buffer mode */
if (ctx->IntegerAccumMode)
break;
case GL_ACCUM:
+ if (value == 0.0F)
+ return;
+
(*ctx->Driver.SetReadBuffer)( ctx, ctx->ReadBuffer,
ctx->Pixel.DriverReadBuffer );
rgba[i][ACOMP] = multTable[acc[i4+3]];
}
if (ctx->Color.SWmasking) {
- gl_mask_rgba_span( ctx, width, xpos, ypos, rgba );
+ _mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLubyte (*)[4])rgba, NULL );
rgba[i][ACOMP] = CLAMP( a, 0, iChanMax );
}
if (ctx->Color.SWmasking) {
- gl_mask_rgba_span( ctx, width, xpos, ypos, rgba );
+ _mesa_mask_rgba_span( ctx, width, xpos, ypos, rgba );
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLubyte (*)[4])rgba, NULL );
GLuint buffersize;
GLfloat acc_scale;
- if (ctx->Visual->AccumBits==0) {
+ if (ctx->Visual->AccumRedBits==0) {
/* No accumulation buffer! */
return;
}
ctx->Accum.ClearColor[2]==0.0 &&
ctx->Accum.ClearColor[3]==0.0) {
/* Black */
- MEMSET( ctx->DrawBuffer->Accum, 0, buffersize * 4 * sizeof(GLaccum) );
+ BZERO( ctx->DrawBuffer->Accum, buffersize * 4 * sizeof(GLaccum) );
}
else {
/* Not black */