-/* $Id: accum.c,v 1.24 2000/09/07 15:45:26 brianp Exp $ */
+/* $Id: accum.c,v 1.25 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
b = (GLaccum) (ctx->Accum.ClearColor[2] * acc_scale);
a = (GLaccum) (ctx->Accum.ClearColor[3] * acc_scale);
/* size of region to clear */
- width = 4 * (ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1);
- height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ width = 4 * (ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin);
+ height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
/* ptr to first element to clear */
row = ctx->DrawBuffer->Accum
+ 4 * (ctx->DrawBuffer->Ymin * ctx->DrawBuffer->Width
+/* $Id: buffers.c,v 1.11 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
{
const GLint x = ctx->DrawBuffer->Xmin;
const GLint y = ctx->DrawBuffer->Ymin;
- const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
- const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
if (ctx->Visual->RGBAflag) {
/* RGBA mode */
{
const GLint x = ctx->DrawBuffer->Xmin;
const GLint y = ctx->DrawBuffer->Ymin;
- const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
- const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
if (ctx->Visual->RGBAflag) {
if (ctx->RenderMode==GL_RENDER) {
const GLint x = ctx->DrawBuffer->Xmin;
const GLint y = ctx->DrawBuffer->Ymin;
- const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
- const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ const GLint height = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
GLbitfield ddMask;
GLbitfield newMask;
-/* $Id: context.c,v 1.83 2000/09/07 15:45:27 brianp Exp $ */
+/* $Id: context.c,v 1.84 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
(*ctx->Driver.Flush)( ctx );
}
}
+
+
+
+const char *_mesa_prim_name[GL_POLYGON+2] = {
+ "GL_POINTS",
+ "GL_LINES",
+ "GL_LINE_LOOP",
+ "GL_LINE_STRIP",
+ "GL_TRIANGLES",
+ "GL_TRIANGLE_STRIP",
+ "GL_TRIANGLE_FAN",
+ "GL_QUADS",
+ "GL_QUAD_STRIP",
+ "GL_POLYGON",
+ "culled primitive"
+};
+
-/* $Id: depth.c,v 1.17 2000/04/11 20:42:22 brianp Exp $ */
+/* $Id: depth.c,v 1.18 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* only clear scissor region */
if (ctx->Visual->DepthBits <= 16) {
const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual->DepthMax);
- const GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ const GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLushort *dRow = (GLushort *) ctx->DrawBuffer->DepthBuffer
+ ctx->DrawBuffer->Ymin * width + ctx->DrawBuffer->Xmin;
}
else {
const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual->DepthMax);
- const GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin + 1;
+ const GLint rows = ctx->DrawBuffer->Ymax - ctx->DrawBuffer->Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLuint *dRow = (GLuint *) ctx->DrawBuffer->DepthBuffer
+ ctx->DrawBuffer->Ymin * width + ctx->DrawBuffer->Xmin;
-/* $Id: drawpix.c,v 1.32 2000/09/06 17:44:52 brianp Exp $ */
+/* $Id: drawpix.c,v 1.33 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
/* right clipping */
if (*destX + *width > buffer->Xmax)
- *width -= (*destX + *width - buffer->Xmax - 1);
+ *width -= (*destX + *width - buffer->Xmax);
if (*width <= 0)
return GL_FALSE;
}
/* top clipping */
if (*destY + *height > buffer->Ymax)
- *height -= (*destY + *height - buffer->Ymax - 1);
+ *height -= (*destY + *height - buffer->Ymax);
if (*height <= 0)
return GL_TRUE;
destX = ctx->DrawBuffer->Xmin;
}
if (destX + drawWidth > ctx->DrawBuffer->Xmax)
- drawWidth -= (destX + drawWidth - ctx->DrawBuffer->Xmax - 1);
+ drawWidth -= (destX + drawWidth - ctx->DrawBuffer->Xmax);
if (drawWidth <= 0)
return GL_TRUE;
destY = ctx->DrawBuffer->Ymin;
}
if (destY + drawHeight > ctx->DrawBuffer->Ymax)
- drawHeight -= (destY + drawHeight - ctx->DrawBuffer->Ymax - 1);
+ drawHeight -= (destY + drawHeight - ctx->DrawBuffer->Ymax);
if (drawHeight <= 0)
return GL_TRUE;
}
destX = ctx->DrawBuffer->Xmin;
}
if (destX + drawWidth > ctx->DrawBuffer->Xmax)
- drawWidth -= (destX + drawWidth - ctx->DrawBuffer->Xmax - 1);
+ drawWidth -= (destX + drawWidth - ctx->DrawBuffer->Xmax);
if (drawWidth <= 0)
return GL_TRUE;
/* vertical clipping */
if (destY > ctx->DrawBuffer->Ymax) {
- skipRows += (destY - ctx->DrawBuffer->Ymax - 1);
- drawHeight -= (destY - ctx->DrawBuffer->Ymax - 1);
- destY = ctx->DrawBuffer->Ymax + 1;
+ skipRows += (destY - ctx->DrawBuffer->Ymax);
+ drawHeight -= (destY - ctx->DrawBuffer->Ymax);
+ destY = ctx->DrawBuffer->Ymax;
}
if (destY - drawHeight < ctx->DrawBuffer->Ymin)
drawHeight -= (ctx->DrawBuffer->Ymin - (destY - drawHeight));
-/* $Id: state.c,v 1.24 2000/09/07 15:45:27 brianp Exp $ */
+/* $Id: state.c,v 1.25 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* update scissor region */
ctx->DrawBuffer->Xmin = 0;
ctx->DrawBuffer->Ymin = 0;
- ctx->DrawBuffer->Xmax = ctx->DrawBuffer->Width-1;
- ctx->DrawBuffer->Ymax = ctx->DrawBuffer->Height-1;
+ ctx->DrawBuffer->Xmax = ctx->DrawBuffer->Width;
+ ctx->DrawBuffer->Ymax = ctx->DrawBuffer->Height;
if (ctx->Scissor.Enabled) {
if (ctx->Scissor.X > ctx->DrawBuffer->Xmin) {
ctx->DrawBuffer->Xmin = ctx->Scissor.X;
if (ctx->Scissor.Y > ctx->DrawBuffer->Ymin) {
ctx->DrawBuffer->Ymin = ctx->Scissor.Y;
}
- if (ctx->Scissor.X + ctx->Scissor.Width - 1 < ctx->DrawBuffer->Xmax) {
- ctx->DrawBuffer->Xmax = ctx->Scissor.X + ctx->Scissor.Width - 1;
+ if (ctx->Scissor.X + ctx->Scissor.Width < ctx->DrawBuffer->Xmax) {
+ ctx->DrawBuffer->Xmax = ctx->Scissor.X + ctx->Scissor.Width;
}
- if (ctx->Scissor.Y + ctx->Scissor.Height - 1 < ctx->DrawBuffer->Ymax) {
- ctx->DrawBuffer->Ymax = ctx->Scissor.Y + ctx->Scissor.Height - 1;
+ if (ctx->Scissor.Y + ctx->Scissor.Height < ctx->DrawBuffer->Ymax) {
+ ctx->DrawBuffer->Ymax = ctx->Scissor.Y + ctx->Scissor.Height;
}
}
}
-/* $Id: stencil.c,v 1.17 2000/08/30 18:23:08 brianp Exp $ */
+/* $Id: stencil.c,v 1.18 2000/09/08 21:28:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
*
if (ctx->Scissor.Enabled) {
/* clear scissor region only */
- const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
if (ctx->Stencil.WriteMask != STENCIL_MAX) {
/* must apply mask to the clear */
GLint y;
- for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ for (y = ctx->DrawBuffer->Ymin; y < ctx->DrawBuffer->Ymax; y++) {
const GLstencil mask = ctx->Stencil.WriteMask;
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
else {
/* no masking */
GLint y;
- for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ for (y = ctx->DrawBuffer->Ymin; y < ctx->DrawBuffer->Ymax; y++) {
GLstencil *stencil = STENCIL_ADDRESS( ctx->DrawBuffer->Xmin, y );
#if STENCIL_BITS==8
MEMSET( stencil, ctx->Stencil.Clear, width * sizeof(GLstencil) );
if (ctx->Scissor.Enabled) {
/* clear scissor region only */
const GLint x = ctx->DrawBuffer->Xmin;
- const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin + 1;
+ const GLint width = ctx->DrawBuffer->Xmax - ctx->DrawBuffer->Xmin;
if (ctx->Stencil.WriteMask != STENCIL_MAX) {
/* must apply mask to the clear */
GLint y;
- for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ for (y = ctx->DrawBuffer->Ymin; y < ctx->DrawBuffer->Ymax; y++) {
const GLstencil mask = ctx->Stencil.WriteMask;
const GLstencil invMask = ~mask;
const GLstencil clearVal = (ctx->Stencil.Clear & mask);
for (i = 0; i < width; i++) {
stencil[i] = ctx->Stencil.Clear;
}
- for (y = ctx->DrawBuffer->Ymin; y <= ctx->DrawBuffer->Ymax; y++) {
+ for (y = ctx->DrawBuffer->Ymin; y < ctx->DrawBuffer->Ymax; y++) {
(*ctx->Driver.WriteStencilSpan)(ctx, x, y, width, stencil, NULL);
}
}