changed some point functions, new picking code

This commit is contained in:
Brian Paul
2001-01-04 15:32:10 +00:00
parent 63cca75e63
commit 2fd9c8690f

View File

@@ -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 * Mesa 3-D graphics library
@@ -56,14 +56,6 @@
#include "s_pointtemp.h" #include "s_pointtemp.h"
/*
* RGBA points with size == 1.0
*/
#define FLAGS (RGBA)
#define NAME size1_rgba_point
#include "s_pointtemp.h"
/* /*
* General CI points. * General CI points.
*/ */
@@ -73,34 +65,10 @@
/* /*
* General RGBA points. * Antialiased CI points.
*/ */
#define FLAGS (RGBA | LARGE) #define FLAGS (INDEX | SMOOTH)
#define NAME general_rgba_point #define NAME antialiased_ci_point
#include "s_pointtemp.h"
/*
* Textured RGBA points.
*/
#define FLAGS (RGBA | LARGE | TEXTURE)
#define NAME textured_rgba_point
#include "s_pointtemp.h"
/*
* Multitextured RGBA points.
*/
#define FLAGS (RGBA | LARGE | TEXTURE | SPECULAR)
#define NAME multitextured_rgba_point
#include "s_pointtemp.h"
/*
* Antialiased points with or without texture mapping.
*/
#define FLAGS (RGBA | SMOOTH | TEXTURE)
#define NAME antialiased_rgba_point
#include "s_pointtemp.h" #include "s_pointtemp.h"
@@ -112,6 +80,46 @@
#include "s_pointtemp.h" #include "s_pointtemp.h"
/*
* RGBA points with size == 1.0
*/
#define FLAGS (RGBA)
#define NAME size1_rgba_point
#include "s_pointtemp.h"
/*
* General RGBA points.
*/
#define FLAGS (RGBA | LARGE)
#define NAME general_rgba_point
#include "s_pointtemp.h"
/*
* Antialiased RGBA points.
*/
#define FLAGS (RGBA | SMOOTH)
#define NAME antialiased_rgba_point
#include "s_pointtemp.h"
/*
* Textured RGBA points.
*/
#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"
/* /*
* Distance attenuated, general RGBA points. * Distance attenuated, general RGBA points.
*/ */
@@ -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 #define NAME atten_textured_rgba_point
#include "s_pointtemp.h" #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 FLAGS (RGBA | ATTENUATE | TEXTURE | SMOOTH)
#define NAME atten_antialiased_rgba_point #define NAME atten_antialiased_rgba_point
@@ -178,7 +186,7 @@ void
_swrast_choose_point( GLcontext *ctx ) _swrast_choose_point( GLcontext *ctx )
{ {
SWcontext *swrast = SWRAST_CONTEXT(ctx); SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLboolean rgbmode = ctx->Visual.RGBAflag; GLboolean rgbMode = ctx->Visual.RGBAflag;
if (ctx->RenderMode==GL_RENDER) { if (ctx->RenderMode==GL_RENDER) {
if (ctx->Point.SpriteMode) { if (ctx->Point.SpriteMode) {
@@ -188,48 +196,64 @@ _swrast_choose_point( GLcontext *ctx )
else else
USE(sprite_point); USE(sprite_point);
} }
else if (!ctx->Point._Attenuated) { else if (ctx->Point.SmoothFlag) {
if (ctx->Point.SmoothFlag && rgbmode) { /* Smooth points */
USE(antialiased_rgba_point); if (rgbMode) {
} if (ctx->Point._Attenuated) {
else if (ctx->Texture._ReallyEnabled) { USE(atten_antialiased_rgba_point);
if (swrast->_MultiTextureEnabled || }
ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || else if (ctx->Texture._ReallyEnabled) {
ctx->Fog.ColorSumEnabled) { USE(antialiased_tex_rgba_point);
USE(multitextured_rgba_point);
} }
else { else {
USE(textured_rgba_point); USE(antialiased_rgba_point);
} }
} }
else if (ctx->Point._Size == 1.0) { else {
/* size=1, any raster ops */ USE(antialiased_ci_point);
if (rgbmode) }
USE(size1_rgba_point); }
else else if (ctx->Point._Attenuated) {
USE(size1_ci_point); if (rgbMode) {
if (ctx->Texture._ReallyEnabled) {
if (ctx->Point.SmoothFlag) {
USE(atten_antialiased_rgba_point);
}
else {
USE(atten_textured_rgba_point);
}
}
else {
USE(atten_general_rgba_point);
}
} }
else { else {
/* every other kind of point rendering */ /* ci, atten */
if (rgbmode)
USE(general_rgba_point);
else
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); 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 {
USE(general_ci_point);
}
}
else {
/* single pixel points */
if (rgbMode) {
USE(size1_rgba_point);
}
else {
USE(size1_ci_point);
}
}
} }
else if (ctx->RenderMode==GL_FEEDBACK) { else if (ctx->RenderMode==GL_FEEDBACK) {
USE(gl_feedback_point); USE(gl_feedback_point);