summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-01-23 23:39:36 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-01-23 23:39:36 +0000
commitb6bcae5698df88f7730d40004ce7ce0462e97a20 (patch)
tree14c77826b5016293914eb529822e609792150964 /src/mesa/swrast
parentab0c886a6c0dd38ac6168c2a239720a761e6578f (diff)
Replaced struct gl_visual with struct __GLcontextModesRec from glcore.h.
Replace "RGBAMode" with "rgbMode", etc. Other minor clean-ups.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_aaline.c6
-rw-r--r--src/mesa/swrast/s_aatriangle.c6
-rw-r--r--src/mesa/swrast/s_accum.c17
-rw-r--r--src/mesa/swrast/s_alphabuf.c9
-rw-r--r--src/mesa/swrast/s_bitmap.c10
-rw-r--r--src/mesa/swrast/s_buffers.c10
-rw-r--r--src/mesa/swrast/s_context.c8
-rw-r--r--src/mesa/swrast/s_copypix.c24
-rw-r--r--src/mesa/swrast/s_depth.c30
-rw-r--r--src/mesa/swrast/s_drawpix.c32
-rw-r--r--src/mesa/swrast/s_feedback.c14
-rw-r--r--src/mesa/swrast/s_lines.c6
-rw-r--r--src/mesa/swrast/s_linetemp.h4
-rw-r--r--src/mesa/swrast/s_points.c6
-rw-r--r--src/mesa/swrast/s_readpix.c24
-rw-r--r--src/mesa/swrast/s_stencil.c4
-rw-r--r--src/mesa/swrast/s_triangle.c6
-rw-r--r--src/mesa/swrast/s_tritemp.h6
18 files changed, 117 insertions, 105 deletions
diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c
index 040dc15b61..ac368aa85b 100644
--- a/src/mesa/swrast/s_aaline.c
+++ b/src/mesa/swrast/s_aaline.c
@@ -1,10 +1,10 @@
-/* $Id: s_aaline.c,v 1.3 2000/11/22 07:32:18 joukj Exp $ */
+/* $Id: s_aaline.c,v 1.4 2001/01/23 23:39:37 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"),
@@ -486,7 +486,7 @@ _swrast_choose_aa_line_function(GLcontext *ctx)
ASSERT(ctx->Line.SmoothFlag);
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* RGBA */
if (ctx->Texture._ReallyEnabled) {
if (swrast->_MultiTextureEnabled
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c
index 090d5b6a81..219798d8c9 100644
--- a/src/mesa/swrast/s_aatriangle.c
+++ b/src/mesa/swrast/s_aatriangle.c
@@ -1,10 +1,10 @@
-/* $Id: s_aatriangle.c,v 1.5 2001/01/02 22:02:52 brianp Exp $ */
+/* $Id: s_aatriangle.c,v 1.6 2001/01/23 23:39:37 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"),
@@ -425,7 +425,7 @@ _mesa_set_aa_triangle_function(GLcontext *ctx)
}
}
else {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
SWRAST_CONTEXT(ctx)->Triangle = rgba_aa_tri;
}
else {
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index dd47e198ab..a70cab0364 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -1,10 +1,10 @@
-/* $Id: s_accum.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_accum.c,v 1.4 2001/01/23 23:39:37 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"),
@@ -30,6 +30,7 @@
#include "mem.h"
#include "s_accum.h"
+#include "s_alphabuf.h"
#include "s_context.h"
#include "s_masking.h"
#include "s_span.h"
@@ -135,7 +136,7 @@ _mesa_clear_accum_buffer( GLcontext *ctx )
GLuint buffersize;
GLfloat acc_scale;
- if (ctx->Visual.AccumRedBits==0) {
+ if (ctx->Visual.accumRedBits==0) {
/* No accumulation buffer! */
return;
}
@@ -472,6 +473,11 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
+ && ctx->Color.ColorMask[ACOMP]) {
+ _mesa_write_alpha_span(ctx, width, xpos, ypos,
+ (CONST GLubyte (*)[4]) rgba, NULL);
+ }
ypos++;
}
}
@@ -499,6 +505,11 @@ _swrast_Accum( GLcontext *ctx, GLenum op, GLfloat value,
}
(*ctx->Driver.WriteRGBASpan)( ctx, width, xpos, ypos,
(const GLchan (*)[4])rgba, NULL );
+ if (ctx->DrawBuffer->UseSoftwareAlphaBuffers
+ && ctx->Color.ColorMask[ACOMP]) {
+ _mesa_write_alpha_span(ctx, width, xpos, ypos,
+ (CONST GLubyte (*)[4]) rgba, NULL);
+ }
ypos++;
}
}
diff --git a/src/mesa/swrast/s_alphabuf.c b/src/mesa/swrast/s_alphabuf.c
index 11b782e787..0da11a5f25 100644
--- a/src/mesa/swrast/s_alphabuf.c
+++ b/src/mesa/swrast/s_alphabuf.c
@@ -1,9 +1,10 @@
+/* $Id: s_alphabuf.c,v 1.3 2001/01/23 23:39:37 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"),
@@ -69,7 +70,7 @@ alloc_alpha_buffers( GLcontext *ctx, GLframebuffer *buf )
"Couldn't allocate front-left alpha buffer" );
}
- if (ctx->Visual.DBflag) {
+ if (ctx->Visual.doubleBufferMode) {
if (buf->BackLeftAlpha) {
FREE( buf->BackLeftAlpha );
}
@@ -81,7 +82,7 @@ alloc_alpha_buffers( GLcontext *ctx, GLframebuffer *buf )
}
}
- if (ctx->Visual.StereoFlag) {
+ if (ctx->Visual.stereoMode) {
if (buf->FrontRightAlpha) {
FREE( buf->FrontRightAlpha );
}
@@ -92,7 +93,7 @@ alloc_alpha_buffers( GLcontext *ctx, GLframebuffer *buf )
"Couldn't allocate front-right alpha buffer" );
}
- if (ctx->Visual.DBflag) {
+ if (ctx->Visual.doubleBufferMode) {
if (buf->BackRightAlpha) {
FREE( buf->BackRightAlpha );
}
diff --git a/src/mesa/swrast/s_bitmap.c b/src/mesa/swrast/s_bitmap.c
index c5f4127c2e..ffeb268e7e 100644
--- a/src/mesa/swrast/s_bitmap.c
+++ b/src/mesa/swrast/s_bitmap.c
@@ -1,10 +1,10 @@
-/* $Id: s_bitmap.c,v 1.3 2000/11/16 21:05:41 keithw Exp $ */
+/* $Id: s_bitmap.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * Version: 3.5
*
- * Copyright (C) 1999 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"),
@@ -57,7 +57,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
_swrast_validate_derived( ctx );
/* Set bitmap drawing color */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLint r, g, b, a;
r = (GLint) (ctx->Current.RasterColor[0] * CHAN_MAXF);
g = (GLint) (ctx->Current.RasterColor[1] * CHAN_MAXF);
@@ -69,7 +69,7 @@ _swrast_Bitmap( GLcontext *ctx, GLint px, GLint py,
PB_SET_INDEX( PB, ctx->Current.RasterIndex );
}
- fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ fragZ = (GLdepth) ( ctx->Current.RasterPos[2] * ctx->DepthMaxF);
_mesa_win_fog_coords_from_z( ctx, 1, &fragZ, &fogCoord );
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index c0564e0b6a..46ffe8cc90 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -1,10 +1,10 @@
-/* $Id: s_buffers.c,v 1.2 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_buffers.c,v 1.3 2001/01/23 23:39:37 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"),
@@ -49,7 +49,7 @@ clear_color_buffer_with_masking( GLcontext *ctx )
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* RGBA mode */
const GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
const GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF);
@@ -99,7 +99,7 @@ clear_color_buffer(GLcontext *ctx)
const GLint height = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->_Xmax - ctx->DrawBuffer->_Xmin;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* RGBA mode */
const GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF);
const GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF);
@@ -124,7 +124,7 @@ clear_color_buffer(GLcontext *ctx)
else {
/* Color index mode */
ASSERT(ctx->Color.IndexMask == ~0);
- if (ctx->Visual.IndexBits == 8) {
+ if (ctx->Visual.indexBits == 8) {
/* 8-bit clear */
GLubyte span[MAX_WIDTH];
GLint i;
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index d02ef22442..ca7cbfd845 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -1,4 +1,4 @@
-/* $Id: s_context.c,v 1.10 2001/01/13 07:13:28 keithw Exp $ */
+/* $Id: s_context.c,v 1.11 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -59,7 +59,7 @@ _swrast_update_rasterflags( GLcontext *ctx )
if (ctx->Fog.Enabled) RasterMask |= FOG_BIT;
if (ctx->Scissor.Enabled) RasterMask |= SCISSOR_BIT;
if (ctx->Stencil.Enabled) RasterMask |= STENCIL_BIT;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
const GLuint colorMask = *((GLuint *) &ctx->Color.ColorMask);
if (colorMask != 0xffffffff) RasterMask |= MASKING_BIT;
if (ctx->Color.ColorLogicOpEnabled) RasterMask |= LOGIC_OP_BIT;
@@ -96,10 +96,10 @@ _swrast_update_rasterflags( GLcontext *ctx )
else if (ctx->Color.DrawBuffer==GL_NONE) {
RasterMask |= MULTI_DRAW_BIT;
}
- else if (ctx->Visual.RGBAflag && *((GLuint *) ctx->Color.ColorMask) == 0) {
+ else if (ctx->Visual.rgbMode && *((GLuint *) ctx->Color.ColorMask) == 0) {
RasterMask |= MULTI_DRAW_BIT; /* all RGBA channels disabled */
}
- else if (!ctx->Visual.RGBAflag && ctx->Color.IndexMask==0) {
+ else if (!ctx->Visual.rgbMode && ctx->Color.IndexMask==0) {
RasterMask |= MULTI_DRAW_BIT; /* all color index bits disabled */
}
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index 401b448a63..401955d00a 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -1,10 +1,10 @@
-/* $Id: s_copypix.c,v 1.9 2001/01/05 21:28:31 brianp Exp $ */
+/* $Id: s_copypix.c,v 1.10 2001/01/23 23:39:37 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"),
@@ -88,7 +88,7 @@ copy_conv_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
GLdepth z = (GLdepth)
- (ctx->Current.RasterPos[2] * ctx->Visual.DepthMax);
+ (ctx->Current.RasterPos[2] * ctx->DepthMax);
GLint i;
for (i = 0; i < width; i++) {
zspan[i] = z;
@@ -315,7 +315,7 @@ copy_rgba_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMax);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
for (i=0;i<width;i++) {
zspan[i] = z;
}
@@ -552,7 +552,7 @@ static void copy_ci_pixels( GLcontext *ctx,
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMax);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMax);
for (i=0;i<width;i++) {
zspan[i] = z;
}
@@ -650,7 +650,7 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
const GLboolean zoom = ctx->Pixel.ZoomX != 1.0F || ctx->Pixel.ZoomY != 1.0F;
GLint overlapping;
- if (!ctx->Visual.DepthBits) {
+ if (!ctx->Visual.depthBits) {
gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
return;
}
@@ -673,7 +673,7 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
ctx->Pixel.ZoomX, ctx->Pixel.ZoomY);
/* setup colors or indexes */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLuint *rgba32 = (GLuint *) rgba;
GLuint color = *(GLuint*)( ctx->Current.Color );
for (i = 0; i < width; i++) {
@@ -716,10 +716,10 @@ static void copy_depth_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
for (i = 0; i < width; i++) {
GLfloat d = depth[i] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias;
- zspan[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->Visual.DepthMax);
+ zspan[i] = (GLdepth) (CLAMP(d, 0.0F, 1.0F) * ctx->DepthMax);
}
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
if (zoom) {
gl_write_zoomed_rgba_span( ctx, width, destx, dy, zspan, 0,
(const GLchan (*)[4])rgba, desty );
@@ -758,7 +758,7 @@ static void copy_stencil_pixels( GLcontext *ctx, GLint srcx, GLint srcy,
const GLboolean shift_or_offset = ctx->Pixel.IndexShift || ctx->Pixel.IndexOffset;
GLint overlapping;
- if (!ctx->Visual.StencilBits) {
+ if (!ctx->Visual.stencilBits) {
gl_error( ctx, GL_INVALID_OPERATION, "glCopyPixels" );
return;
}
@@ -841,10 +841,10 @@ _swrast_CopyPixels( GLcontext *ctx,
if (SWRAST_CONTEXT(ctx)->NewState)
_swrast_validate_derived( ctx );
- if (type == GL_COLOR && ctx->Visual.RGBAflag) {
+ if (type == GL_COLOR && ctx->Visual.rgbMode) {
copy_rgba_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
- else if (type == GL_COLOR && !ctx->Visual.RGBAflag) {
+ else if (type == GL_COLOR && !ctx->Visual.rgbMode) {
copy_ci_pixels( ctx, srcx, srcy, width, height, destx, desty );
}
else if (type == GL_DEPTH) {
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 1199f67dd8..92a5a12de1 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -1,4 +1,4 @@
-/* $Id: s_depth.c,v 1.3 2000/11/13 20:02:57 keithw Exp $ */
+/* $Id: s_depth.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -43,7 +43,7 @@
GLvoid *
_mesa_zbuffer_address(GLcontext *ctx, GLint x, GLint y)
{
- if (ctx->Visual.DepthBits <= 16)
+ if (ctx->Visual.depthBits <= 16)
return (GLushort *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
else
return (GLuint *) ctx->DrawBuffer->DepthBuffer + ctx->DrawBuffer->Width * y + x;
@@ -550,7 +550,7 @@ _mesa_depth_test_span( GLcontext *ctx, GLuint n, GLint x, GLint y,
}
else {
/* software depth buffer */
- if (ctx->Visual.DepthBits <= 16) {
+ if (ctx->Visual.depthBits <= 16) {
GLushort *zptr = (GLushort *) Z_ADDRESS16(ctx, x, y);
GLuint passed = depth_test_span16(ctx, n, x, y, zptr, z, mask);
return passed;
@@ -1310,7 +1310,7 @@ _mesa_depth_test_pixels( GLcontext *ctx,
}
else {
/* software depth testing */
- if (ctx->Visual.DepthBits <= 16)
+ if (ctx->Visual.depthBits <= 16)
software_depth_test_pixels16(ctx, n, x, y, z, mask);
else
software_depth_test_pixels32(ctx, n, x, y, z, mask);
@@ -1365,7 +1365,7 @@ _mesa_read_depth_span( GLcontext *ctx,
if (ctx->DrawBuffer->DepthBuffer) {
/* read from software depth buffer */
- if (ctx->Visual.DepthBits <= 16) {
+ if (ctx->Visual.depthBits <= 16) {
const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
GLuint i;
for (i = 0; i < n; i++) {
@@ -1405,7 +1405,7 @@ void
_mesa_read_depth_span_float( GLcontext *ctx,
GLint n, GLint x, GLint y, GLfloat depth[] )
{
- const GLfloat scale = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat scale = 1.0F / ctx->DepthMaxF;
if (y < 0 || y >= ctx->DrawBuffer->Height ||
x + (GLint) n <= 0 || x >= ctx->DrawBuffer->Width) {
@@ -1437,7 +1437,7 @@ _mesa_read_depth_span_float( GLcontext *ctx,
if (ctx->DrawBuffer->DepthBuffer) {
/* read from software depth buffer */
- if (ctx->Visual.DepthBits <= 16) {
+ if (ctx->Visual.depthBits <= 16) {
const GLushort *zptr = Z_ADDRESS16( ctx, x, y );
GLuint i;
for (i = 0; i < n; i++) {
@@ -1494,7 +1494,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx )
}
/* allocate new depth buffer, but don't initialize it */
- if (ctx->Visual.DepthBits <= 16)
+ if (ctx->Visual.depthBits <= 16)
bytesPerValue = sizeof(GLushort);
else
bytesPerValue = sizeof(GLuint);
@@ -1523,7 +1523,7 @@ _mesa_alloc_depth_buffer( GLcontext *ctx )
void
_mesa_clear_depth_buffer( GLcontext *ctx )
{
- if (ctx->Visual.DepthBits == 0
+ if (ctx->Visual.depthBits == 0
|| !ctx->DrawBuffer->DepthBuffer
|| !ctx->Depth.Mask) {
/* no depth buffer, or writing to it is disabled */
@@ -1536,8 +1536,8 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
if (ctx->Scissor.Enabled) {
/* only clear scissor region */
- if (ctx->Visual.DepthBits <= 16) {
- const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ if (ctx->Visual.depthBits <= 16) {
+ const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax);
const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLushort *dRow = (GLushort *) ctx->DrawBuffer->DepthBuffer
@@ -1551,7 +1551,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
}
}
else {
- const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax);
const GLint rows = ctx->DrawBuffer->_Ymax - ctx->DrawBuffer->_Ymin;
const GLint width = ctx->DrawBuffer->Width;
GLuint *dRow = (GLuint *) ctx->DrawBuffer->DepthBuffer
@@ -1567,8 +1567,8 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
}
else {
/* clear whole buffer */
- if (ctx->Visual.DepthBits <= 16) {
- const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ if (ctx->Visual.depthBits <= 16) {
+ const GLushort clearValue = (GLushort) (ctx->Depth.Clear * ctx->DepthMax);
if ((clearValue & 0xff) == (clearValue >> 8)) {
if (clearValue == 0) {
BZERO(ctx->DrawBuffer->DepthBuffer,
@@ -1603,7 +1603,7 @@ _mesa_clear_depth_buffer( GLcontext *ctx )
}
else {
/* >16 bit depth buffer */
- const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->Visual.DepthMax);
+ const GLuint clearValue = (GLuint) (ctx->Depth.Clear * ctx->DepthMax);
if (clearValue == 0) {
BZERO(ctx->DrawBuffer->DepthBuffer,
ctx->DrawBuffer->Width*ctx->DrawBuffer->Height*sizeof(GLuint));
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index 766749e811..757f1ab071 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -1,10 +1,10 @@
-/* $Id: s_drawpix.c,v 1.7 2001/01/05 21:28:31 brianp Exp $ */
+/* $Id: s_drawpix.c,v 1.8 2001/01/23 23:39:37 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"),
@@ -182,7 +182,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else {
/* setup array of fragment Z value to pass to zoom function */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
GLint i;
ASSERT(drawWidth < MAX_WIDTH);
for (i=0; i<drawWidth; i++)
@@ -203,7 +203,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
if (format == GL_RGBA && type == CHAN_TYPE
&& ctx->_ImageTransferState==0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels) * 4;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -241,7 +241,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else if (format == GL_RGB && type == CHAN_TYPE
&& ctx->_ImageTransferState == 0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels) * 3;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -278,7 +278,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else if (format == GL_LUMINANCE && type == CHAN_TYPE
&& ctx->_ImageTransferState==0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels);
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -337,7 +337,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else if (format == GL_LUMINANCE_ALPHA && type == CHAN_TYPE
&& ctx->_ImageTransferState == 0) {
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLchan *src = (GLchan *) pixels
+ (skipRows * rowLength + skipPixels)*2;
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
@@ -402,7 +402,7 @@ fast_draw_pixels(GLcontext *ctx, GLint x, GLint y,
}
else if (format==GL_COLOR_INDEX && type==GL_UNSIGNED_BYTE) {
GLubyte *src = (GLubyte *) pixels + skipRows * rowLength + skipPixels;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
/* convert CI data to RGBA */
if (ctx->Pixel.ZoomX==1.0F && ctx->Pixel.ZoomY==1.0F) {
/* no zooming */
@@ -494,7 +494,7 @@ draw_index_pixels( GLcontext *ctx, GLint x, GLint y,
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
- GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
GLint i;
for (i = 0; i < drawWidth; i++) {
zspan[i] = zval;
@@ -604,7 +604,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
/* Colors or indexes */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
GLint i;
GLint r, g, b, a;
UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterColor[0]);
@@ -626,7 +626,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
}
if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort)
- && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
+ && !bias_or_scale && !zoom && ctx->Visual.rgbMode) {
/* Special case: directly write 16-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
@@ -639,8 +639,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
gl_write_rgba_span( ctx, width, x, y, zspan, 0, rgba, GL_BITMAP );
}
}
- else if (type==GL_UNSIGNED_INT && ctx->Visual.DepthBits == 32
- && !bias_or_scale && !zoom && ctx->Visual.RGBAflag) {
+ else if (type==GL_UNSIGNED_INT && ctx->Visual.depthBits == 32
+ && !bias_or_scale && !zoom && ctx->Visual.rgbMode) {
/* Special case: directly write 32-bit depth values */
GLint row;
for (row = 0; row < height; row++, y++) {
@@ -658,7 +658,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y,
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0);
_mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src,
&ctx->Unpack, ctx->_ImageTransferState );
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
if (zoom) {
gl_write_zoomed_rgba_span(ctx, width, x, y, zspan, 0,
(const GLchan (*)[4]) rgba, desty);
@@ -711,7 +711,7 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
/* Fragment depth values */
if (ctx->Depth.Test || ctx->Fog.Enabled) {
/* fill in array of z values */
- GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->Visual.DepthMaxF);
+ GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * ctx->DepthMaxF);
GLint i;
for (i=0;i<width;i++) {
zspan[i] = z;
@@ -862,7 +862,7 @@ _swrast_DrawPixels( GLcontext *ctx,
draw_depth_pixels( ctx, x, y, width, height, type, pixels );
break;
case GL_COLOR_INDEX:
- if (ctx->Visual.RGBAflag)
+ if (ctx->Visual.rgbMode)
draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels);
else
draw_index_pixels(ctx, x, y, width, height, type, pixels);
diff --git a/src/mesa/swrast/s_feedback.c b/src/mesa/swrast/s_feedback.c
index c63e11d17b..fa670d1639 100644
--- a/src/mesa/swrast/s_feedback.c
+++ b/src/mesa/swrast/s_feedback.c
@@ -1,10 +1,10 @@
-/* $Id: s_feedback.c,v 1.4 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: s_feedback.c,v 1.5 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.3
+ * 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"),
@@ -57,7 +57,7 @@ static void feedback_vertex( GLcontext *ctx,
win[0] = v->win[0];
win[1] = v->win[1];
- win[2] = v->win[2] / ctx->Visual.DepthMaxF;
+ win[2] = v->win[2] / ctx->DepthMaxF;
win[3] = 1.0 / v->win[3];
color[0] = CHAN_TO_FLOAT(pv->color[0]);
@@ -143,7 +143,7 @@ void gl_select_triangle( GLcontext *ctx,
const SWvertex *v2)
{
if (gl_cull_triangle( ctx, v0, v1, v2 )) {
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->DepthMaxF;
gl_update_hitflag( ctx, v0->win[2] * zs );
gl_update_hitflag( ctx, v1->win[2] * zs );
@@ -154,7 +154,7 @@ void gl_select_triangle( GLcontext *ctx,
void gl_select_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
{
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->DepthMaxF;
gl_update_hitflag( ctx, v0->win[2] * zs );
gl_update_hitflag( ctx, v1->win[2] * zs );
}
@@ -162,7 +162,7 @@ void gl_select_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 )
void gl_select_point( GLcontext *ctx, const SWvertex *v )
{
- const GLfloat zs = 1.0F / ctx->Visual.DepthMaxF;
+ const GLfloat zs = 1.0F / ctx->DepthMaxF;
gl_update_hitflag( ctx, v->win[2] * zs );
}
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c
index da8b2db180..d448bd59e4 100644
--- a/src/mesa/swrast/s_lines.c
+++ b/src/mesa/swrast/s_lines.c
@@ -1,10 +1,10 @@
-/* $Id: s_lines.c,v 1.9 2001/01/13 07:13:28 keithw Exp $ */
+/* $Id: s_lines.c,v 1.10 2001/01/23 23:39:37 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"),
@@ -969,7 +969,7 @@ void
_swrast_choose_line( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLboolean rgbmode = ctx->Visual.RGBAflag;
+ const GLboolean rgbmode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
if (ctx->Line.SmoothFlag) {
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 2035c96dda..8de9f8ee9d 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_linetemp.h,v 1.3 2000/11/19 23:10:26 brianp Exp $ */
+/* $Id: s_linetemp.h,v 1.4 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -85,7 +85,7 @@
#endif
#ifdef INTERP_Z
GLint z0, z1, dz;
- const GLint depthBits = ctx->Visual.DepthBits;
+ const GLint depthBits = ctx->Visual.depthBits;
const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0;
# define FixedToDepth(F) ((F) >> fixedToDepthShift)
# ifdef DEPTH_TYPE
diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c
index ecad3efe7c..bb5de30975 100644
--- a/src/mesa/swrast/s_points.c
+++ b/src/mesa/swrast/s_points.c
@@ -1,10 +1,10 @@
-/* $Id: s_points.c,v 1.11 2001/01/04 15:32:10 brianp Exp $ */
+/* $Id: s_points.c,v 1.12 2001/01/23 23:39:37 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"),
@@ -186,7 +186,7 @@ void
_swrast_choose_point( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- GLboolean rgbMode = ctx->Visual.RGBAflag;
+ GLboolean rgbMode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
if (ctx->Point.SpriteMode) {
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 4cc3dbd618..2dc739a103 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -1,10 +1,10 @@
-/* $Id: s_readpix.c,v 1.5 2000/12/13 00:46:22 brianp Exp $ */
+/* $Id: s_readpix.c,v 1.6 2001/01/23 23:39:37 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"),
@@ -55,7 +55,7 @@ static void read_index_pixels( GLcontext *ctx,
GLint i, j, readWidth;
/* error checking */
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
gl_error( ctx, GL_INVALID_OPERATION, "glReadPixels" );
return;
}
@@ -176,7 +176,7 @@ static void read_depth_pixels( GLcontext *ctx,
GLboolean bias_or_scale;
/* Error checking */
- if (ctx->Visual.DepthBits <= 0) {
+ if (ctx->Visual.depthBits <= 0) {
/* No depth buffer */
gl_error( ctx, GL_INVALID_OPERATION, "glReadPixels" );
return;
@@ -197,7 +197,7 @@ static void read_depth_pixels( GLcontext *ctx,
bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0;
- if (type==GL_UNSIGNED_SHORT && ctx->Visual.DepthBits == 16
+ if (type==GL_UNSIGNED_SHORT && ctx->Visual.depthBits == 16
&& !bias_or_scale && !packing->SwapBytes) {
/* Special case: directly read 16-bit unsigned depth values. */
for (j=0;j<height;j++,y++) {
@@ -210,7 +210,7 @@ static void read_depth_pixels( GLcontext *ctx,
dst[i] = depth[i];
}
}
- else if (type==GL_UNSIGNED_INT && ctx->Visual.DepthBits == 32
+ else if (type==GL_UNSIGNED_INT && ctx->Visual.depthBits == 32
&& !bias_or_scale && !packing->SwapBytes) {
/* Special case: directly read 32-bit unsigned depth values. */
for (j=0;j<height;j++,y++) {
@@ -342,7 +342,7 @@ static void read_stencil_pixels( GLcontext *ctx,
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;
- if (ctx->Visual.StencilBits<=0) {
+ if (ctx->Visual.stencilBits <= 0) {
/* No stencil buffer */
gl_error( ctx, GL_INVALID_OPERATION, "glReadPixels" );
return;
@@ -657,7 +657,7 @@ static void read_rgba_pixels( GLcontext *ctx,
dest = tmpImage;
for (row = 0; row < height; row++, y++) {
GLchan rgba[MAX_WIDTH][4];
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
gl_read_rgba_span(ctx, ctx->ReadBuffer, readWidth, x, y, rgba);
}
else {
@@ -703,7 +703,7 @@ static void read_rgba_pixels( GLcontext *ctx,
for (row = 0; row < height; row++, y++) {
GLchan rgba[MAX_WIDTH][4];
GLvoid *dst;
- if (ctx->Visual.RGBAflag) {
+ if (ctx->Visual.rgbMode) {
gl_read_rgba_span(ctx, ctx->ReadBuffer, readWidth, x, y, rgba);
}
else {
@@ -716,9 +716,9 @@ static void read_rgba_pixels( GLcontext *ctx,
}
dst = _mesa_image_address(packing, pixels, width, height,
format, type, 0, row, 0);
- if (ctx->Visual.RedBits < CHAN_BITS ||
- ctx->Visual.GreenBits < CHAN_BITS ||
- ctx->Visual.BlueBits < CHAN_BITS) {
+ if (ctx->Visual.redBits < CHAN_BITS ||
+ ctx->Visual.greenBits < CHAN_BITS ||
+ ctx->Visual.blueBits < CHAN_BITS) {
/* Requantize the color values into floating point and go from
* there. This fixes conformance failures with 16-bit color
* buffers, for example.
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index 2a60c7a4db..8ce6c0ae5a 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1,4 +1,4 @@
-/* $Id: s_stencil.c,v 1.4 2000/11/28 21:34:04 brianp Exp $ */
+/* $Id: s_stencil.c,v 1.5 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1130,7 +1130,7 @@ _mesa_alloc_stencil_buffer( GLcontext *ctx )
static void
clear_software_stencil_buffer( GLcontext *ctx )
{
- if (ctx->Visual.StencilBits==0 || !ctx->DrawBuffer->Stencil) {
+ if (ctx->Visual.stencilBits==0 || !ctx->DrawBuffer->Stencil) {
/* no stencil buffer */
return;
}
diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c
index b61d4401e1..aac7c6030e 100644
--- a/src/mesa/swrast/s_triangle.c
+++ b/src/mesa/swrast/s_triangle.c
@@ -1,10 +1,10 @@
-/* $Id: s_triangle.c,v 1.8 2001/01/05 02:26:49 keithw Exp $ */
+/* $Id: s_triangle.c,v 1.9 2001/01/23 23:39:37 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"),
@@ -2266,7 +2266,7 @@ void
_swrast_choose_triangle( GLcontext *ctx )
{
SWcontext *swrast = SWRAST_CONTEXT(ctx);
- const GLboolean rgbmode = ctx->Visual.RGBAflag;
+ const GLboolean rgbmode = ctx->Visual.rgbMode;
if (ctx->RenderMode==GL_RENDER) {
diff --git a/src/mesa/swrast/s_tritemp.h b/src/mesa/swrast/s_tritemp.h
index 7abb933f6c..e139f3fc9f 100644
--- a/src/mesa/swrast/s_tritemp.h
+++ b/src/mesa/swrast/s_tritemp.h
@@ -1,4 +1,4 @@
-/* $Id: s_tritemp.h,v 1.6 2000/12/08 00:09:24 brianp Exp $ */
+/* $Id: s_tritemp.h,v 1.7 2001/01/23 23:39:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -88,9 +88,9 @@
} EdgeT;
#ifdef INTERP_Z
- const GLint depthBits = ctx->Visual.DepthBits;
+ const GLint depthBits = ctx->Visual.depthBits;
const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0;
- const GLfloat maxDepth = ctx->Visual.DepthMaxF;
+ const GLfloat maxDepth = ctx->DepthMaxF;
#define FixedToDepth(F) ((F) >> fixedToDepthShift)
#endif
EdgeT eMaj, eTop, eBot;