Fix typo
[mesa.git] / src / mesa / swrast / s_lines.c
index d448bd59e4e97bac5fc1f38645bb937d11e6e8ff..114ddeb320be0a7abde2ccc6d165cf0329b36542 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: s_lines.c,v 1.10 2001/01/23 23:39:37 brianp Exp $ */
+/* $Id: s_lines.c,v 1.12 2001/03/03 20:33:30 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -26,6 +26,7 @@
 
 
 #include "glheader.h"
+#include "colormac.h"
 #include "macros.h"
 #include "mmath.h"
 #include "s_aaline.h"
@@ -66,7 +67,7 @@ static void flat_ci_line( GLcontext *ctx,
 
 #include "s_linetemp.h"
 
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -85,7 +86,7 @@ static void flat_ci_z_line( GLcontext *ctx,
 
 #include "s_linetemp.h"
 
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -104,7 +105,7 @@ static void flat_rgba_line( GLcontext *ctx,
 
 #include "s_linetemp.h"
 
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -124,7 +125,7 @@ static void flat_rgba_z_line( GLcontext *ctx,
 
 #include "s_linetemp.h"
 
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -154,7 +155,7 @@ static void smooth_ci_line( GLcontext *ctx,
 #include "s_linetemp.h"
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -187,7 +188,7 @@ static void smooth_ci_z_line( GLcontext *ctx,
 #include "s_linetemp.h"
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -221,7 +222,7 @@ static void smooth_rgba_line( GLcontext *ctx,
 #include "s_linetemp.h"
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -261,14 +262,14 @@ static void smooth_rgba_z_line( GLcontext *ctx,
 #include "s_linetemp.h"
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
 #define CHECK_FULL(count)              \
    if (count >= PB_SIZE-MAX_WIDTH) {   \
       PB->count = count;               \
-      gl_flush_pb(ctx);                        \
+      _mesa_flush_pb(ctx);                     \
       count = PB->count;               \
    }
 
@@ -350,7 +351,7 @@ static void general_smooth_ci_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -422,7 +423,7 @@ static void general_flat_ci_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -525,7 +526,7 @@ static void general_smooth_rgba_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -568,7 +569,7 @@ static void general_flat_rgba_line( GLcontext *ctx,
       }
    }
 
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -633,7 +634,7 @@ static void flat_textured_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -711,7 +712,7 @@ static void smooth_textured_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -808,7 +809,7 @@ static void smooth_multitextured_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
@@ -905,10 +906,26 @@ static void flat_multitextured_line( GLcontext *ctx,
    }
 
    PB->count = count;
-   gl_flush_pb(ctx);
+   _mesa_flush_pb(ctx);
 }
 
 
+void _swrast_add_spec_terms_line( GLcontext *ctx, 
+                                 const SWvertex *v0,
+                                 const SWvertex *v1 )
+{
+   SWvertex *ncv0 = (SWvertex *)v0;
+   SWvertex *ncv1 = (SWvertex *)v1;
+   GLchan c[2][4];
+   COPY_CHAN4( c[0], ncv0->color );
+   COPY_CHAN4( c[1], ncv1->color );
+   ACC_3V( ncv0->color, ncv0->specular );
+   ACC_3V( ncv1->color, ncv1->specular );
+   SWRAST_CONTEXT(ctx)->SpecLine( ctx, ncv0, ncv1 );
+   COPY_CHAN4( ncv0->color, c[0] );
+   COPY_CHAN4( ncv1->color, c[1] );
+}
+
 
 #ifdef DEBUG
 extern void
@@ -978,9 +995,8 @@ _swrast_choose_line( GLcontext *ctx )
          ASSERT(swrast->Triangle);
       }
       else if (ctx->Texture._ReallyEnabled) {
-         if (swrast->_MultiTextureEnabled
-             || ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR
-            || ctx->Fog.ColorSumEnabled) {
+         if (swrast->_MultiTextureEnabled ||
+            (ctx->_TriangleCaps & DD_SEPERATE_SPECULAR)) {
             /* multi-texture and/or separate specular color */
             if (ctx->Light.ShadeModel==GL_SMOOTH)
                swrast->Line = smooth_multitextured_line;
@@ -1044,11 +1060,11 @@ _swrast_choose_line( GLcontext *ctx )
       }
    }
    else if (ctx->RenderMode==GL_FEEDBACK) {
-      swrast->Line = gl_feedback_line;
+      swrast->Line = _mesa_feedback_line;
    }
    else {
       /* GL_SELECT mode */
-      swrast->Line = gl_select_line;
+      swrast->Line = _mesa_select_line;
    }
 
    /*_mesa_print_line_function(ctx);*/