s/BlendEquatioRGB/BlendEquationRGB/
[mesa.git] / src / mesa / swrast / s_pointtemp.h
index d4c86ab00e754732f38be2b8a8d0bc58b2a48f50..0ca137cd02964395d1c8e160499b0dc82dc0c4a4 100644 (file)
@@ -1,10 +1,8 @@
-/* $Id: s_pointtemp.h,v 1.22 2003/01/14 04:55:46 brianp Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.0
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2004  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"),
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
+/*
+ * Regarding GL_NV_point_sprite:
+ *
+ * Portions of this software may use or implement intellectual
+ * property owned and licensed by NVIDIA Corporation. NVIDIA disclaims
+ * any and all warranties with respect to such intellectual property,
+ * including any use thereof or modifications thereto.
+ */
+
 
 /*
  * Point rendering template code.
@@ -36,7 +43,7 @@
  *   SPECULAR = do separate specular color
  *   LARGE = do points with diameter > 1 pixel
  *   ATTENUATE = compute point size attenuation
- *   SPRITE = GL_NV_point_sprite
+ *   SPRITE = GL_ARB_point_sprite / GL_NV_point_sprite
  *
  * Notes: LARGE and ATTENUATE are exclusive of each other.
  *        TEXTURE requires RGBA
@@ -64,10 +71,10 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
 #if FLAGS & (ATTENUATE | LARGE | SMOOTH | SPRITE)
    GLfloat size;
 #endif
-#if FLAGS & ATTENUATE
+#if FLAGS & RGBA
+#if (FLAGS & ATTENUATE) && (FLAGS & SMOOTH)
    GLfloat alphaAtten;
 #endif
-#if FLAGS & RGBA
    const GLchan red   = vert->color[0];
    const GLchan green = vert->color[1];
    const GLchan blue  = vert->color[2];
@@ -135,12 +142,16 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
 #if FLAGS & ATTENUATE
    if (vert->pointSize >= ctx->Point.Threshold) {
       size = MIN2(vert->pointSize, ctx->Point.MaxSize);
+#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
       alphaAtten = 1.0F;
+#endif
    }
    else {
+#if (FLAGS & RGBA) && (FLAGS & SMOOTH)
       GLfloat dsize = vert->pointSize / ctx->Point.Threshold;
-      size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
       alphaAtten = dsize * dsize;
+#endif
+      size = MAX2(ctx->Point.Threshold, ctx->Point.MinSize);
    }
 #elif FLAGS & (LARGE | SMOOTH | SPRITE)
    size = ctx->Point._Size;
@@ -193,13 +204,13 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
           (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
 #if FLAGS & (TEXTURE | SPRITE)
          if (ctx->Texture._EnabledUnits)
-            _mesa_write_texture_span(ctx, span);
+            _swrast_write_texture_span(ctx, span);
          else
-            _mesa_write_rgba_span(ctx, span);
+            _swrast_write_rgba_span(ctx, span);
 #elif FLAGS & RGBA
-         _mesa_write_rgba_span(ctx, span);
+         _swrast_write_rgba_span(ctx, span);
 #else
-         _mesa_write_index_span(ctx, span);
+         _swrast_write_index_span(ctx, span);
 #endif
          span->end = 0;
       }
@@ -322,13 +333,13 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
           (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) {
 #if FLAGS & (TEXTURE | SPRITE)
          if (ctx->Texture._EnabledUnits)
-            _mesa_write_texture_span(ctx, span);
+            _swrast_write_texture_span(ctx, span);
          else
-            _mesa_write_rgba_span(ctx, span);
+            _swrast_write_rgba_span(ctx, span);
 #elif FLAGS & RGBA
-         _mesa_write_rgba_span(ctx, span);
+         _swrast_write_rgba_span(ctx, span);
 #else
-         _mesa_write_index_span(ctx, span);
+         _swrast_write_index_span(ctx, span);
 #endif
          span->end = 0;
       }