+/* $Id: s_alphabuf.c,v 1.5 2001/03/03 20:33:30 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 3.5
*
- * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2001 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"),
buf->FrontLeftAlpha = (GLchan *) MALLOC( bytes );
if (!buf->FrontLeftAlpha) {
/* out of memory */
- gl_error( ctx, GL_OUT_OF_MEMORY,
+ _mesa_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate front-left alpha buffer" );
}
- if (ctx->Visual.DBflag) {
+ if (ctx->Visual.doubleBufferMode) {
if (buf->BackLeftAlpha) {
FREE( buf->BackLeftAlpha );
}
buf->BackLeftAlpha = (GLchan *) MALLOC( bytes );
if (!buf->BackLeftAlpha) {
/* out of memory */
- gl_error( ctx, GL_OUT_OF_MEMORY,
+ _mesa_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate back-left alpha buffer" );
}
}
- if (ctx->Visual.StereoFlag) {
+ if (ctx->Visual.stereoMode) {
if (buf->FrontRightAlpha) {
FREE( buf->FrontRightAlpha );
}
buf->FrontRightAlpha = (GLchan *) MALLOC( bytes );
if (!buf->FrontRightAlpha) {
/* out of memory */
- gl_error( ctx, GL_OUT_OF_MEMORY,
+ _mesa_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate front-right alpha buffer" );
}
- if (ctx->Visual.DBflag) {
+ if (ctx->Visual.doubleBufferMode) {
if (buf->BackRightAlpha) {
FREE( buf->BackRightAlpha );
}
buf->BackRightAlpha = (GLchan *) MALLOC( bytes );
if (!buf->BackRightAlpha) {
/* out of memory */
- gl_error( ctx, GL_OUT_OF_MEMORY,
+ _mesa_error( ctx, GL_OUT_OF_MEMORY,
"Couldn't allocate back-right alpha buffer" );
}
}
void
_mesa_clear_alpha_buffers( GLcontext *ctx )
{
- const GLchan aclear = (GLint) (ctx->Color.ClearColor[3] * CHAN_MAXF);
+ const GLchan aclear = ctx->Color.ClearColor[3];
GLuint bufferBit;
ASSERT(ctx->DrawBuffer->UseSoftwareAlphaBuffers);
if (ctx->Scissor.Enabled) {
/* clear scissor region */
GLint j;
- GLint rowLen = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
- GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ GLint rowLen = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin + 1;
+ GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin + 1;
GLchan *aptr = buffer
- + ctx->DrawBuffer->Ymin * ctx->DrawBuffer->Width
- + ctx->DrawBuffer->Xmin;
+ + ctx->DrawBuffer->_Ymin * ctx->DrawBuffer->Width
+ + ctx->DrawBuffer->_Xmin;
for (j = 0; j < rows; j++) {
#if CHAN_BITS == 8
MEMSET( aptr, aclear, rowLen );