From 2fd9c8690fa86b17c42afcc73307d2232b8f79f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 4 Jan 2001 15:32:10 +0000 Subject: [PATCH] changed some point functions, new picking code --- src/mesa/swrast/s_points.c | 138 ++++++++++++++++++++++--------------- 1 file changed, 81 insertions(+), 57 deletions(-) diff --git a/src/mesa/swrast/s_points.c b/src/mesa/swrast/s_points.c index 33b11e5d5ce..ecad3efe7cc 100644 --- a/src/mesa/swrast/s_points.c +++ b/src/mesa/swrast/s_points.c @@ -1,4 +1,4 @@ -/* $Id: s_points.c,v 1.10 2001/01/03 22:17:16 brianp Exp $ */ +/* $Id: s_points.c,v 1.11 2001/01/04 15:32:10 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -57,58 +57,66 @@ /* - * RGBA points with size == 1.0 + * General CI points. */ -#define FLAGS (RGBA) -#define NAME size1_rgba_point +#define FLAGS (INDEX | LARGE) +#define NAME general_ci_point #include "s_pointtemp.h" /* - * General CI points. + * Antialiased CI points. */ -#define FLAGS (INDEX | LARGE) -#define NAME general_ci_point +#define FLAGS (INDEX | SMOOTH) +#define NAME antialiased_ci_point #include "s_pointtemp.h" /* - * General RGBA points. + * Distance attenuated, general CI points. */ -#define FLAGS (RGBA | LARGE) -#define NAME general_rgba_point +#define FLAGS (INDEX | ATTENUATE) +#define NAME atten_general_ci_point #include "s_pointtemp.h" /* - * Textured RGBA points. + * RGBA points with size == 1.0 */ -#define FLAGS (RGBA | LARGE | TEXTURE) -#define NAME textured_rgba_point +#define FLAGS (RGBA) +#define NAME size1_rgba_point #include "s_pointtemp.h" /* - * Multitextured RGBA points. + * General RGBA points. */ -#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR) -#define NAME multitextured_rgba_point +#define FLAGS (RGBA | LARGE) +#define NAME general_rgba_point #include "s_pointtemp.h" /* - * Antialiased points with or without texture mapping. + * Antialiased RGBA points. */ -#define FLAGS (RGBA | SMOOTH | TEXTURE) +#define FLAGS (RGBA | SMOOTH) #define NAME antialiased_rgba_point #include "s_pointtemp.h" /* - * Distance attenuated, general CI points. + * Textured RGBA points. */ -#define FLAGS (INDEX | ATTENUATE) -#define NAME atten_general_ci_point +#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR) +#define NAME textured_rgba_point +#include "s_pointtemp.h" + + +/* + * Antialiased points with texture mapping. + */ +#define FLAGS (RGBA | SMOOTH | TEXTURE | SPECULAR) +#define NAME antialiased_tex_rgba_point #include "s_pointtemp.h" @@ -121,15 +129,15 @@ /* - * Distance attenuated, Textured RGBA points. + * Distance attenuated, textured RGBA points. */ -#define FLAGS (RGBA | ATTENUATE | TEXTURE) +#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPECULAR) #define NAME atten_textured_rgba_point #include "s_pointtemp.h" /* - * Distance attenuated, Antialiased points with or without texture mapping. + * Distance attenuated, antialiased points with or without texture mapping. */ #define FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH) #define NAME atten_antialiased_rgba_point @@ -178,7 +186,7 @@ void _swrast_choose_point( GLcontext *ctx ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - GLboolean rgbmode = ctx->Visual.RGBAflag; + GLboolean rgbMode = ctx->Visual.RGBAflag; if (ctx->RenderMode==GL_RENDER) { if (ctx->Point.SpriteMode) { @@ -188,48 +196,64 @@ _swrast_choose_point( GLcontext *ctx ) else USE(sprite_point); } - else if (!ctx->Point._Attenuated) { - if (ctx->Point.SmoothFlag && rgbmode) { - USE(antialiased_rgba_point); + else if (ctx->Point.SmoothFlag) { + /* Smooth points */ + if (rgbMode) { + if (ctx->Point._Attenuated) { + USE(atten_antialiased_rgba_point); + } + else if (ctx->Texture._ReallyEnabled) { + USE(antialiased_tex_rgba_point); + } + else { + USE(antialiased_rgba_point); + } + } + else { + USE(antialiased_ci_point); } - else if (ctx->Texture._ReallyEnabled) { - if (swrast->_MultiTextureEnabled || - ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || - ctx->Fog.ColorSumEnabled) { - USE(multitextured_rgba_point); + } + else if (ctx->Point._Attenuated) { + if (rgbMode) { + if (ctx->Texture._ReallyEnabled) { + if (ctx->Point.SmoothFlag) { + USE(atten_antialiased_rgba_point); + } + else { + USE(atten_textured_rgba_point); + } } else { - USE(textured_rgba_point); + USE(atten_general_rgba_point); } } - else if (ctx->Point._Size == 1.0) { - /* size=1, any raster ops */ - if (rgbmode) - USE(size1_rgba_point); - else - USE(size1_ci_point); + else { + /* ci, atten */ + USE(atten_general_ci_point); + } + } + else if (ctx->Texture._ReallyEnabled && rgbMode) { + /* textured */ + USE(textured_rgba_point); + } + else if (ctx->Point.Size != 1.0) { + /* large points */ + if (rgbMode) { + USE(general_rgba_point); } else { - /* every other kind of point rendering */ - if (rgbmode) - USE(general_rgba_point); - else - USE(general_ci_point); + USE(general_ci_point); } - } - else if (ctx->Point.SmoothFlag && rgbmode) { - USE(atten_antialiased_rgba_point); } - else if (ctx->Texture._ReallyEnabled) { - USE(atten_textured_rgba_point); - } else { - /* every other kind of point rendering */ - if (rgbmode) - USE(atten_general_rgba_point); - else - USE(atten_general_ci_point); - } + /* single pixel points */ + if (rgbMode) { + USE(size1_rgba_point); + } + else { + USE(size1_ci_point); + } + } } else if (ctx->RenderMode==GL_FEEDBACK) { USE(gl_feedback_point); -- 2.30.2