From b6bcae5698df88f7730d40004ce7ce0462e97a20 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 23 Jan 2001 23:39:36 +0000 Subject: [PATCH] Replaced struct gl_visual with struct __GLcontextModesRec from glcore.h. Replace "RGBAMode" with "rgbMode", etc. Other minor clean-ups. --- src/mesa/drivers/glide/fxapi.c | 6 +- src/mesa/drivers/osmesa/osmesa.c | 18 ++-- src/mesa/drivers/svga/svgamesa.c | 12 +-- src/mesa/drivers/x11/fakeglx.c | 50 ++++----- src/mesa/drivers/x11/xm_api.c | 56 +++++------ src/mesa/drivers/x11/xm_line.c | 4 +- src/mesa/drivers/x11/xm_tri.c | 151 ++++++++++++++++++---------- src/mesa/main/accum.c | 4 +- src/mesa/main/attrib.c | 6 +- src/mesa/main/buffers.c | 46 ++++----- src/mesa/main/context.c | 101 ++++++++++--------- src/mesa/main/dlist.c | 6 +- src/mesa/main/enable.c | 14 +-- src/mesa/main/feedback.c | 12 +-- src/mesa/main/get.c | 124 +++++++++++------------ src/mesa/main/image.c | 8 +- src/mesa/main/light.c | 4 +- src/mesa/main/matrix.c | 12 +-- src/mesa/main/mtypes.h | 45 ++------- src/mesa/main/pixel.c | 22 ++-- src/mesa/main/polygon.c | 8 +- src/mesa/main/rastpos.c | 10 +- src/mesa/swrast/s_aaline.c | 6 +- src/mesa/swrast/s_aatriangle.c | 6 +- src/mesa/swrast/s_accum.c | 17 +++- src/mesa/swrast/s_alphabuf.c | 9 +- src/mesa/swrast/s_bitmap.c | 10 +- src/mesa/swrast/s_buffers.c | 10 +- src/mesa/swrast/s_context.c | 8 +- src/mesa/swrast/s_copypix.c | 24 ++--- src/mesa/swrast/s_depth.c | 30 +++--- src/mesa/swrast/s_drawpix.c | 32 +++--- src/mesa/swrast/s_feedback.c | 14 +-- src/mesa/swrast/s_lines.c | 6 +- src/mesa/swrast/s_linetemp.h | 4 +- src/mesa/swrast/s_points.c | 6 +- src/mesa/swrast/s_readpix.c | 24 ++--- src/mesa/swrast/s_stencil.c | 4 +- src/mesa/swrast/s_triangle.c | 6 +- src/mesa/swrast/s_tritemp.h | 6 +- src/mesa/swrast_setup/ss_triangle.c | 2 +- src/mesa/swrast_setup/ss_tritmp.h | 2 + src/mesa/swrast_setup/ss_vb.c | 6 +- src/mesa/tnl/t_vb_light.c | 6 +- src/mesa/tnl/t_vb_render.c | 7 +- 45 files changed, 500 insertions(+), 464 deletions(-) diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 6470affd9aa..667f0fd022d 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -509,9 +509,9 @@ fxMesaContext GLAPIENTRY fxMesaCreateContext(GLuint win, fxMesa->glBuffer=_mesa_create_framebuffer(fxMesa->glVis, GL_FALSE, /* no software depth */ - fxMesa->glVis->StencilBits > 0, - fxMesa->glVis->AccumRedBits > 0, - fxMesa->glVis->AlphaBits > 0 ); + fxMesa->glVis->stencilBits > 0, + fxMesa->glVis->accumRedBits > 0, + fxMesa->glVis->alphaBits > 0 ); if (!fxMesa->glBuffer) { errorstr = "_mesa_create_framebuffer"; goto errorhandler; diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index c1fd7c475d3..a5c58598677 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -1,4 +1,4 @@ -/* $Id: osmesa.c,v 1.39 2001/01/16 21:16:56 brianp Exp $ */ +/* $Id: osmesa.c,v 1.40 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -280,10 +280,10 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, _mesa_enable_sw_extensions(&(osmesa->gl_ctx)); osmesa->gl_buffer = _mesa_create_framebuffer( osmesa->gl_visual, - osmesa->gl_visual->DepthBits > 0, - osmesa->gl_visual->StencilBits > 0, - osmesa->gl_visual->AccumRedBits > 0, - osmesa->gl_visual->AlphaBits > 0 ); + osmesa->gl_visual->depthBits > 0, + osmesa->gl_visual->stencilBits > 0, + osmesa->gl_visual->accumRedBits > 0, + osmesa->gl_visual->alphaBits > 0 ); if (!osmesa->gl_buffer) { _mesa_destroy_visual( osmesa->gl_visual ); @@ -1420,7 +1420,7 @@ osmesa_choose_line_function( GLcontext *ctx ) if (swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS) { switch(osmesa->format) { case OSMESA_RGBA: case OSMESA_BGRA: @@ -1445,7 +1445,7 @@ osmesa_choose_line_function( GLcontext *ctx ) if (swrast->_RasterMask==(DEPTH_BIT|BLEND_BIT) && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS && ctx->Color.BlendSrcRGB==GL_SRC_ALPHA && ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA && ctx->Color.BlendSrcA==GL_SRC_ALPHA @@ -1464,7 +1464,7 @@ osmesa_choose_line_function( GLcontext *ctx ) if (swrast->_RasterMask==(DEPTH_BIT|BLEND_BIT) && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_FALSE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS && ctx->Color.BlendSrcRGB==GL_SRC_ALPHA && ctx->Color.BlendDstRGB==GL_ONE_MINUS_SRC_ALPHA && ctx->Color.BlendSrcA==GL_SRC_ALPHA @@ -1611,7 +1611,7 @@ osmesa_choose_triangle_function( GLcontext *ctx ) if (swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS && osmesa->format!=OSMESA_COLOR_INDEX) { if (ctx->Light.ShadeModel==GL_SMOOTH) { return smooth_rgba_z_triangle; diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c index 2c6895abece..51c6bdc2d9f 100644 --- a/src/mesa/drivers/svga/svgamesa.c +++ b/src/mesa/drivers/svga/svgamesa.c @@ -1,4 +1,4 @@ -/* $Id: svgamesa.c,v 1.11 2000/12/26 05:09:30 keithw Exp $ */ +/* $Id: svgamesa.c,v 1.12 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -422,10 +422,10 @@ SVGAMesaContext SVGAMesaCreateContext( GLboolean doubleBuffer ) _mesa_enable_sw_extensions(ctx->gl_ctx); ctx->gl_buffer = _mesa_create_framebuffer( ctx->gl_vis, - ctx->gl_vis->DepthBits > 0, - ctx->gl_vis->StencilBits > 0, - ctx->gl_vis->AccumRedBits > 0, - ctx->gl_vis->AlphaBits > 0 ); + ctx->gl_vis->depthBits > 0, + ctx->gl_vis->stencilBits > 0, + ctx->gl_vis->accumRedBits > 0, + ctx->gl_vis->alphaBits > 0 ); ctx->width = ctx->height = 0; /* temporary until first "make-current" */ #endif @@ -491,7 +491,7 @@ void SVGAMesaSwapBuffers( void ) #ifndef DEV _mesa_swapbuffers( SVGAMesa->gl_ctx ); - if (SVGAMesa->gl_vis->DBflag) + if (SVGAMesa->gl_vis->doubleBufferMode) #endif /* DEV */ { #ifdef SVGA_DEBUG diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index c0d31f47c0b..cd499403058 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1,4 +1,4 @@ -/* $Id: fakeglx.c,v 1.44 2001/01/08 04:55:22 keithw Exp $ */ +/* $Id: fakeglx.c,v 1.45 2001/01/23 23:39:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -269,16 +269,16 @@ save_glx_visual( Display *dpy, XVisualInfo *vinfo, if (v->display == dpy && v->level == level && v->ximage_flag == ximageFlag - && v->gl_visual->RGBAflag == rgbFlag - && v->gl_visual->DBflag == dbFlag - && v->gl_visual->StereoFlag == stereoFlag - && (v->gl_visual->AlphaBits > 0) == alphaFlag - && (v->gl_visual->DepthBits >= depth_size || depth_size == 0) - && (v->gl_visual->StencilBits >= stencil_size || stencil_size == 0) - && (v->gl_visual->AccumRedBits >= accumRedSize || accumRedSize == 0) - && (v->gl_visual->AccumGreenBits >= accumGreenSize || accumGreenSize == 0) - && (v->gl_visual->AccumBlueBits >= accumBlueSize || accumBlueSize == 0) - && (v->gl_visual->AccumAlphaBits >= accumAlphaSize || accumAlphaSize == 0)) { + && v->gl_visual->rgbMode == rgbFlag + && v->gl_visual->doubleBufferMode == dbFlag + && v->gl_visual->stereoMode == stereoFlag + && (v->gl_visual->alphaBits > 0) == alphaFlag + && (v->gl_visual->depthBits >= depth_size || depth_size == 0) + && (v->gl_visual->stencilBits >= stencil_size || stencil_size == 0) + && (v->gl_visual->accumRedBits >= accumRedSize || accumRedSize == 0) + && (v->gl_visual->accumGreenBits >= accumGreenSize || accumGreenSize == 0) + && (v->gl_visual->accumBlueBits >= accumBlueSize || accumBlueSize == 0) + && (v->gl_visual->accumAlphaBits >= accumAlphaSize || accumAlphaSize == 0)) { /* now either compare XVisualInfo pointers or visual IDs */ if ((!comparePointers && v->visinfo->visualid == vinfo->visualid) || (comparePointers && v->vishandle == vinfo)) { @@ -1400,7 +1400,7 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo, *value = glxvis->level; return 0; case GLX_RGBA: - if (glxvis->gl_visual->RGBAflag) { + if (glxvis->gl_visual->rgbMode) { *value = True; } else { @@ -1408,43 +1408,43 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo, } return 0; case GLX_DOUBLEBUFFER: - *value = (int) glxvis->gl_visual->DBflag; + *value = (int) glxvis->gl_visual->doubleBufferMode; return 0; case GLX_STEREO: - *value = (int) glxvis->gl_visual->StereoFlag; + *value = (int) glxvis->gl_visual->stereoMode; return 0; case GLX_AUX_BUFFERS: *value = (int) False; return 0; case GLX_RED_SIZE: - *value = glxvis->gl_visual->RedBits; + *value = glxvis->gl_visual->redBits; return 0; case GLX_GREEN_SIZE: - *value = glxvis->gl_visual->GreenBits; + *value = glxvis->gl_visual->greenBits; return 0; case GLX_BLUE_SIZE: - *value = glxvis->gl_visual->BlueBits; + *value = glxvis->gl_visual->blueBits; return 0; case GLX_ALPHA_SIZE: - *value = glxvis->gl_visual->AlphaBits; + *value = glxvis->gl_visual->alphaBits; return 0; case GLX_DEPTH_SIZE: - *value = glxvis->gl_visual->DepthBits; + *value = glxvis->gl_visual->depthBits; return 0; case GLX_STENCIL_SIZE: - *value = glxvis->gl_visual->StencilBits; + *value = glxvis->gl_visual->stencilBits; return 0; case GLX_ACCUM_RED_SIZE: - *value = glxvis->gl_visual->AccumRedBits; + *value = glxvis->gl_visual->accumRedBits; return 0; case GLX_ACCUM_GREEN_SIZE: - *value = glxvis->gl_visual->AccumGreenBits; + *value = glxvis->gl_visual->accumGreenBits; return 0; case GLX_ACCUM_BLUE_SIZE: - *value = glxvis->gl_visual->AccumBlueBits; + *value = glxvis->gl_visual->accumBlueBits; return 0; case GLX_ACCUM_ALPHA_SIZE: - *value = glxvis->gl_visual->AccumAlphaBits; + *value = glxvis->gl_visual->accumAlphaBits; return 0; /* @@ -1467,7 +1467,7 @@ Fake_glXGetConfig( Display *dpy, XVisualInfo *visinfo, } else if (glxvis->level>0) { /* overlay */ - if (glxvis->gl_visual->RGBAflag) { + if (glxvis->gl_visual->rgbMode) { *value = GLX_TRANSPARENT_RGB_EXT; } else { diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index e85710e61ca..9ef37b54ddf 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.15 2001/01/08 04:55:22 keithw Exp $ */ +/* $Id: xm_api.c,v 1.16 2001/01/23 23:39:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -822,8 +822,8 @@ static GLboolean setup_grayscale( int client, XMesaVisual v, prevBuffer = find_xmesa_buffer(v->display, cmap, buffer); if (prevBuffer && - (buffer->xm_visual->gl_visual->RGBAflag == - prevBuffer->xm_visual->gl_visual->RGBAflag)) { + (buffer->xm_visual->gl_visual->rgbMode == + prevBuffer->xm_visual->gl_visual->rgbMode)) { /* Copy colormap stuff from previous XMesaBuffer which uses same * X colormap. Do this to avoid time spent in noFaultXAllocColor. */ @@ -910,8 +910,8 @@ static GLboolean setup_dithered_color( int client, XMesaVisual v, prevBuffer = find_xmesa_buffer(v->display, cmap, buffer); if (prevBuffer && - (buffer->xm_visual->gl_visual->RGBAflag == - prevBuffer->xm_visual->gl_visual->RGBAflag)) { + (buffer->xm_visual->gl_visual->rgbMode == + prevBuffer->xm_visual->gl_visual->rgbMode)) { /* Copy colormap stuff from previous, matching XMesaBuffer. * Do this to avoid time spent in noFaultXAllocColor. */ @@ -1277,7 +1277,7 @@ static GLboolean initialize_visual_and_buffer( int client, assert( v->gl_visual ); /* Setup for single/double buffering */ - if (v->gl_visual->DBflag) { + if (v->gl_visual->doubleBufferMode) { /* Double buffered */ #ifndef XFree86Server b->shm = check_for_xshm( v->display ); @@ -1793,7 +1793,7 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, #endif /* determine back buffer implementation */ - if (v->gl_visual->DBflag) { + if (v->gl_visual->doubleBufferMode) { if (v->ximage_flag) { b->db_state = BACK_XIMAGE; } @@ -1806,16 +1806,16 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, } b->gl_buffer = _mesa_create_framebuffer( v->gl_visual, - v->gl_visual->DepthBits > 0, - v->gl_visual->StencilBits > 0, - v->gl_visual->AccumRedBits > 0, - v->gl_visual->AlphaBits > 0 ); + v->gl_visual->depthBits > 0, + v->gl_visual->stencilBits > 0, + v->gl_visual->accumRedBits > 0, + v->gl_visual->alphaBits > 0 ); if (!b->gl_buffer) { free_xmesa_buffer(client, b); return NULL; } - if (!initialize_visual_and_buffer( client, v, b, v->gl_visual->RGBAflag, + if (!initialize_visual_and_buffer( client, v, b, v->gl_visual->rgbMode, (XMesaDrawable)w, b->cmap )) { _mesa_destroy_framebuffer( b->gl_buffer ); free_xmesa_buffer(client, b); @@ -1829,22 +1829,22 @@ XMesaBuffer XMesaCreateWindowBuffer2( XMesaVisual v, XMesaWindow w, int attribs[100]; int numAttribs = 0; int hw; - if (v->gl_visual->DepthBits > 0) { + if (v->gl_visual->depthBits > 0) { attribs[numAttribs++] = FXMESA_DEPTH_SIZE; attribs[numAttribs++] = 1; } - if (v->gl_visual->DBflag) { + if (v->gl_visual->doubleBufferMode) { attribs[numAttribs++] = FXMESA_DOUBLEBUFFER; } - if (v->gl_visual->AccumRedBits > 0) { + if (v->gl_visual->accumRedBits > 0) { attribs[numAttribs++] = FXMESA_ACCUM_SIZE; - attribs[numAttribs++] = v->gl_visual->AccumRedBits; + attribs[numAttribs++] = v->gl_visual->accumRedBits; } - if (v->gl_visual->StencilBits > 0) { + if (v->gl_visual->stencilBits > 0) { attribs[numAttribs++] = FXMESA_STENCIL_SIZE; - attribs[numAttribs++] = v->gl_visual->StencilBits; + attribs[numAttribs++] = v->gl_visual->stencilBits; } - if (v->gl_visual->AlphaBits > 0) { + if (v->gl_visual->alphaBits > 0) { attribs[numAttribs++] = FXMESA_ALPHA_SIZE; attribs[numAttribs++] = 1; } @@ -1935,7 +1935,7 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, b->cmap = cmap; /* determine back buffer implementation */ - if (v->gl_visual->DBflag) { + if (v->gl_visual->doubleBufferMode) { if (v->ximage_flag) { b->db_state = BACK_XIMAGE; } @@ -1948,18 +1948,18 @@ XMesaBuffer XMesaCreatePixmapBuffer( XMesaVisual v, } b->gl_buffer = _mesa_create_framebuffer( v->gl_visual, - v->gl_visual->DepthBits > 0, - v->gl_visual->StencilBits > 0, - v->gl_visual->AccumRedBits + - v->gl_visual->AccumGreenBits + - v->gl_visual->AccumBlueBits > 0, - v->gl_visual->AlphaBits > 0 ); + v->gl_visual->depthBits > 0, + v->gl_visual->stencilBits > 0, + v->gl_visual->accumRedBits + + v->gl_visual->accumGreenBits + + v->gl_visual->accumBlueBits > 0, + v->gl_visual->alphaBits > 0 ); if (!b->gl_buffer) { free_xmesa_buffer(client, b); return NULL; } - if (!initialize_visual_and_buffer(client, v, b, v->gl_visual->RGBAflag, + if (!initialize_visual_and_buffer(client, v, b, v->gl_visual->rgbMode, (XMesaDrawable)p, cmap)) { _mesa_destroy_framebuffer( b->gl_buffer ); free_xmesa_buffer(client, b); @@ -2087,7 +2087,7 @@ GLboolean XMesaMakeCurrent2( XMesaContext c, XMesaBuffer drawBuffer, c->gl_ctx->Scissor.Height = drawBuffer->height; } - if (c->xm_visual->gl_visual->RGBAflag) { + if (c->xm_visual->gl_visual->rgbMode) { /* * Must recompute and set these pixel values because colormap * can be different for different windows. diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c index e9bbfbca417..b997f63fdf7 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.15 2001/01/05 02:26:48 keithw Exp $ */ +/* $Id: xm_line.c,v 1.16 2001/01/23 23:39:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -565,7 +565,7 @@ static swrast_line_func get_line_func( GLcontext *ctx ) && swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS && ctx->Line.Width==1.0F) { switch (xmesa->pixelformat) { case PF_TRUECOLOR: diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c index 12f1f49a48f..4bb33ce66e3 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.16 2001/01/05 02:26:48 keithw Exp $ */ +/* $Id: xm_tri.c,v 1.17 2001/01/23 23:39:37 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1503,6 +1503,25 @@ void _xmesa_print_triangle_func( swrast_tri_func triFunc ) #endif +#ifdef DEBUG + +/* record the current triangle function name */ +static const char *triFuncName = NULL; + +#define USE(triFunc) \ +do { \ + triFuncName = #triFunc; \ + /*printf("%s\n", triFuncName);*/ \ + return triFunc; \ +} while (0) + +#else + +#define USE(triFunc) return triFunc + +#endif + + static swrast_tri_func get_triangle_func( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); @@ -1511,6 +1530,10 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) (void) kernel1; +#ifdef DEBUG + triFuncName = NULL; +#endif + if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL; if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL; if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL; @@ -1520,64 +1543,76 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) && swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS && ctx->Polygon.StippleFlag==GL_FALSE) { switch (xmesa->pixelformat) { case PF_TRUECOLOR: - return smooth_TRUECOLOR_z_triangle; + USE(smooth_TRUECOLOR_z_triangle); case PF_8A8B8G8R: - return smooth_8A8B8G8R_z_triangle; + USE(smooth_8A8B8G8R_z_triangle); case PF_8R8G8B: - return smooth_8R8G8B_z_triangle; + USE(smooth_8R8G8B_z_triangle); case PF_8R8G8B24: - return smooth_8R8G8B24_z_triangle; + USE(smooth_8R8G8B24_z_triangle); case PF_TRUEDITHER: - return smooth_TRUEDITHER_z_triangle; + USE(smooth_TRUEDITHER_z_triangle); case PF_5R6G5B: - return smooth_5R6G5B_z_triangle; + USE(smooth_5R6G5B_z_triangle); case PF_DITHER_5R6G5B: - return smooth_DITHER_5R6G5B_z_triangle; + USE(smooth_DITHER_5R6G5B_z_triangle); case PF_HPCR: - return smooth_HPCR_z_triangle; + USE(smooth_HPCR_z_triangle); case PF_DITHER: - return (depth==8) ? smooth_DITHER8_z_triangle - : smooth_DITHER_z_triangle; + if (depth == 8) + USE(smooth_DITHER8_z_triangle); + else + USE(smooth_DITHER_z_triangle); + break; case PF_LOOKUP: - return (depth==8) ? smooth_LOOKUP8_z_triangle : (swrast_tri_func)NULL; + if (depth == 8) + USE(smooth_LOOKUP8_z_triangle); + else + return (swrast_tri_func) NULL; default: - return (swrast_tri_func)NULL; + return (swrast_tri_func) NULL; } } if ( ctx->Light.ShadeModel==GL_FLAT && swrast->_RasterMask==DEPTH_BIT && ctx->Depth.Func==GL_LESS && ctx->Depth.Mask==GL_TRUE - && ctx->Visual.DepthBits == DEFAULT_SOFTWARE_DEPTH_BITS + && ctx->Visual.depthBits == DEFAULT_SOFTWARE_DEPTH_BITS && ctx->Polygon.StippleFlag==GL_FALSE) { switch (xmesa->pixelformat) { case PF_TRUECOLOR: - return flat_TRUECOLOR_z_triangle; + USE(flat_TRUECOLOR_z_triangle); case PF_8A8B8G8R: - return flat_8A8B8G8R_z_triangle; + USE(flat_8A8B8G8R_z_triangle); case PF_8R8G8B: - return flat_8R8G8B_z_triangle; + USE(flat_8R8G8B_z_triangle); case PF_8R8G8B24: - return flat_8R8G8B24_z_triangle; + USE(flat_8R8G8B24_z_triangle); case PF_TRUEDITHER: - return flat_TRUEDITHER_z_triangle; + USE(flat_TRUEDITHER_z_triangle); case PF_5R6G5B: - return flat_5R6G5B_z_triangle; + USE(flat_5R6G5B_z_triangle); case PF_DITHER_5R6G5B: - return flat_DITHER_5R6G5B_z_triangle; + USE(flat_DITHER_5R6G5B_z_triangle); case PF_HPCR: - return flat_HPCR_z_triangle; + USE(flat_HPCR_z_triangle); case PF_DITHER: - return (depth==8) ? flat_DITHER8_z_triangle - : flat_DITHER_z_triangle; + if (depth == 8) + USE(flat_DITHER8_z_triangle); + else + USE(flat_DITHER_z_triangle); + break; case PF_LOOKUP: - return (depth==8) ? flat_LOOKUP8_z_triangle : (swrast_tri_func)NULL; + if (depth == 8) + USE(flat_LOOKUP8_z_triangle); + else + return (swrast_tri_func) NULL; default: - return (swrast_tri_func)NULL; + return (swrast_tri_func) NULL; } } if ( swrast->_RasterMask==0 /* no depth test */ @@ -1585,28 +1620,34 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) && ctx->Polygon.StippleFlag==GL_FALSE) { switch (xmesa->pixelformat) { case PF_TRUECOLOR: - return smooth_TRUECOLOR_triangle; + USE(smooth_TRUECOLOR_triangle); case PF_8A8B8G8R: - return smooth_8A8B8G8R_triangle; + USE(smooth_8A8B8G8R_triangle); case PF_8R8G8B: - return smooth_8R8G8B_triangle; + USE(smooth_8R8G8B_triangle); case PF_8R8G8B24: - return smooth_8R8G8B24_triangle; + USE(smooth_8R8G8B24_triangle); case PF_TRUEDITHER: - return smooth_TRUEDITHER_triangle; + USE(smooth_TRUEDITHER_triangle); case PF_5R6G5B: - return smooth_5R6G5B_triangle; + USE(smooth_5R6G5B_triangle); case PF_DITHER_5R6G5B: - return smooth_DITHER_5R6G5B_triangle; + USE(smooth_DITHER_5R6G5B_triangle); case PF_HPCR: - return smooth_HPCR_triangle; + USE(smooth_HPCR_triangle); case PF_DITHER: - return (depth==8) ? smooth_DITHER8_triangle - : smooth_DITHER_triangle; + if (depth == 8) + USE(smooth_DITHER8_triangle); + else + USE(smooth_DITHER_triangle); + break; case PF_LOOKUP: - return (depth==8) ? smooth_LOOKUP8_triangle : (swrast_tri_func)NULL; + if (depth == 8) + USE(smooth_LOOKUP8_triangle); + else + return (swrast_tri_func) NULL; default: - return (swrast_tri_func)NULL; + return (swrast_tri_func) NULL; } } @@ -1615,32 +1656,38 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx ) && ctx->Polygon.StippleFlag==GL_FALSE) { switch (xmesa->pixelformat) { case PF_TRUECOLOR: - return flat_TRUECOLOR_triangle; + USE(flat_TRUECOLOR_triangle); case PF_TRUEDITHER: - return flat_TRUEDITHER_triangle; + USE(flat_TRUEDITHER_triangle); case PF_8A8B8G8R: - return flat_8A8B8G8R_triangle; + USE(flat_8A8B8G8R_triangle); case PF_8R8G8B: - return flat_8R8G8B_triangle; + USE(flat_8R8G8B_triangle); case PF_8R8G8B24: - return flat_8R8G8B24_triangle; + USE(flat_8R8G8B24_triangle); case PF_5R6G5B: - return flat_5R6G5B_triangle; + USE(flat_5R6G5B_triangle); case PF_DITHER_5R6G5B: - return flat_DITHER_5R6G5B_triangle; + USE(flat_DITHER_5R6G5B_triangle); case PF_HPCR: - return flat_HPCR_triangle; + USE(flat_HPCR_triangle); case PF_DITHER: - return (depth==8) ? flat_DITHER8_triangle - : flat_DITHER_triangle; + if (depth == 8) + USE(flat_DITHER8_triangle); + else + USE(flat_DITHER_triangle); + break; case PF_LOOKUP: - return (depth==8) ? flat_LOOKUP8_triangle : (swrast_tri_func)NULL; + if (depth == 8) + USE(flat_LOOKUP8_triangle); + else + return (swrast_tri_func) NULL; default: - return (swrast_tri_func)NULL; + return (swrast_tri_func) NULL; } } - return (swrast_tri_func)NULL; + return (swrast_tri_func) NULL; } else { /* draw to pixmap */ diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index e8f9ca9f92a..1d8d810a395 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -1,4 +1,4 @@ -/* $Id: accum.c,v 1.33 2000/12/26 05:09:27 keithw Exp $ */ +/* $Id: accum.c,v 1.34 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -69,7 +69,7 @@ _mesa_Accum( GLenum op, GLfloat value ) GLuint xpos, ypos, width, height; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (ctx->Visual.AccumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) { + if (ctx->Visual.accumRedBits == 0 || ctx->DrawBuffer != ctx->ReadBuffer) { gl_error(ctx, GL_INVALID_OPERATION, "glAccum"); return; } diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 6158a64869c..e669ff11d59 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -1,10 +1,10 @@ -/* $Id: attrib.c,v 1.39 2000/12/26 05:09:27 keithw Exp $ */ +/* $Id: attrib.c,v 1.40 2001/01/23 23:39:36 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"), @@ -588,7 +588,7 @@ _mesa_PopAttrib(void) ctx->Driver.LogicOpcode) { ctx->Driver.LogicOpcode( ctx, ctx->Color.LogicOp ); } - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF); GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF); GLchan b = (GLint) (ctx->Color.ClearColor[2] * CHAN_MAXF); diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index c67c8e865ec..410524e3352 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -1,10 +1,10 @@ -/* $Id: buffers.c,v 1.22 2001/01/05 02:26:48 keithw Exp $ */ +/* $Id: buffers.c,v 1.23 2001/01/23 23:39:36 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"), @@ -58,7 +58,7 @@ _mesa_ClearIndex( GLfloat c ) FLUSH_VERTICES(ctx, _NEW_COLOR); ctx->Color.ClearIndex = (GLuint) c; - if (!ctx->Visual.RGBAflag) { + if (!ctx->Visual.rgbMode) { /* it's OK to call glClearIndex in RGBA mode but it should be a NOP */ (*ctx->Driver.ClearIndex)( ctx, ctx->Color.ClearIndex ); } @@ -85,7 +85,7 @@ _mesa_ClearColor( GLclampf red, GLclampf green, FLUSH_VERTICES(ctx, _NEW_COLOR); COPY_4FV( ctx->Color.ClearColor, tmp ); - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { GLchan r = (GLint) (ctx->Color.ClearColor[0] * CHAN_MAXF); GLchan g = (GLint) (ctx->Color.ClearColor[1] * CHAN_MAXF); GLchan b = (GLint) (ctx->Color.ClearColor[2] * CHAN_MAXF); @@ -175,63 +175,63 @@ _mesa_DrawBuffer( GLenum mode ) gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; case GL_RIGHT: - if (!ctx->Visual.StereoFlag) { + if (!ctx->Visual.stereoMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return;} - if (ctx->Visual.DBflag) + if (ctx->Visual.doubleBufferMode) ctx->Color.DrawDestMask = FRONT_RIGHT_BIT | BACK_RIGHT_BIT; else ctx->Color.DrawDestMask = FRONT_RIGHT_BIT; break; case GL_FRONT_RIGHT: - if (!ctx->Visual.StereoFlag) { + if (!ctx->Visual.stereoMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; } ctx->Color.DrawDestMask = FRONT_RIGHT_BIT; break; case GL_BACK_RIGHT: - if (!ctx->Visual.StereoFlag) { + if (!ctx->Visual.stereoMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; } - if (!ctx->Visual.DBflag) { + if (!ctx->Visual.doubleBufferMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; } ctx->Color.DrawDestMask = BACK_RIGHT_BIT; break; case GL_BACK_LEFT: - if (!ctx->Visual.DBflag) { + if (!ctx->Visual.doubleBufferMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; } ctx->Color.DrawDestMask = BACK_LEFT_BIT; break; case GL_FRONT_AND_BACK: - if (!ctx->Visual.DBflag) { + if (!ctx->Visual.doubleBufferMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; } - if (ctx->Visual.StereoFlag) + if (ctx->Visual.stereoMode) ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT | FRONT_RIGHT_BIT | BACK_RIGHT_BIT; else ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT; break; case GL_BACK: - if (!ctx->Visual.DBflag) { + if (!ctx->Visual.doubleBufferMode) { gl_error( ctx, GL_INVALID_OPERATION, "glDrawBuffer" ); return; } - if (ctx->Visual.StereoFlag) + if (ctx->Visual.stereoMode) ctx->Color.DrawDestMask = BACK_LEFT_BIT | BACK_RIGHT_BIT; else ctx->Color.DrawDestMask = BACK_LEFT_BIT; break; case GL_LEFT: /* never an error */ - if (ctx->Visual.DBflag) + if (ctx->Visual.doubleBufferMode) ctx->Color.DrawDestMask = FRONT_LEFT_BIT | BACK_LEFT_BIT; else ctx->Color.DrawDestMask = FRONT_LEFT_BIT; @@ -242,7 +242,7 @@ _mesa_DrawBuffer( GLenum mode ) break; case GL_FRONT: /* never an error */ - if (ctx->Visual.StereoFlag) + if (ctx->Visual.stereoMode) ctx->Color.DrawDestMask = FRONT_LEFT_BIT | FRONT_RIGHT_BIT; else ctx->Color.DrawDestMask = FRONT_LEFT_BIT; @@ -259,13 +259,13 @@ _mesa_DrawBuffer( GLenum mode ) /* * Make the dest buffer mode more precise if possible */ - if (mode == GL_LEFT && !ctx->Visual.DBflag) + if (mode == GL_LEFT && !ctx->Visual.doubleBufferMode) ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT; - else if (mode == GL_RIGHT && !ctx->Visual.DBflag) + else if (mode == GL_RIGHT && !ctx->Visual.doubleBufferMode) ctx->Color.DriverDrawBuffer = GL_FRONT_RIGHT; - else if (mode == GL_FRONT && !ctx->Visual.StereoFlag) + else if (mode == GL_FRONT && !ctx->Visual.stereoMode) ctx->Color.DriverDrawBuffer = GL_FRONT_LEFT; - else if (mode == GL_BACK && !ctx->Visual.StereoFlag) + else if (mode == GL_BACK && !ctx->Visual.stereoMode) ctx->Color.DriverDrawBuffer = GL_BACK_LEFT; else ctx->Color.DriverDrawBuffer = mode; @@ -335,7 +335,7 @@ _mesa_ReadBuffer( GLenum mode ) case GL_BACK: case GL_BACK_LEFT: /* Back-Left buffer, requires double buffering */ - if (!ctx->Visual.DBflag) { + if (!ctx->Visual.doubleBufferMode) { gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" ); return; } @@ -343,14 +343,14 @@ _mesa_ReadBuffer( GLenum mode ) break; case GL_FRONT_RIGHT: case GL_RIGHT: - if (!ctx->Visual.StereoFlag) { + if (!ctx->Visual.stereoMode) { gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" ); return; } ctx->Pixel.DriverReadBuffer = GL_FRONT_RIGHT; break; case GL_BACK_RIGHT: - if (!ctx->Visual.StereoFlag || !ctx->Visual.DBflag) { + if (!ctx->Visual.stereoMode || !ctx->Visual.doubleBufferMode) { gl_error( ctx, GL_INVALID_OPERATION, "glReadBuffer" ); return; } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 4b951c89f71..736d13a2e96 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1,10 +1,10 @@ -/* $Id: context.c,v 1.116 2001/01/08 04:09:41 keithw Exp $ */ +/* $Id: context.c,v 1.117 2001/01/23 23:39:36 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"), @@ -239,6 +239,8 @@ _mesa_initialize_visual( GLvisual *vis, GLint accumAlphaBits, GLint numSamples ) { + (void) numSamples; + assert(vis); /* This is to catch bad values from device drivers not updated for @@ -266,43 +268,21 @@ _mesa_initialize_visual( GLvisual *vis, return GL_FALSE; } - vis->RGBAflag = rgbFlag; - vis->DBflag = dbFlag; - vis->StereoFlag = stereoFlag; - vis->RedBits = redBits; - vis->GreenBits = greenBits; - vis->BlueBits = blueBits; - vis->AlphaBits = alphaBits; - - vis->IndexBits = indexBits; - vis->DepthBits = depthBits; - vis->AccumRedBits = (accumRedBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->AccumGreenBits = (accumGreenBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->AccumBlueBits = (accumBlueBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->AccumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0; - vis->StencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0; + vis->rgbMode = rgbFlag; + vis->doubleBufferMode = dbFlag; + vis->stereoMode = stereoFlag; + vis->redBits = redBits; + vis->greenBits = greenBits; + vis->blueBits = blueBits; + vis->alphaBits = alphaBits; - if (depthBits == 0) { - /* Special case. Even if we don't have a depth buffer we need - * good values for DepthMax for Z vertex transformation purposes - * and for per-fragment fog computation. - */ - vis->DepthMax = 1 << 16; - vis->DepthMaxF = (GLfloat) vis->DepthMax; - } - else if (depthBits < 32) { - vis->DepthMax = (1 << depthBits) - 1; - vis->DepthMaxF = (GLfloat) vis->DepthMax; - } - else { - /* Special case since shift values greater than or equal to the - * number of bits in the left hand expression's type are - * undefined. - */ - vis->DepthMax = 0xffffffff; - vis->DepthMaxF = (GLfloat) vis->DepthMax; - } - vis->MRD = 2.0; /* XXX temporary value */ + vis->indexBits = indexBits; + vis->depthBits = depthBits; + vis->accumRedBits = (accumRedBits > 0) ? (8 * sizeof(GLaccum)) : 0; + vis->accumGreenBits = (accumGreenBits > 0) ? (8 * sizeof(GLaccum)) : 0; + vis->accumBlueBits = (accumBlueBits > 0) ? (8 * sizeof(GLaccum)) : 0; + vis->accumAlphaBits = (accumAlphaBits > 0) ? (8 * sizeof(GLaccum)) : 0; + vis->stencilBits = (stencilBits > 0) ? (8 * sizeof(GLstencil)) : 0; return GL_TRUE; } @@ -367,20 +347,20 @@ _mesa_initialize_framebuffer( GLframebuffer *buffer, /* sanity checks */ if (softwareDepth ) { - assert(visual->DepthBits > 0); + assert(visual->depthBits > 0); } if (softwareStencil) { - assert(visual->StencilBits > 0); + assert(visual->stencilBits > 0); } if (softwareAccum) { - assert(visual->RGBAflag); - assert(visual->AccumRedBits > 0); - assert(visual->AccumGreenBits > 0); - assert(visual->AccumBlueBits > 0); + assert(visual->rgbMode); + assert(visual->accumRedBits > 0); + assert(visual->accumGreenBits > 0); + assert(visual->accumBlueBits > 0); } if (softwareAlpha) { - assert(visual->RGBAflag); - assert(visual->AlphaBits > 0); + assert(visual->rgbMode); + assert(visual->alphaBits > 0); } buffer->Visual = visual; @@ -1159,8 +1139,8 @@ init_attrib_groups( GLcontext *ctx ) #define Sz 10 #define Tz 14 - ctx->Viewport._WindowMap.m[Sz] = 0.5 * ctx->Visual.DepthMaxF; - ctx->Viewport._WindowMap.m[Tz] = 0.5 * ctx->Visual.DepthMaxF; + ctx->Viewport._WindowMap.m[Sz] = 0.5 * ctx->DepthMaxF; + ctx->Viewport._WindowMap.m[Tz] = 0.5 * ctx->DepthMaxF; #undef Sz #undef Tz @@ -1408,7 +1388,7 @@ _mesa_initialize_context( GLcontext *ctx, init_attrib_groups( ctx ); - if (visual->DBflag) { + if (visual->doubleBufferMode) { ctx->Color.DrawBuffer = GL_BACK; ctx->Color.DriverDrawBuffer = GL_BACK_LEFT; ctx->Color.DrawDestMask = BACK_LEFT_BIT; @@ -1461,6 +1441,29 @@ _mesa_initialize_context( GLcontext *ctx, ctx->ExecPrefersFloat = GL_FALSE; ctx->SavePrefersFloat = GL_FALSE; + /* Z buffer stuff */ + if (ctx->Visual.depthBits == 0) { + /* Special case. Even if we don't have a depth buffer we need + * good values for DepthMax for Z vertex transformation purposes + * and for per-fragment fog computation. + */ + ctx->DepthMax = 1 << 16; + ctx->DepthMaxF = (GLfloat) ctx->DepthMax; + } + else if (ctx->Visual.depthBits < 32) { + ctx->DepthMax = (1 << ctx->Visual.depthBits) - 1; + ctx->DepthMaxF = (GLfloat) ctx->DepthMax; + } + else { + /* Special case since shift values greater than or equal to the + * number of bits in the left hand expression's type are undefined. + */ + ctx->DepthMax = 0xffffffff; + ctx->DepthMaxF = (GLfloat) ctx->DepthMax; + } + ctx->MRD = 2.0; /* XXX temporary value */ + + #if defined(MESA_TRACE) ctx->TraceCtx = CALLOC( sizeof(trace_context_t) ); #if 0 diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 503bb9629c5..2530bcbdc4b 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,10 +1,10 @@ -/* $Id: dlist.c,v 1.61 2001/01/13 18:28:19 keithw Exp $ */ +/* $Id: dlist.c,v 1.62 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library * Version: 3.3 * - * 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"), @@ -2584,7 +2584,7 @@ static void save_PolygonOffset( GLfloat factor, GLfloat units ) static void save_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) { GET_CURRENT_CONTEXT(ctx); - save_PolygonOffset(factor, ctx->Visual.DepthMaxF * bias); + save_PolygonOffset(factor, ctx->DepthMaxF * bias); } diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index ca1cd5cf75f..dad03c356aa 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -1,4 +1,4 @@ -/* $Id: enable.c,v 1.39 2001/01/05 05:31:42 keithw Exp $ */ +/* $Id: enable.c,v 1.40 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -212,7 +212,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Polygon.CullFlag = state; break; case GL_DEPTH_TEST: - if (state && ctx->Visual.DepthBits==0) { + if (state && ctx->Visual.depthBits==0) { _mesa_warning(ctx,"glEnable(GL_DEPTH_TEST) but no depth buffer"); return; } @@ -481,7 +481,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) ctx->Texture.SharedPalette = state; break; case GL_STENCIL_TEST: - if (state && ctx->Visual.StencilBits==0) { + if (state && ctx->Visual.stencilBits==0) { _mesa_warning(ctx, "glEnable(GL_STENCIL_TEST) but no stencil buffer"); return; } @@ -497,7 +497,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE0_1D; if (state) newenabled |= TEXTURE0_1D; - if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled) + if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -509,7 +509,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE0_2D; if (state) newenabled |= TEXTURE0_2D; - if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled) + if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -521,7 +521,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) GLuint newenabled = texUnit->Enabled & ~TEXTURE0_3D; if (state) newenabled |= TEXTURE0_3D; - if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled) + if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; @@ -708,7 +708,7 @@ void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) gl_error(ctx, GL_INVALID_ENUM, state ? "glEnable" : "glDisable"); return; } - if (!ctx->Visual.RGBAflag || texUnit->Enabled == newenabled) + if (!ctx->Visual.rgbMode || texUnit->Enabled == newenabled) return; FLUSH_VERTICES(ctx, _NEW_TEXTURE); texUnit->Enabled = newenabled; diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index b67e8146c33..1ddd12f3203 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -1,10 +1,10 @@ -/* $Id: feedback.c,v 1.20 2001/01/14 06:14:21 keithw Exp $ */ +/* $Id: feedback.c,v 1.21 2001/01/23 23:39:36 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"), @@ -77,16 +77,16 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) break; case GL_3D_COLOR: ctx->Feedback._Mask = (FB_3D | - (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX)); + (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX)); break; case GL_3D_COLOR_TEXTURE: ctx->Feedback._Mask = (FB_3D | - (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX) | + (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) | FB_TEXTURE); break; case GL_4D_COLOR_TEXTURE: ctx->Feedback._Mask = (FB_3D | FB_4D | - (ctx->Visual.RGBAflag ? FB_COLOR : FB_INDEX) | + (ctx->Visual.rgbMode ? FB_COLOR : FB_INDEX) | FB_TEXTURE); break; default: diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index d3d562318e8..ecbb16f0433 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1,10 +1,10 @@ -/* $Id: get.c,v 1.49 2001/01/02 22:02:51 brianp Exp $ */ +/* $Id: get.c,v 1.50 2001/01/23 23:39:36 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"), @@ -105,16 +105,16 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) switch (pname) { case GL_ACCUM_RED_BITS: - *params = INT_TO_BOOL(ctx->Visual.AccumRedBits); + *params = INT_TO_BOOL(ctx->Visual.accumRedBits); break; case GL_ACCUM_GREEN_BITS: - *params = INT_TO_BOOL(ctx->Visual.AccumGreenBits); + *params = INT_TO_BOOL(ctx->Visual.accumGreenBits); break; case GL_ACCUM_BLUE_BITS: - *params = INT_TO_BOOL(ctx->Visual.AccumBlueBits); + *params = INT_TO_BOOL(ctx->Visual.accumBlueBits); break; case GL_ACCUM_ALPHA_BITS: - *params = INT_TO_BOOL(ctx->Visual.AccumAlphaBits); + *params = INT_TO_BOOL(ctx->Visual.accumAlphaBits); break; case GL_ACCUM_CLEAR_VALUE: params[0] = FLOAT_TO_BOOL(ctx->Accum.ClearColor[0]); @@ -126,7 +126,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(ctx->Pixel.AlphaBias); break; case GL_ALPHA_BITS: - *params = INT_TO_BOOL(ctx->Visual.AlphaBits); + *params = INT_TO_BOOL(ctx->Visual.alphaBits); break; case GL_ALPHA_SCALE: *params = FLOAT_TO_BOOL(ctx->Pixel.AlphaScale); @@ -183,7 +183,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(ctx->Pixel.BlueBias); break; case GL_BLUE_BITS: - *params = INT_TO_BOOL( ctx->Visual.BlueBits ); + *params = INT_TO_BOOL( ctx->Visual.blueBits ); break; case GL_BLUE_SCALE: *params = FLOAT_TO_BOOL(ctx->Pixel.BlueScale); @@ -281,7 +281,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(ctx->Pixel.DepthBias); break; case GL_DEPTH_BITS: - *params = INT_TO_BOOL(ctx->Visual.DepthBits); + *params = INT_TO_BOOL(ctx->Visual.depthBits); break; case GL_DEPTH_CLEAR_VALUE: *params = FLOAT_TO_BOOL(ctx->Depth.Clear); @@ -306,7 +306,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = ctx->Color.DitherFlag; break; case GL_DOUBLEBUFFER: - *params = ctx->Visual.DBflag; + *params = ctx->Visual.doubleBufferMode; break; case GL_DRAW_BUFFER: *params = ENUM_TO_BOOL(ctx->Color.DrawBuffer); @@ -355,7 +355,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(ctx->Pixel.GreenBias); break; case GL_GREEN_BITS: - *params = INT_TO_BOOL( ctx->Visual.GreenBits ); + *params = INT_TO_BOOL( ctx->Visual.greenBits ); break; case GL_GREEN_SCALE: *params = FLOAT_TO_BOOL(ctx->Pixel.GreenScale); @@ -370,13 +370,13 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) } break; case GL_INDEX_BITS: - *params = INT_TO_BOOL( ctx->Visual.IndexBits ); + *params = INT_TO_BOOL( ctx->Visual.indexBits ); break; case GL_INDEX_CLEAR_VALUE: *params = INT_TO_BOOL(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: - *params = ctx->Visual.RGBAflag ? GL_FALSE : GL_TRUE; + *params = ctx->Visual.rgbMode ? GL_FALSE : GL_TRUE; break; case GL_INDEX_OFFSET: *params = INT_TO_BOOL(ctx->Pixel.IndexOffset); @@ -735,7 +735,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = FLOAT_TO_BOOL(ctx->Pixel.RedBias); break; case GL_RED_BITS: - *params = INT_TO_BOOL( ctx->Visual.RedBits ); + *params = INT_TO_BOOL( ctx->Visual.redBits ); break; case GL_RED_SCALE: *params = FLOAT_TO_BOOL(ctx->Pixel.RedScale); @@ -747,7 +747,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = ctx->Transform.RescaleNormals; break; case GL_RGBA_MODE: - *params = ctx->Visual.RGBAflag; + *params = ctx->Visual.rgbMode; break; case GL_SCISSOR_BOX: params[0] = INT_TO_BOOL(ctx->Scissor.X); @@ -768,7 +768,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = ctx->Texture.SharedPalette; break; case GL_STENCIL_BITS: - *params = INT_TO_BOOL(ctx->Visual.StencilBits); + *params = INT_TO_BOOL(ctx->Visual.stencilBits); break; case GL_STENCIL_CLEAR_VALUE: *params = INT_TO_BOOL(ctx->Stencil.Clear); @@ -798,7 +798,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) *params = INT_TO_BOOL(ctx->Stencil.WriteMask); break; case GL_STEREO: - *params = ctx->Visual.StereoFlag; + *params = ctx->Visual.stereoMode; break; case GL_SUBPIXEL_BITS: *params = INT_TO_BOOL(ctx->Const.SubPixelBits); @@ -1343,16 +1343,16 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) switch (pname) { case GL_ACCUM_RED_BITS: - *params = (GLdouble) ctx->Visual.AccumRedBits; + *params = (GLdouble) ctx->Visual.accumRedBits; break; case GL_ACCUM_GREEN_BITS: - *params = (GLdouble) ctx->Visual.AccumGreenBits; + *params = (GLdouble) ctx->Visual.accumGreenBits; break; case GL_ACCUM_BLUE_BITS: - *params = (GLdouble) ctx->Visual.AccumBlueBits; + *params = (GLdouble) ctx->Visual.accumBlueBits; break; case GL_ACCUM_ALPHA_BITS: - *params = (GLdouble) ctx->Visual.AccumAlphaBits; + *params = (GLdouble) ctx->Visual.accumAlphaBits; break; case GL_ACCUM_CLEAR_VALUE: params[0] = (GLdouble) ctx->Accum.ClearColor[0]; @@ -1364,7 +1364,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Pixel.AlphaBias; break; case GL_ALPHA_BITS: - *params = (GLdouble) ctx->Visual.AlphaBits; + *params = (GLdouble) ctx->Visual.alphaBits; break; case GL_ALPHA_SCALE: *params = (GLdouble) ctx->Pixel.AlphaScale; @@ -1421,7 +1421,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Pixel.BlueBias; break; case GL_BLUE_BITS: - *params = (GLdouble) ctx->Visual.BlueBits; + *params = (GLdouble) ctx->Visual.blueBits; break; case GL_BLUE_SCALE: *params = (GLdouble) ctx->Pixel.BlueScale; @@ -1519,7 +1519,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Pixel.DepthBias; break; case GL_DEPTH_BITS: - *params = (GLdouble) ctx->Visual.DepthBits; + *params = (GLdouble) ctx->Visual.depthBits; break; case GL_DEPTH_CLEAR_VALUE: *params = (GLdouble) ctx->Depth.Clear; @@ -1544,7 +1544,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Color.DitherFlag; break; case GL_DOUBLEBUFFER: - *params = (GLdouble) ctx->Visual.DBflag; + *params = (GLdouble) ctx->Visual.doubleBufferMode; break; case GL_DRAW_BUFFER: *params = ENUM_TO_DOUBLE(ctx->Color.DrawBuffer); @@ -1593,7 +1593,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Pixel.GreenBias; break; case GL_GREEN_BITS: - *params = (GLdouble) ctx->Visual.GreenBits; + *params = (GLdouble) ctx->Visual.greenBits; break; case GL_GREEN_SCALE: *params = (GLdouble) ctx->Pixel.GreenScale; @@ -1608,13 +1608,13 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) } break; case GL_INDEX_BITS: - *params = (GLdouble) ctx->Visual.IndexBits; + *params = (GLdouble) ctx->Visual.indexBits; break; case GL_INDEX_CLEAR_VALUE: *params = (GLdouble) ctx->Color.ClearIndex; break; case GL_INDEX_MODE: - *params = ctx->Visual.RGBAflag ? 0.0 : 1.0; + *params = ctx->Visual.rgbMode ? 0.0 : 1.0; break; case GL_INDEX_OFFSET: *params = (GLdouble) ctx->Pixel.IndexOffset; @@ -1973,7 +1973,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Pixel.RedBias; break; case GL_RED_BITS: - *params = (GLdouble) ctx->Visual.RedBits; + *params = (GLdouble) ctx->Visual.redBits; break; case GL_RED_SCALE: *params = (GLdouble) ctx->Pixel.RedScale; @@ -1985,7 +1985,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Transform.RescaleNormals; break; case GL_RGBA_MODE: - *params = (GLdouble) ctx->Visual.RGBAflag; + *params = (GLdouble) ctx->Visual.rgbMode; break; case GL_SCISSOR_BOX: params[0] = (GLdouble) ctx->Scissor.X; @@ -2006,7 +2006,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Texture.SharedPalette; break; case GL_STENCIL_BITS: - *params = (GLdouble) ctx->Visual.StencilBits; + *params = (GLdouble) ctx->Visual.stencilBits; break; case GL_STENCIL_CLEAR_VALUE: *params = (GLdouble) ctx->Stencil.Clear; @@ -2036,7 +2036,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) *params = (GLdouble) ctx->Stencil.WriteMask; break; case GL_STEREO: - *params = (GLdouble) ctx->Visual.StereoFlag; + *params = (GLdouble) ctx->Visual.stereoMode; break; case GL_SUBPIXEL_BITS: *params = (GLdouble) ctx->Const.SubPixelBits; @@ -2581,16 +2581,16 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) switch (pname) { case GL_ACCUM_RED_BITS: - *params = (GLfloat) ctx->Visual.AccumRedBits; + *params = (GLfloat) ctx->Visual.accumRedBits; break; case GL_ACCUM_GREEN_BITS: - *params = (GLfloat) ctx->Visual.AccumGreenBits; + *params = (GLfloat) ctx->Visual.accumGreenBits; break; case GL_ACCUM_BLUE_BITS: - *params = (GLfloat) ctx->Visual.AccumBlueBits; + *params = (GLfloat) ctx->Visual.accumBlueBits; break; case GL_ACCUM_ALPHA_BITS: - *params = (GLfloat) ctx->Visual.AccumAlphaBits; + *params = (GLfloat) ctx->Visual.accumAlphaBits; break; case GL_ACCUM_CLEAR_VALUE: params[0] = ctx->Accum.ClearColor[0]; @@ -2602,7 +2602,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = ctx->Pixel.AlphaBias; break; case GL_ALPHA_BITS: - *params = (GLfloat) ctx->Visual.AlphaBits; + *params = (GLfloat) ctx->Visual.alphaBits; break; case GL_ALPHA_SCALE: *params = ctx->Pixel.AlphaScale; @@ -2659,7 +2659,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = ctx->Pixel.BlueBias; break; case GL_BLUE_BITS: - *params = (GLfloat) ctx->Visual.BlueBits; + *params = (GLfloat) ctx->Visual.blueBits; break; case GL_BLUE_SCALE: *params = ctx->Pixel.BlueScale; @@ -2757,7 +2757,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Pixel.DepthBias; break; case GL_DEPTH_BITS: - *params = (GLfloat) ctx->Visual.DepthBits; + *params = (GLfloat) ctx->Visual.depthBits; break; case GL_DEPTH_CLEAR_VALUE: *params = (GLfloat) ctx->Depth.Clear; @@ -2782,7 +2782,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Color.DitherFlag; break; case GL_DOUBLEBUFFER: - *params = (GLfloat) ctx->Visual.DBflag; + *params = (GLfloat) ctx->Visual.doubleBufferMode; break; case GL_DRAW_BUFFER: *params = ENUM_TO_FLOAT(ctx->Color.DrawBuffer); @@ -2831,7 +2831,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Pixel.GreenBias; break; case GL_GREEN_BITS: - *params = (GLfloat) ctx->Visual.GreenBits; + *params = (GLfloat) ctx->Visual.greenBits; break; case GL_GREEN_SCALE: *params = (GLfloat) ctx->Pixel.GreenScale; @@ -2846,13 +2846,13 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) } break; case GL_INDEX_BITS: - *params = (GLfloat) ctx->Visual.IndexBits; + *params = (GLfloat) ctx->Visual.indexBits; break; case GL_INDEX_CLEAR_VALUE: *params = (GLfloat) ctx->Color.ClearIndex; break; case GL_INDEX_MODE: - *params = ctx->Visual.RGBAflag ? 0.0F : 1.0F; + *params = ctx->Visual.rgbMode ? 0.0F : 1.0F; break; case GL_INDEX_OFFSET: *params = (GLfloat) ctx->Pixel.IndexOffset; @@ -3213,7 +3213,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = ctx->Pixel.RedBias; break; case GL_RED_BITS: - *params = (GLfloat) ctx->Visual.RedBits; + *params = (GLfloat) ctx->Visual.redBits; break; case GL_RED_SCALE: *params = ctx->Pixel.RedScale; @@ -3225,7 +3225,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Transform.RescaleNormals; break; case GL_RGBA_MODE: - *params = (GLfloat) ctx->Visual.RGBAflag; + *params = (GLfloat) ctx->Visual.rgbMode; break; case GL_SCISSOR_BOX: params[0] = (GLfloat) ctx->Scissor.X; @@ -3246,7 +3246,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Texture.SharedPalette; break; case GL_STENCIL_BITS: - *params = (GLfloat) ctx->Visual.StencilBits; + *params = (GLfloat) ctx->Visual.stencilBits; break; case GL_STENCIL_CLEAR_VALUE: *params = (GLfloat) ctx->Stencil.Clear; @@ -3276,7 +3276,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) *params = (GLfloat) ctx->Stencil.WriteMask; break; case GL_STEREO: - *params = (GLfloat) ctx->Visual.StereoFlag; + *params = (GLfloat) ctx->Visual.stereoMode; break; case GL_SUBPIXEL_BITS: *params = (GLfloat) ctx->Const.SubPixelBits; @@ -3794,16 +3794,16 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) switch (pname) { case GL_ACCUM_RED_BITS: - *params = (GLint) ctx->Visual.AccumRedBits; + *params = (GLint) ctx->Visual.accumRedBits; break; case GL_ACCUM_GREEN_BITS: - *params = (GLint) ctx->Visual.AccumGreenBits; + *params = (GLint) ctx->Visual.accumGreenBits; break; case GL_ACCUM_BLUE_BITS: - *params = (GLint) ctx->Visual.AccumBlueBits; + *params = (GLint) ctx->Visual.accumBlueBits; break; case GL_ACCUM_ALPHA_BITS: - *params = (GLint) ctx->Visual.AccumAlphaBits; + *params = (GLint) ctx->Visual.accumAlphaBits; break; case GL_ACCUM_CLEAR_VALUE: params[0] = FLOAT_TO_INT( ctx->Accum.ClearColor[0] ); @@ -3815,7 +3815,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Pixel.AlphaBias; break; case GL_ALPHA_BITS: - *params = ctx->Visual.AlphaBits; + *params = ctx->Visual.alphaBits; break; case GL_ALPHA_SCALE: *params = (GLint) ctx->Pixel.AlphaScale; @@ -3872,7 +3872,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Pixel.BlueBias; break; case GL_BLUE_BITS: - *params = (GLint) ctx->Visual.BlueBits; + *params = (GLint) ctx->Visual.blueBits; break; case GL_BLUE_SCALE: *params = (GLint) ctx->Pixel.BlueScale; @@ -3971,7 +3971,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Pixel.DepthBias; break; case GL_DEPTH_BITS: - *params = ctx->Visual.DepthBits; + *params = ctx->Visual.depthBits; break; case GL_DEPTH_CLEAR_VALUE: *params = (GLint) ctx->Depth.Clear; @@ -3996,7 +3996,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Color.DitherFlag; break; case GL_DOUBLEBUFFER: - *params = (GLint) ctx->Visual.DBflag; + *params = (GLint) ctx->Visual.doubleBufferMode; break; case GL_DRAW_BUFFER: *params = (GLint) ctx->Color.DrawBuffer; @@ -4045,7 +4045,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Pixel.GreenBias; break; case GL_GREEN_BITS: - *params = (GLint) ctx->Visual.GreenBits; + *params = (GLint) ctx->Visual.greenBits; break; case GL_GREEN_SCALE: *params = (GLint) ctx->Pixel.GreenScale; @@ -4060,13 +4060,13 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) } break; case GL_INDEX_BITS: - *params = (GLint) ctx->Visual.IndexBits; + *params = (GLint) ctx->Visual.indexBits; break; case GL_INDEX_CLEAR_VALUE: *params = (GLint) ctx->Color.ClearIndex; break; case GL_INDEX_MODE: - *params = ctx->Visual.RGBAflag ? 0 : 1; + *params = ctx->Visual.rgbMode ? 0 : 1; break; case GL_INDEX_OFFSET: *params = ctx->Pixel.IndexOffset; @@ -4425,7 +4425,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Pixel.RedBias; break; case GL_RED_BITS: - *params = (GLint) ctx->Visual.RedBits; + *params = (GLint) ctx->Visual.redBits; break; case GL_RED_SCALE: *params = (GLint) ctx->Pixel.RedScale; @@ -4437,7 +4437,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Transform.RescaleNormals; break; case GL_RGBA_MODE: - *params = (GLint) ctx->Visual.RGBAflag; + *params = (GLint) ctx->Visual.rgbMode; break; case GL_SCISSOR_BOX: params[0] = (GLint) ctx->Scissor.X; @@ -4458,7 +4458,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Texture.SharedPalette; break; case GL_STENCIL_BITS: - *params = ctx->Visual.StencilBits; + *params = ctx->Visual.stencilBits; break; case GL_STENCIL_CLEAR_VALUE: *params = (GLint) ctx->Stencil.Clear; @@ -4488,7 +4488,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) *params = (GLint) ctx->Stencil.WriteMask; break; case GL_STEREO: - *params = (GLint) ctx->Visual.StereoFlag; + *params = (GLint) ctx->Visual.stereoMode; break; case GL_SUBPIXEL_BITS: *params = ctx->Const.SubPixelBits; diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index de56f0be9d0..dfb43c153dc 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -1,4 +1,4 @@ -/* $Id: image.c,v 1.52 2001/01/03 15:59:30 brianp Exp $ */ +/* $Id: image.c,v 1.53 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -2506,7 +2506,7 @@ _mesa_unpack_chan_color_span( GLcontext *ctx, srcType == GL_UNSIGNED_INT_2_10_10_10_REV); /* this is intended for RGBA mode only */ - assert(ctx->Visual.RGBAflag); + assert(ctx->Visual.rgbMode); /* Try simple cases first */ if (transferOps == 0 && srcType == CHAN_TYPE) { @@ -2830,7 +2830,7 @@ _mesa_unpack_float_color_span( GLcontext *ctx, srcType == GL_UNSIGNED_INT_2_10_10_10_REV); /* this is intended for RGBA mode only */ - assert(ctx->Visual.RGBAflag); + assert(ctx->Visual.rgbMode); /* general solution, no special cases, yet */ { @@ -3342,7 +3342,7 @@ _mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, /* clamp depth values to [0,1] and convert from floats to integers */ { - const GLfloat zs = ctx->Visual.DepthMaxF; + const GLfloat zs = ctx->DepthMaxF; GLuint i; for (i = 0; i < n; i++) { dest[i] = (GLdepth) (CLAMP(depth[i], 0.0F, 1.0F) * zs); diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index bee9f0d807b..fd58399962f 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -1,4 +1,4 @@ -/* $Id: light.c,v 1.34 2001/01/13 05:48:25 keithw Exp $ */ +/* $Id: light.c,v 1.35 2001/01/23 23:39:36 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -1163,7 +1163,7 @@ gl_update_lighting( GLcontext *ctx ) * FLUSH_UPDATE_CURRENT, as when any outstanding material changes * are flushed, they will update the derived state at that time. */ - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { GLuint sides = ctx->Light.Model.TwoSide ? 2 : 1; GLuint side; for (side=0; side < sides; side++) { diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index 2cd471f4e25..f7aea3f4c21 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1,10 +1,10 @@ -/* $Id: matrix.c,v 1.29 2000/12/26 05:09:29 keithw Exp $ */ +/* $Id: matrix.c,v 1.30 2001/01/23 23:39:36 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"), @@ -478,8 +478,8 @@ gl_Viewport( GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height ) ctx->Viewport._WindowMap.m[MAT_TX] = ctx->Viewport._WindowMap.m[MAT_SX] + x; ctx->Viewport._WindowMap.m[MAT_SY] = (GLfloat) height / 2.0F; ctx->Viewport._WindowMap.m[MAT_TY] = ctx->Viewport._WindowMap.m[MAT_SY] + y; - ctx->Viewport._WindowMap.m[MAT_SZ] = 0.5 * ctx->Visual.DepthMaxF; - ctx->Viewport._WindowMap.m[MAT_TZ] = 0.5 * ctx->Visual.DepthMaxF; + ctx->Viewport._WindowMap.m[MAT_SZ] = 0.5 * ctx->DepthMaxF; + ctx->Viewport._WindowMap.m[MAT_TZ] = 0.5 * ctx->DepthMaxF; ctx->Viewport._WindowMap.flags = MAT_FLAG_GENERAL_SCALE|MAT_FLAG_TRANSLATION; ctx->Viewport._WindowMap.type = MATRIX_3D_NO_ROT; ctx->NewState |= _NEW_VIEWPORT; @@ -522,8 +522,8 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval ) ctx->Viewport.Near = n; ctx->Viewport.Far = f; - ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0); - ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->Visual.DepthMaxF * ((f - n) / 2.0 + n); + ctx->Viewport._WindowMap.m[MAT_SZ] = ctx->DepthMaxF * ((f - n) / 2.0); + ctx->Viewport._WindowMap.m[MAT_TZ] = ctx->DepthMaxF * ((f - n) / 2.0 + n); ctx->NewState |= _NEW_VIEWPORT; if (ctx->Driver.DepthRange) { diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f3a3a56b0a3..66d085ba816 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,10 +1,10 @@ -/* $Id: mtypes.h,v 1.13 2001/01/08 21:55:59 keithw Exp $ */ +/* $Id: mtypes.h,v 1.14 2001/01/23 23:39:36 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"), @@ -117,9 +117,9 @@ typedef int GLfixed; */ struct _mesa_HashTable; struct gl_texture_object; -typedef struct gl_visual GLvisual; -typedef struct gl_frame_buffer GLframebuffer; typedef struct __GLcontextRec GLcontext; +typedef struct __GLcontextModesRec GLvisual; +typedef struct gl_frame_buffer GLframebuffer; @@ -1098,38 +1098,6 @@ struct gl_shared_state { -/* - * Describes the color, depth, stencil and accum buffer parameters. - * In C++ terms, think of this as a base class from which device drivers - * will make derived classes. - */ -struct gl_visual { - GLboolean RGBAflag; /* Is frame buffer in RGBA mode, not CI? */ - GLboolean DBflag; /* Is color buffer double buffered? */ - GLboolean StereoFlag; /* stereo buffer? */ - - GLint RedBits; /* Bits per color component */ - GLint GreenBits; - GLint BlueBits; - GLint AlphaBits; - - GLint IndexBits; /* Bits/pixel if in color index mode */ - - GLint AccumRedBits; /* Number of bits in red accum channel */ - GLint AccumGreenBits; /* Number of bits in green accum channel */ - GLint AccumBlueBits; /* Number of bits in blue accum channel */ - GLint AccumAlphaBits; /* Number of bits in alpha accum channel */ - GLint DepthBits; /* Number of bits in depth buffer, or 0 */ - GLint StencilBits; /* Number of bits in stencil buffer, or 0 */ - GLint NumSamples; /* Samples/pixel for multisampling */ - - GLuint DepthMax; /* Max depth buffer value */ - GLfloat DepthMaxF; /* Float max depth buffer value */ - GLfloat MRD; /* minimum resolvable difference in Z values */ -}; - - - /* * A "frame buffer" is a color buffer and its optional ancillary buffers: * depth, accum, stencil, and software-simulated alpha buffers. @@ -1566,6 +1534,11 @@ struct __GLcontextRec { GLboolean OcclusionResult; /* GL_HP_occlusion_test */ GLboolean OcclusionResultSaved; /* GL_HP_occlusion_test */ + /* Z buffer stuff */ + GLuint DepthMax; /* Max depth buffer value */ + GLfloat DepthMaxF; /* Float max depth buffer value */ + GLfloat MRD; /* minimum resolvable difference in Z values */ + /* Should 3Dfx Glide driver catch signals? */ GLboolean CatchSignals; diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index 270cbc7e8cb..470a2f8e157 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -1,10 +1,10 @@ -/* $Id: pixel.c,v 1.23 2001/01/03 15:59:30 brianp Exp $ */ +/* $Id: pixel.c,v 1.24 2001/01/23 23:39:36 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"), @@ -1254,19 +1254,19 @@ void _mesa_chan_to_float_span(const GLcontext *ctx, GLuint n, CONST GLchan rgba[][4], GLfloat rgbaf[][4]) { - const GLuint rShift = CHAN_BITS - ctx->Visual.RedBits; - const GLuint gShift = CHAN_BITS - ctx->Visual.GreenBits; - const GLuint bShift = CHAN_BITS - ctx->Visual.BlueBits; + const GLuint rShift = CHAN_BITS - ctx->Visual.redBits; + const GLuint gShift = CHAN_BITS - ctx->Visual.greenBits; + const GLuint bShift = CHAN_BITS - ctx->Visual.blueBits; GLuint aShift; - const GLfloat rScale = 1.0 / (GLfloat) ((1 << ctx->Visual.RedBits ) - 1); - const GLfloat gScale = 1.0 / (GLfloat) ((1 << ctx->Visual.GreenBits) - 1); - const GLfloat bScale = 1.0 / (GLfloat) ((1 << ctx->Visual.BlueBits ) - 1); + const GLfloat rScale = 1.0 / (GLfloat) ((1 << ctx->Visual.redBits ) - 1); + const GLfloat gScale = 1.0 / (GLfloat) ((1 << ctx->Visual.greenBits) - 1); + const GLfloat bScale = 1.0 / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1); GLfloat aScale; GLuint i; - if (ctx->Visual.AlphaBits > 0) { - aShift = CHAN_BITS - ctx->Visual.AlphaBits; - aScale = 1.0 / (GLfloat) ((1 << ctx->Visual.AlphaBits) - 1); + if (ctx->Visual.alphaBits > 0) { + aShift = CHAN_BITS - ctx->Visual.alphaBits; + aScale = 1.0 / (GLfloat) ((1 << ctx->Visual.alphaBits) - 1); } else { aShift = 0; diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c index 68bcbbe3b80..a0d103f9040 100644 --- a/src/mesa/main/polygon.c +++ b/src/mesa/main/polygon.c @@ -1,10 +1,10 @@ -/* $Id: polygon.c,v 1.17 2000/12/26 05:09:29 keithw Exp $ */ +/* $Id: polygon.c,v 1.18 2001/01/23 23:39:36 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"), @@ -195,7 +195,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units ) FLUSH_VERTICES(ctx, _NEW_POLYGON); ctx->Polygon.OffsetFactor = factor; ctx->Polygon.OffsetUnits = units; - ctx->Polygon.OffsetMRD = units * ctx->Visual.MRD; + ctx->Polygon.OffsetMRD = units * ctx->MRD; } @@ -204,5 +204,5 @@ void _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) { GET_CURRENT_CONTEXT(ctx); - _mesa_PolygonOffset(factor, bias * ctx->Visual.DepthMaxF ); + _mesa_PolygonOffset(factor, bias * ctx->DepthMaxF ); } diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index badd3e7b371..c2f2226c4d9 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -1,10 +1,10 @@ -/* $Id: rastpos.c,v 1.19 2001/01/03 15:56:41 brianp Exp $ */ +/* $Id: rastpos.c,v 1.20 2001/01/23 23:39:36 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"), @@ -215,7 +215,7 @@ shade_rastpos(GLcontext *ctx, ACC_SCALE_SCALAR_3V( color, attenuation, contrib ); } - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { Rcolor[0] = CLAMP(color[0], 0.0F, 1.0F); Rcolor[1] = CLAMP(color[1], 0.0F, 1.0F); Rcolor[2] = CLAMP(color[2], 0.0F, 1.0F); @@ -273,7 +273,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) } else { /* use current color or index */ - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { ctx->Current.RasterColor[0] = CHAN_TO_FLOAT(ctx->Current.Color[0]); ctx->Current.RasterColor[1] = CHAN_TO_FLOAT(ctx->Current.Color[1]); ctx->Current.RasterColor[2] = CHAN_TO_FLOAT(ctx->Current.Color[2]); @@ -316,7 +316,7 @@ raster_pos4f(GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) ctx->Current.RasterPos[1] = (ndc[1] * ctx->Viewport._WindowMap.m[MAT_SY] + ctx->Viewport._WindowMap.m[MAT_TY]); ctx->Current.RasterPos[2] = (ndc[2] * ctx->Viewport._WindowMap.m[MAT_SZ] + - ctx->Viewport._WindowMap.m[MAT_TZ]) / ctx->Visual.DepthMaxF; + ctx->Viewport._WindowMap.m[MAT_TZ]) / ctx->DepthMaxF; ctx->Current.RasterPos[3] = clip[3]; ctx->Current.RasterPosValid = GL_TRUE; diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 040dc15b61b..ac368aa85b8 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 090d5b6a81e..219798d8c9e 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 dd47e198abc..a70cab0364a 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 11b782e7879..0da11a5f250 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 c5f4127c2e2..ffeb268e7eb 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 c0564e0b6a5..46ffe8cc90c 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 d02ef224423..ca7cbfd8458 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 401b448a630..401955d00ae 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;iDepth.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;iPixel.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 1199f67dd88..92a5a12de1a 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 766749e811f..757f1ab0717 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_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;iVisual.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 c63e11d17b3..fa670d16397 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 da8b2db180e..d448bd59e4e 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 2035c96dda2..8de9f8ee9dd 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 ecad3efe7cc..bb5de30975b 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 4cc3dbd6181..2dc739a103e 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;jVisual.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 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 2a60c7a4dbb..8ce6c0ae5a3 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 b61d4401e1b..aac7c6030ec 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 7abb933f6cb..e139f3fc9f9 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; diff --git a/src/mesa/swrast_setup/ss_triangle.c b/src/mesa/swrast_setup/ss_triangle.c index 337a45acc53..3ed8c97fb6a 100644 --- a/src/mesa/swrast_setup/ss_triangle.c +++ b/src/mesa/swrast_setup/ss_triangle.c @@ -271,7 +271,7 @@ void _swsetup_choose_trifuncs( GLcontext *ctx ) if (ctx->_TriangleCaps & DD_TRI_UNFILLED) ind |= SS_UNFILLED_BIT; - if (ctx->Visual.RGBAflag) + if (ctx->Visual.rgbMode) ind |= SS_RGBA_BIT; swsetup->Triangle = tri_tab[ind]; diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index cc0c511c35c..6064bbb5e02 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -95,6 +95,8 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (bc < 0.0f) bc = -bc; offset += MAX2(ac, bc) * ctx->Polygon.OffsetFactor; } + offset *= ctx->MRD; + /*printf("offset %g\n", offset);*/ } } diff --git a/src/mesa/swrast_setup/ss_vb.c b/src/mesa/swrast_setup/ss_vb.c index d2cfc6a4f98..266a9dfca49 100644 --- a/src/mesa/swrast_setup/ss_vb.c +++ b/src/mesa/swrast_setup/ss_vb.c @@ -2,7 +2,7 @@ * Mesa 3-D graphics library * 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"), @@ -264,7 +264,7 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx) int funcindex = 0; if (ctx->RenderMode == GL_RENDER) { - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { funcindex = COLOR; if (ctx->Texture._ReallyEnabled & ~0xf) @@ -287,7 +287,7 @@ _swsetup_choose_rastersetup_func(GLcontext *ctx) funcindex |= FOG; } else if (ctx->RenderMode == GL_FEEDBACK) { - if (ctx->Visual.RGBAflag) + if (ctx->Visual.rgbMode) funcindex = (COLOR | TEX0); /* is feedback color subject to fogging? */ else funcindex = (INDEX | TEX0); diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 48c8e093137..60a87ef8abd 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,10 +1,10 @@ -/* $Id: t_vb_light.c,v 1.3 2001/01/08 04:09:42 keithw Exp $ */ +/* $Id: t_vb_light.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"), @@ -161,7 +161,7 @@ static GLboolean run_validate_lighting( GLcontext *ctx, GLuint ind = 0; light_func *tab; - if (ctx->Visual.RGBAflag) { + if (ctx->Visual.rgbMode) { if (ctx->Light._NeedVertices) { if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) tab = _tnl_light_spec_tab; diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c index 02d97f46d2d..68bb3aa6432 100644 --- a/src/mesa/tnl/t_vb_render.c +++ b/src/mesa/tnl/t_vb_render.c @@ -1,10 +1,10 @@ -/* $Id: t_vb_render.c,v 1.10 2001/01/16 05:29:43 keithw Exp $ */ +/* $Id: t_vb_render.c,v 1.11 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"), @@ -635,8 +635,7 @@ static void check_render( GLcontext *ctx, struct gl_pipeline_stage *stage ) GLuint inputs = VERT_CLIP; GLuint i; - if (ctx->Visual.RGBAflag) - { + if (ctx->Visual.rgbMode) { interp |= INTERP_RGBA; inputs |= VERT_RGBA; -- 2.30.2