summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/x11
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2003-02-17 16:35:56 +0000
committerBrian Paul <[email protected]>2003-02-17 16:35:56 +0000
commit449e47f06a46c42fb9895d13f37b599600225e56 (patch)
treeed1798bd1acf589b689a8c8c4630e4414265488d /src/mesa/drivers/x11
parent85109b063c24945ec9d8e4878e961666cdf0039b (diff)
Replace some #defines with enums. (Klaus Niederkrueger)
Diffstat (limited to 'src/mesa/drivers/x11')
-rw-r--r--src/mesa/drivers/x11/xm_api.c56
-rw-r--r--src/mesa/drivers/x11/xm_line.c18
-rw-r--r--src/mesa/drivers/x11/xm_span.c90
-rw-r--r--src/mesa/drivers/x11/xm_tri.c42
-rw-r--r--src/mesa/drivers/x11/xmesaP.h38
5 files changed, 123 insertions, 121 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c
index a8ce2f9c678..d1d2bce49d4 100644
--- a/src/mesa/drivers/x11/xm_api.c
+++ b/src/mesa/drivers/x11/xm_api.c
@@ -1,4 +1,4 @@
-/* $Id: xm_api.c,v 1.52 2003/01/24 15:33:22 brianp Exp $ */
+/* $Id: xm_api.c,v 1.53 2003/02/17 16:35:56 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -866,8 +866,8 @@ static GLboolean setup_grayscale( int client, XMesaVisual v,
}
}
- v->dithered_pf = PF_GRAYSCALE;
- v->undithered_pf = PF_GRAYSCALE;
+ v->dithered_pf = PF_Grayscale;
+ v->undithered_pf = PF_Grayscale;
return GL_TRUE;
}
@@ -946,8 +946,8 @@ static GLboolean setup_dithered_color( int client, XMesaVisual v,
}
}
- v->dithered_pf = PF_DITHER;
- v->undithered_pf = PF_LOOKUP;
+ v->dithered_pf = PF_Dither;
+ v->undithered_pf = PF_Lookup;
return GL_TRUE;
}
@@ -1090,8 +1090,8 @@ static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer,
v->Kernel[i] = kernel[i] >> maxBits;
}
- v->undithered_pf = PF_TRUECOLOR;
- v->dithered_pf = (GET_VISUAL_DEPTH(v)<24) ? PF_TRUEDITHER : PF_TRUECOLOR;
+ v->undithered_pf = PF_Truecolor;
+ v->dithered_pf = (GET_VISUAL_DEPTH(v)<24) ? PF_Dither_True : PF_Truecolor;
}
/*
@@ -1136,7 +1136,7 @@ static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer,
&& v->RedGamma==1.0 && v->GreenGamma==1.0 && v->BlueGamma==1.0) {
/* 5-6-5 color weight on common PC VGA boards */
v->undithered_pf = PF_5R6G5B;
- v->dithered_pf = PF_DITHER_5R6G5B;
+ v->dithered_pf = PF_Dither_5R6G5B;
}
else if (GET_REDMASK(v) ==0xe0
&& GET_GREENMASK(v)==0x1c
@@ -1154,7 +1154,7 @@ static void setup_truecolor( XMesaVisual v, XMesaBuffer buffer,
static void setup_monochrome( XMesaVisual v, XMesaBuffer b )
{
(void) b;
- v->dithered_pf = v->undithered_pf = PF_1BIT;
+ v->dithered_pf = v->undithered_pf = PF_1Bit;
/* if black=1 then we must flip pixel values */
v->bitFlip = (GET_BLACK_PIXEL(v) != 0);
}
@@ -1196,7 +1196,7 @@ static GLboolean initialize_visual_and_buffer( int client,
* Even if the visual is TrueColor or DirectColor we treat it as
* being color indexed. This is weird but might be useful to someone.
*/
- v->dithered_pf = v->undithered_pf = PF_INDEX;
+ v->dithered_pf = v->undithered_pf = PF_Index;
v->index_bits = GET_VISUAL_DEPTH(v);
}
else {
@@ -1359,9 +1359,9 @@ xmesa_color_to_pixel( XMesaContext xmesa, GLubyte r, GLubyte g, GLubyte b, GLuby
GLuint pixelFormat)
{
switch (pixelFormat) {
- case PF_INDEX:
+ case PF_Index:
return 0;
- case PF_TRUECOLOR:
+ case PF_Truecolor:
{
unsigned long p;
PACK_TRUECOLOR( p, r, g, b );
@@ -1375,26 +1375,26 @@ xmesa_color_to_pixel( XMesaContext xmesa, GLubyte r, GLubyte g, GLubyte b, GLuby
return PACK_8R8G8B( r, g, b );
case PF_5R6G5B:
return PACK_5R6G5B( r, g, b );
- case PF_DITHER:
+ case PF_Dither:
{
DITHER_SETUP;
return DITHER( 1, 0, r, g, b );
}
- case PF_1BIT:
+ case PF_1Bit:
/* 382 = (3*255)/2 */
return ((r+g+b) > 382) ^ xmesa->xm_visual->bitFlip;
case PF_HPCR:
return DITHER_HPCR(1, 1, r, g, b);
- case PF_LOOKUP:
+ case PF_Lookup:
{
LOOKUP_SETUP;
return LOOKUP( r, g, b );
}
- case PF_GRAYSCALE:
+ case PF_Grayscale:
return GRAY_RGB( r, g, b );
- case PF_TRUEDITHER:
+ case PF_Dither_True:
/* fall through */
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
{
unsigned long p;
PACK_TRUEDITHER(p, 1, 0, r, g, b);
@@ -1795,7 +1795,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w,
if ((hw = fxQueryHardware())==GR_SSTTYPE_VOODOO) {
b->FXctx = fxMesaCreateBestContext(0, b->width, b->height, attribs);
- if ((v->undithered_pf!=PF_INDEX) && (b->backimage)) {
+ if ((v->undithered_pf!=PF_Index) && (b->backimage)) {
b->FXisHackUsable = b->FXctx ? GL_TRUE : GL_FALSE;
if (fxEnvVar[0]=='w' || fxEnvVar[0]=='W')
b->FXwindowHack = b->FXctx ? GL_TRUE : GL_FALSE;
@@ -2239,7 +2239,7 @@ static void FXgetImage( XMesaBuffer b )
b->width * sizeof(GLushort), /* stride */
b->backimage->data); /* dest buffer */
}
- else if (b->xm_visual->dithered_pf==PF_DITHER
+ else if (b->xm_visual->dithered_pf==PF_Dither
&& GET_VISUAL_DEPTH(b->xm_visual)==8) {
/* Special case: 8bpp RGB */
for (y=0;y<b->height;y++) {
@@ -2555,9 +2555,9 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
GLint a = (GLint) (alpha * 255.0F);
switch (xmesa->pixelformat) {
- case PF_INDEX:
+ case PF_Index:
return 0;
- case PF_TRUECOLOR:
+ case PF_Truecolor:
{
unsigned long p;
PACK_TRUECOLOR( p, r, g, b );
@@ -2569,26 +2569,26 @@ unsigned long XMesaDitherColor( XMesaContext xmesa, GLint x, GLint y,
return PACK_8R8G8B( r, g, b );
case PF_5R6G5B:
return PACK_5R6G5B( r, g, b );
- case PF_DITHER:
+ case PF_Dither:
{
DITHER_SETUP;
return DITHER( x, y, r, g, b );
}
- case PF_1BIT:
+ case PF_1Bit:
/* 382 = (3*255)/2 */
return ((r+g+b) > 382) ^ xmesa->xm_visual->bitFlip;
case PF_HPCR:
return DITHER_HPCR(x, y, r, g, b);
- case PF_LOOKUP:
+ case PF_Lookup:
{
LOOKUP_SETUP;
return LOOKUP( r, g, b );
}
- case PF_GRAYSCALE:
+ case PF_Grayscale:
return GRAY_RGB( r, g, b );
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
/* fall through */
- case PF_TRUEDITHER:
+ case PF_Dither_True:
{
unsigned long p;
PACK_TRUEDITHER(p, x, y, r, g, b);
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index 55cc5c7790b..1855fad99e3 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -1,4 +1,4 @@
-/* $Id: xm_line.c,v 1.21 2002/11/14 03:48:03 brianp Exp $ */
+/* $Id: xm_line.c,v 1.22 2003/02/17 16:35:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -511,7 +511,7 @@ static swrast_line_func get_line_func( GLcontext *ctx )
&& ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Line.Width==1.0F) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
+ case PF_Truecolor:
return flat_TRUECOLOR_z_line;
case PF_8A8B8G8R:
return flat_8A8B8G8R_z_line;
@@ -521,11 +521,11 @@ static swrast_line_func get_line_func( GLcontext *ctx )
return flat_8R8G8B24_z_line;
case PF_5R6G5B:
return flat_5R6G5B_z_line;
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
return flat_DITHER_5R6G5B_z_line;
- case PF_DITHER:
+ case PF_Dither:
return (depth==8) ? flat_DITHER8_z_line : (swrast_line_func) NULL;
- case PF_LOOKUP:
+ case PF_Lookup:
return (depth==8) ? flat_LOOKUP8_z_line : (swrast_line_func) NULL;
case PF_HPCR:
return flat_HPCR_z_line;
@@ -537,7 +537,7 @@ static swrast_line_func get_line_func( GLcontext *ctx )
&& swrast->_RasterMask==0
&& ctx->Line.Width==1.0F) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
+ case PF_Truecolor:
return flat_TRUECOLOR_line;
case PF_8A8B8G8R:
return flat_8A8B8G8R_line;
@@ -547,11 +547,11 @@ static swrast_line_func get_line_func( GLcontext *ctx )
return flat_8R8G8B24_line;
case PF_5R6G5B:
return flat_5R6G5B_line;
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
return flat_DITHER_5R6G5B_line;
- case PF_DITHER:
+ case PF_Dither:
return (depth==8) ? flat_DITHER8_line : (swrast_line_func) NULL;
- case PF_LOOKUP:
+ case PF_Lookup:
return (depth==8) ? flat_LOOKUP8_line : (swrast_line_func) NULL;
case PF_HPCR:
return flat_HPCR_line;
diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c
index c62b15835b0..40318c02dc1 100644
--- a/src/mesa/drivers/x11/xm_span.c
+++ b/src/mesa/drivers/x11/xm_span.c
@@ -1,4 +1,4 @@
-/* $Id: xm_span.c,v 1.18 2002/11/13 16:48:47 brianp Exp $ */
+/* $Id: xm_span.c,v 1.19 2003/02/17 16:35:59 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -3545,8 +3545,8 @@ static void read_color_span( const GLcontext *ctx,
#endif
if (span && !error) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
- case PF_TRUEDITHER:
+ case PF_Truecolor:
+ case PF_Dither_True:
{
const GLubyte *pixelToR = xmesa->xm_visual->PixelToR;
const GLubyte *pixelToG = xmesa->xm_visual->PixelToG;
@@ -3569,7 +3569,7 @@ static void read_color_span( const GLcontext *ctx,
}
break;
case PF_5R6G5B:
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
{
const GLubyte *pixelToR = xmesa->xm_visual->PixelToR;
const GLubyte *pixelToG = xmesa->xm_visual->PixelToG;
@@ -3640,9 +3640,9 @@ static void read_color_span( const GLcontext *ctx,
}
}
break;
- case PF_DITHER:
- case PF_LOOKUP:
- case PF_GRAYSCALE:
+ case PF_Dither:
+ case PF_Lookup:
+ case PF_Grayscale:
{
GLubyte *rTable = source->pixel_to_r;
GLubyte *gTable = source->pixel_to_g;
@@ -3670,7 +3670,7 @@ static void read_color_span( const GLcontext *ctx,
}
}
break;
- case PF_1BIT:
+ case PF_1Bit:
{
int bitFlip = xmesa->xm_visual->bitFlip;
GLuint i;
@@ -3703,8 +3703,8 @@ static void read_color_span( const GLcontext *ctx,
else if (source->backimage) {
/* Read from XImage back buffer */
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
- case PF_TRUEDITHER:
+ case PF_Truecolor:
+ case PF_Dither_True:
{
const GLubyte *pixelToR = xmesa->xm_visual->PixelToR;
const GLubyte *pixelToG = xmesa->xm_visual->PixelToG;
@@ -3729,7 +3729,7 @@ static void read_color_span( const GLcontext *ctx,
}
break;
case PF_5R6G5B:
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
{
const GLubyte *pixelToR = xmesa->xm_visual->PixelToR;
const GLubyte *pixelToG = xmesa->xm_visual->PixelToG;
@@ -3827,9 +3827,9 @@ static void read_color_span( const GLcontext *ctx,
}
}
break;
- case PF_DITHER:
- case PF_LOOKUP:
- case PF_GRAYSCALE:
+ case PF_Dither:
+ case PF_Lookup:
+ case PF_Grayscale:
{
const GLubyte *rTable = source->pixel_to_r;
const GLubyte *gTable = source->pixel_to_g;
@@ -3859,7 +3859,7 @@ static void read_color_span( const GLcontext *ctx,
}
}
break;
- case PF_1BIT:
+ case PF_1Bit:
{
XMesaImage *img = source->backimage;
int bitFlip = xmesa->xm_visual->bitFlip;
@@ -3928,10 +3928,10 @@ static void read_color_pixels( const GLcontext *ctx,
if (source->buffer) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
- case PF_TRUEDITHER:
+ case PF_Truecolor:
+ case PF_Dither_True:
case PF_5R6G5B:
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
{
unsigned long rMask = GET_REDMASK(xmesa->xm_visual);
unsigned long gMask = GET_GREENMASK(xmesa->xm_visual);
@@ -4004,9 +4004,9 @@ static void read_color_pixels( const GLcontext *ctx,
}
}
break;
- case PF_DITHER:
- case PF_LOOKUP:
- case PF_GRAYSCALE:
+ case PF_Dither:
+ case PF_Lookup:
+ case PF_Grayscale:
{
GLubyte *rTable = source->pixel_to_r;
GLubyte *gTable = source->pixel_to_g;
@@ -4023,7 +4023,7 @@ static void read_color_pixels( const GLcontext *ctx,
}
}
break;
- case PF_1BIT:
+ case PF_1Bit:
{
int bitFlip = xmesa->xm_visual->bitFlip;
for (i=0;i<n;i++) {
@@ -4045,10 +4045,10 @@ static void read_color_pixels( const GLcontext *ctx,
}
else if (source->backimage) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
- case PF_TRUEDITHER:
+ case PF_Truecolor:
+ case PF_Dither_True:
case PF_5R6G5B:
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
{
unsigned long rMask = GET_REDMASK(xmesa->xm_visual);
unsigned long gMask = GET_GREENMASK(xmesa->xm_visual);
@@ -4119,9 +4119,9 @@ static void read_color_pixels( const GLcontext *ctx,
}
}
break;
- case PF_DITHER:
- case PF_LOOKUP:
- case PF_GRAYSCALE:
+ case PF_Dither:
+ case PF_Lookup:
+ case PF_Grayscale:
{
GLubyte *rTable = source->pixel_to_r;
GLubyte *gTable = source->pixel_to_g;
@@ -4139,7 +4139,7 @@ static void read_color_pixels( const GLcontext *ctx,
}
}
break;
- case PF_1BIT:
+ case PF_1Bit:
{
XMesaImage *img = source->backimage;
int bitFlip = xmesa->xm_visual->bitFlip;
@@ -4250,21 +4250,21 @@ void xmesa_update_span_funcs( GLcontext *ctx )
if (xmesa->xm_buffer->buffer!=XIMAGE) {
/* Writing to window or back pixmap */
switch (xmesa->pixelformat) {
- case PF_INDEX:
+ case PF_Index:
dd->WriteCI32Span = write_span_index_pixmap;
dd->WriteCI8Span = write_span_index8_pixmap;
dd->WriteMonoCISpan = write_span_mono_index_pixmap;
dd->WriteCI32Pixels = write_pixels_index_pixmap;
dd->WriteMonoCIPixels = write_pixels_mono_index_pixmap;
break;
- case PF_TRUECOLOR:
+ case PF_Truecolor:
dd->WriteRGBASpan = write_span_TRUECOLOR_pixmap;
dd->WriteRGBSpan = write_span_rgb_TRUECOLOR_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_pixmap;
dd->WriteRGBAPixels = write_pixels_TRUECOLOR_pixmap;
dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap;
break;
- case PF_TRUEDITHER:
+ case PF_Dither_True:
dd->WriteRGBASpan = write_span_TRUEDITHER_pixmap;
dd->WriteRGBSpan = write_span_rgb_TRUEDITHER_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap;
@@ -4299,21 +4299,21 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->WriteRGBAPixels = write_pixels_5R6G5B_pixmap;
dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap;
break;
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
dd->WriteRGBASpan = write_span_DITHER_5R6G5B_pixmap;
dd->WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_pixmap;
dd->WriteRGBAPixels = write_pixels_DITHER_5R6G5B_pixmap;
dd->WriteMonoRGBAPixels = write_pixels_mono_TRUEDITHER_pixmap;
break;
- case PF_DITHER:
+ case PF_Dither:
dd->WriteRGBASpan = write_span_DITHER_pixmap;
dd->WriteRGBSpan = write_span_rgb_DITHER_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_DITHER_pixmap;
dd->WriteRGBAPixels = write_pixels_DITHER_pixmap;
dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_pixmap;
break;
- case PF_1BIT:
+ case PF_1Bit:
dd->WriteRGBASpan = write_span_1BIT_pixmap;
dd->WriteRGBSpan = write_span_rgb_1BIT_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_1BIT_pixmap;
@@ -4330,14 +4330,14 @@ void xmesa_update_span_funcs( GLcontext *ctx )
ctx->Driver.ClearColor = clear_color_HPCR_pixmap;
}
break;
- case PF_LOOKUP:
+ case PF_Lookup:
dd->WriteRGBASpan = write_span_LOOKUP_pixmap;
dd->WriteRGBSpan = write_span_rgb_LOOKUP_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_pixmap;
dd->WriteRGBAPixels = write_pixels_LOOKUP_pixmap;
dd->WriteMonoRGBAPixels = write_pixels_mono_pixmap;
break;
- case PF_GRAYSCALE:
+ case PF_Grayscale:
dd->WriteRGBASpan = write_span_GRAYSCALE_pixmap;
dd->WriteRGBSpan = write_span_rgb_GRAYSCALE_pixmap;
dd->WriteMonoRGBASpan = write_span_mono_pixmap;
@@ -4352,7 +4352,7 @@ void xmesa_update_span_funcs( GLcontext *ctx )
else if (xmesa->xm_buffer->buffer==XIMAGE) {
/* Writing to back XImage */
switch (xmesa->pixelformat) {
- case PF_INDEX:
+ case PF_Index:
dd->WriteCI32Span = write_span_index_ximage;
if (depth==8)
dd->WriteCI8Span = write_span_index8_ximage8;
@@ -4362,7 +4362,7 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->WriteCI32Pixels = write_pixels_index_ximage;
dd->WriteMonoCIPixels = write_pixels_mono_index_ximage;
break;
- case PF_TRUECOLOR:
+ case PF_Truecolor:
/* Generic RGB */
dd->WriteRGBASpan = write_span_TRUECOLOR_ximage;
dd->WriteRGBSpan = write_span_rgb_TRUECOLOR_ximage;
@@ -4370,7 +4370,7 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->WriteRGBAPixels = write_pixels_TRUECOLOR_ximage;
dd->WriteMonoRGBAPixels = write_pixels_mono_ximage;
break;
- case PF_TRUEDITHER:
+ case PF_Dither_True:
dd->WriteRGBASpan = write_span_TRUEDITHER_ximage;
dd->WriteRGBSpan = write_span_rgb_TRUEDITHER_ximage;
dd->WriteMonoRGBASpan = write_span_mono_TRUEDITHER_ximage;
@@ -4405,14 +4405,14 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->WriteRGBAPixels = write_pixels_5R6G5B_ximage;
dd->WriteMonoRGBAPixels = write_pixels_mono_ximage;
break;
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
dd->WriteRGBASpan = write_span_DITHER_5R6G5B_ximage;
dd->WriteRGBSpan = write_span_rgb_DITHER_5R6G5B_ximage;
dd->WriteMonoRGBASpan = write_span_mono_DITHER_5R6G5B_ximage;
dd->WriteRGBAPixels = write_pixels_DITHER_5R6G5B_ximage;
dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_5R6G5B_ximage;
break;
- case PF_DITHER:
+ case PF_Dither:
if (depth==8) {
dd->WriteRGBASpan = write_span_DITHER8_ximage;
dd->WriteRGBSpan = write_span_rgb_DITHER8_ximage;
@@ -4428,7 +4428,7 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->WriteMonoRGBAPixels = write_pixels_mono_DITHER_ximage;
}
break;
- case PF_1BIT:
+ case PF_1Bit:
dd->WriteRGBASpan = write_span_1BIT_ximage;
dd->WriteRGBSpan = write_span_rgb_1BIT_ximage;
dd->WriteMonoRGBASpan = write_span_mono_1BIT_ximage;
@@ -4445,7 +4445,7 @@ void xmesa_update_span_funcs( GLcontext *ctx )
ctx->Driver.ClearColor = clear_color_HPCR_ximage;
}
break;
- case PF_LOOKUP:
+ case PF_Lookup:
if (depth==8) {
dd->WriteRGBASpan = write_span_LOOKUP8_ximage;
dd->WriteRGBSpan = write_rgb_LOOKUP8_ximage;
@@ -4461,7 +4461,7 @@ void xmesa_update_span_funcs( GLcontext *ctx )
dd->WriteMonoRGBAPixels = write_pixels_mono_ximage;
}
break;
- case PF_GRAYSCALE:
+ case PF_Grayscale:
if (depth==8) {
dd->WriteRGBASpan = write_span_GRAYSCALE8_ximage;
dd->WriteRGBSpan = write_span_rgb_GRAYSCALE8_ximage;
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 68f457c409d..d34cac53fe8 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1,4 +1,4 @@
-/* $Id: xm_tri.c,v 1.30 2002/11/13 16:51:02 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.31 2003/02/17 16:36:01 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1333,7 +1333,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
&& ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
+ case PF_Truecolor:
USE(smooth_TRUECOLOR_z_triangle);
case PF_8A8B8G8R:
USE(smooth_8A8B8G8R_z_triangle);
@@ -1341,21 +1341,21 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
USE(smooth_8R8G8B_z_triangle);
case PF_8R8G8B24:
USE(smooth_8R8G8B24_z_triangle);
- case PF_TRUEDITHER:
+ case PF_Dither_True:
USE(smooth_TRUEDITHER_z_triangle);
case PF_5R6G5B:
USE(smooth_5R6G5B_z_triangle);
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
USE(smooth_DITHER_5R6G5B_z_triangle);
case PF_HPCR:
USE(smooth_HPCR_z_triangle);
- case PF_DITHER:
+ case PF_Dither:
if (depth == 8)
USE(smooth_DITHER8_z_triangle);
else
USE(smooth_DITHER_z_triangle);
break;
- case PF_LOOKUP:
+ case PF_Lookup:
if (depth == 8)
USE(smooth_LOOKUP8_z_triangle);
else
@@ -1371,7 +1371,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
&& ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
+ case PF_Truecolor:
USE(flat_TRUECOLOR_z_triangle);
case PF_8A8B8G8R:
USE(flat_8A8B8G8R_z_triangle);
@@ -1379,21 +1379,21 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
USE(flat_8R8G8B_z_triangle);
case PF_8R8G8B24:
USE(flat_8R8G8B24_z_triangle);
- case PF_TRUEDITHER:
+ case PF_Dither_True:
USE(flat_TRUEDITHER_z_triangle);
case PF_5R6G5B:
USE(flat_5R6G5B_z_triangle);
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
USE(flat_DITHER_5R6G5B_z_triangle);
case PF_HPCR:
USE(flat_HPCR_z_triangle);
- case PF_DITHER:
+ case PF_Dither:
if (depth == 8)
USE(flat_DITHER8_z_triangle);
else
USE(flat_DITHER_z_triangle);
break;
- case PF_LOOKUP:
+ case PF_Lookup:
if (depth == 8)
USE(flat_LOOKUP8_z_triangle);
else
@@ -1406,7 +1406,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
&& ctx->Light.ShadeModel==GL_SMOOTH
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
+ case PF_Truecolor:
USE(smooth_TRUECOLOR_triangle);
case PF_8A8B8G8R:
USE(smooth_8A8B8G8R_triangle);
@@ -1414,21 +1414,21 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
USE(smooth_8R8G8B_triangle);
case PF_8R8G8B24:
USE(smooth_8R8G8B24_triangle);
- case PF_TRUEDITHER:
+ case PF_Dither_True:
USE(smooth_TRUEDITHER_triangle);
case PF_5R6G5B:
USE(smooth_5R6G5B_triangle);
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
USE(smooth_DITHER_5R6G5B_triangle);
case PF_HPCR:
USE(smooth_HPCR_triangle);
- case PF_DITHER:
+ case PF_Dither:
if (depth == 8)
USE(smooth_DITHER8_triangle);
else
USE(smooth_DITHER_triangle);
break;
- case PF_LOOKUP:
+ case PF_Lookup:
if (depth == 8)
USE(smooth_LOOKUP8_triangle);
else
@@ -1442,9 +1442,9 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
&& ctx->Light.ShadeModel==GL_FLAT
&& ctx->Polygon.StippleFlag==GL_FALSE) {
switch (xmesa->pixelformat) {
- case PF_TRUECOLOR:
+ case PF_Truecolor:
USE(flat_TRUECOLOR_triangle);
- case PF_TRUEDITHER:
+ case PF_Dither_True:
USE(flat_TRUEDITHER_triangle);
case PF_8A8B8G8R:
USE(flat_8A8B8G8R_triangle);
@@ -1454,17 +1454,17 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
USE(flat_8R8G8B24_triangle);
case PF_5R6G5B:
USE(flat_5R6G5B_triangle);
- case PF_DITHER_5R6G5B:
+ case PF_Dither_5R6G5B:
USE(flat_DITHER_5R6G5B_triangle);
case PF_HPCR:
USE(flat_HPCR_triangle);
- case PF_DITHER:
+ case PF_Dither:
if (depth == 8)
USE(flat_DITHER8_triangle);
else
USE(flat_DITHER_triangle);
break;
- case PF_LOOKUP:
+ case PF_Lookup:
if (depth == 8)
USE(flat_LOOKUP8_triangle);
else
diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h
index 8afcba69be3..64b94d6eaf5 100644
--- a/src/mesa/drivers/x11/xmesaP.h
+++ b/src/mesa/drivers/x11/xmesaP.h
@@ -1,4 +1,4 @@
-/* $Id: xmesaP.h,v 1.33 2003/01/24 15:33:22 brianp Exp $ */
+/* $Id: xmesaP.h,v 1.34 2003/02/17 16:36:04 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -128,7 +128,25 @@ struct xmesa_context {
GLboolean swapbytes; /* Host byte order != display byte order? */
GLboolean direct; /* Direct rendering context? */
- GLuint pixelformat; /* Current pixel format */
+ /** Current pixel format */
+ enum {
+ PF_Index, /**< Color Index mode */
+ PF_Truecolor, /**< TrueColor or DirectColor, any depth */
+ PF_Dither_True, /**< TrueColor with dithering */
+ PF_8A8B8G8R, /**< 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
+ PF_8R8G8B, /**< 32-bit TrueColor: 8-R, 8-G, 8-B bits */
+ PF_5R6G5B, /**< 16-bit TrueColor: 5-R, 6-G, 5-B bits */
+ PF_Dither, /**< Color-mapped RGB with dither */
+ PF_Lookup, /**< Color-mapped RGB without dither */
+ PF_HPCR, /**< HP Color Recovery ([email protected] 30/08/95) */
+ PF_1Bit, /**< monochrome dithering of RGB */
+ PF_Grayscale, /**< Grayscale or StaticGray */
+ PF_8R8G8B24, /**< 24-bit TrueColor: 8-R, 8-G, 8-B bits */
+ PF_Dither_5R6G5B /**< 16-bit dithered TrueColor: 5-R, 6-G, 5-B */
+ } pixelformat;
+
+
+
GLubyte clearcolor[4]; /* current clearing color */
unsigned long clearpixel; /* current clearing pixel value */
@@ -243,22 +261,6 @@ struct xmesa_buffer {
#define BACK_XIMAGE 4
-/* Values for xmesa->pixelformat: */
-#define PF_INDEX 1 /* Color Index mode */
-#define PF_TRUECOLOR 2 /* TrueColor or DirectColor, any depth */
-#define PF_TRUEDITHER 3 /* TrueColor with dithering */
-#define PF_8A8B8G8R 4 /* 32-bit TrueColor: 8-A, 8-B, 8-G, 8-R */
-#define PF_8R8G8B 5 /* 32-bit TrueColor: 8-R, 8-G, 8-B bits */
-#define PF_5R6G5B 6 /* 16-bit TrueColor: 5-R, 6-G, 5-B bits */
-#define PF_DITHER 7 /* Color-mapped RGB with dither */
-#define PF_LOOKUP 8 /* Color-mapped RGB without dither */
-#define PF_HPCR 9 /* HP Color Recovery ([email protected] 30/08/95) */
-#define PF_1BIT 10 /* monochrome dithering of RGB */
-#define PF_GRAYSCALE 11 /* Grayscale or StaticGray */
-#define PF_8R8G8B24 12 /* 24-bit TrueColor: 8-R, 8-G, 8-B bits */
-#define PF_DITHER_5R6G5B 13 /* 16-bit dithered TrueColor: 5-R, 6-G, 5-B */
-
-
/*
* If pixelformat==PF_TRUECOLOR:
*/