more removal of fprintf() calls
[mesa.git] / src / mesa / swrast / s_points.c
index 70ff376df886d7ae8163581aa141fbf2b3365b60..d84fc7bd94effc58e78547f1180f222ddb852725 100644 (file)
@@ -1,21 +1,21 @@
-/* $Id: s_points.c,v 1.14 2001/03/03 20:33:30 brianp Exp $ */
+/* $Id: s_points.c,v 1.18 2002/05/27 17:04:53 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  3.5
- * 
- * Copyright (C) 1999-2001  Brian Paul   All Rights Reserved.
- * 
+ * Version:  4.1
+ *
+ * Copyright (C) 1999-2002  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"),
  * to deal in the Software without restriction, including without limitation
  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
- * 
+ *
  * The above copyright notice and this permission notice shall be included
  * in all copies or substantial portions of the Software.
- * 
+ *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 #include "texstate.h"
 #include "s_context.h"
 #include "s_feedback.h"
-#include "s_pb.h"
 #include "s_points.h"
 #include "s_span.h"
 
 
 
-#define INDEX      0x0
 #define RGBA       0x1
-#define SMOOTH     0x2
-#define TEXTURE    0x4
-#define SPECULAR   0x8
-#define LARGE     0x10
-#define ATTENUATE 0x20
-#define SPRITE    0x40
+#define INDEX      0x2
+#define SMOOTH     0x4
+#define TEXTURE    0x8
+#define SPECULAR  0x10
+#define LARGE     0x20
+#define ATTENUATE 0x40
+#define SPRITE    0x80
 
 
 /*
 /*
  * Sprite (textured point)
  */
-#define FLAGS (RGBA | TEXTURE | SPRITE)
+#define FLAGS (RGBA | SPRITE)
 #define NAME sprite_point
 #include "s_pointtemp.h"
 
 
-#define FLAGS (RGBA | ATTENUATE | TEXTURE | SPRITE)
+#define FLAGS (RGBA | ATTENUATE | SPRITE)
 #define NAME atten_sprite_point
 #include "s_pointtemp.h"
 
 
 
-void _swrast_add_spec_terms_point( GLcontext *ctx, 
+void _swrast_add_spec_terms_point( GLcontext *ctx,
                                   const SWvertex *v0 )
 {
    SWvertex *ncv0 = (SWvertex *)v0;
@@ -195,14 +194,15 @@ do {                                   \
  * Examine the current context to determine which point drawing function
  * should be used.
  */
-void 
+void
 _swrast_choose_point( GLcontext *ctx )
 {
    SWcontext *swrast = SWRAST_CONTEXT(ctx);
    GLboolean rgbMode = ctx->Visual.rgbMode;
 
    if (ctx->RenderMode==GL_RENDER) {
-      if (ctx->Point.SpriteMode) {
+      if (ctx->Point.PointSprite) {
+         /* GL_NV_point_sprite */
          /* XXX this might not be good enough */
          if (ctx->Point._Attenuated)
             USE(atten_sprite_point);
@@ -212,7 +212,7 @@ _swrast_choose_point( GLcontext *ctx )
       else if (ctx->Point.SmoothFlag) {
          /* Smooth points */
          if (rgbMode) {
-            if (ctx->Point._Attenuated) {
+            if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
                USE(atten_antialiased_rgba_point);
             }
             else if (ctx->Texture._ReallyEnabled) {
@@ -226,7 +226,7 @@ _swrast_choose_point( GLcontext *ctx )
             USE(antialiased_ci_point);
          }
       }
-      else if (ctx->Point._Attenuated) {
+      else if (ctx->Point._Attenuated || ctx->VertexProgram.PointSizeEnabled) {
          if (rgbMode) {
             if (ctx->Texture._ReallyEnabled) {
                if (ctx->Point.SmoothFlag) {
@@ -276,4 +276,3 @@ _swrast_choose_point( GLcontext *ctx )
       USE(_mesa_select_point);
    }
 }
-