rearranged order of some functions
[mesa.git] / src / mesa / main / lines.c
index 199686f60f33183f712e50a8b56b6f8eba4da1aa..ba877a85e1911c65b7ef26fe4e56b1740ba65259 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: lines.c,v 1.6 1999/11/11 01:22:27 brianp Exp $ */
+/* $Id: lines.c,v 1.9 2000/03/03 18:55:45 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
@@ -58,6 +58,8 @@ _mesa_LineWidth( GLfloat width )
       ctx->TriangleCaps &= ~DD_LINE_WIDTH;
       if (width != 1.0) ctx->TriangleCaps |= DD_LINE_WIDTH;
       ctx->NewState |= NEW_RASTER_OPS;
+      if (ctx->Driver.LineWidth)
+         (*ctx->Driver.LineWidth)(ctx, width);
    }
 }
 
@@ -71,6 +73,9 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
    ctx->Line.StippleFactor = CLAMP( factor, 1, 256 );
    ctx->Line.StipplePattern = pattern;
    ctx->NewState |= NEW_RASTER_OPS;
+
+   if (ctx->Driver.LineStipple)
+      ctx->Driver.LineStipple( ctx, factor, pattern );
 }
 
 
@@ -1024,8 +1029,7 @@ void gl_set_line_function( GLcontext *ctx )
       else {
         if (ctx->Light.ShadeModel==GL_SMOOTH) {
            /* Width==1, non-stippled, smooth-shaded */
-            if (ctx->Depth.Test
-               || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
+            if (ctx->Depth.Test || ctx->FogMode == FOG_FRAGMENT) {
                if (rgbmode)
                   ctx->Driver.LineFunc = smooth_rgba_z_line;
                else
@@ -1040,8 +1044,7 @@ void gl_set_line_function( GLcontext *ctx )
         }
          else {
            /* Width==1, non-stippled, flat-shaded */
-            if (ctx->Depth.Test
-                || (ctx->Fog.Enabled && ctx->Hint.Fog==GL_NICEST)) {
+            if (ctx->Depth.Test || ctx->FogMode == FOG_FRAGMENT) {
                if (rgbmode)
                   ctx->Driver.LineFunc = flat_rgba_z_line;
                else