fix minor typo in comment
[mesa.git] / src / mesa / swrast / s_aalinetemp.h
index 529da481103fdfcbcd4af774d065d88b6cd0a0ba..e6ac69d186031e63651650adb70e1a41f3baac7d 100644 (file)
@@ -1,10 +1,8 @@
-/* $Id: s_aalinetemp.h,v 1.22 2003/02/21 21:00:27 brianp Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.1
  *
- * Copyright (C) 1999-2003  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"),
@@ -38,7 +36,11 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
 {
    const GLfloat fx = (GLfloat) ix;
    const GLfloat fy = (GLfloat) iy;
+#ifdef DO_INDEX
+   const GLfloat coverage = compute_coveragei(line, ix, iy);
+#else
    const GLfloat coverage = compute_coveragef(line, ix, iy);
+#endif
    const GLuint i = line->span.end;
 
    if (coverage == 0.0)
@@ -101,11 +103,11 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
 
    if (line->span.end == MAX_WIDTH) {
 #if defined(DO_TEX) || defined(DO_MULTITEX)
-      _mesa_write_texture_span(ctx, &(line->span));
+      _swrast_write_texture_span(ctx, &(line->span));
 #elif defined(DO_RGBA)
-      _mesa_write_rgba_span(ctx, &(line->span));
+      _swrast_write_rgba_span(ctx, &(line->span));
 #else
-      _mesa_write_index_span(ctx, &(line->span));
+      _swrast_write_index_span(ctx, &(line->span));
 #endif
       line->span.end = 0; /* reset counter */
    }
@@ -132,7 +134,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
    line.y1 = v1->win[1];
    line.dx = line.x1 - line.x0;
    line.dy = line.y1 - line.y0;
-   line.len = (GLfloat) sqrt(line.dx * line.dx + line.dy * line.dy);
+   line.len = SQRTF(line.dx * line.dx + line.dy * line.dy);
    line.halfWidth = 0.5F * ctx->Line.Width;
 
    if (line.len == 0.0 || IS_INF_OR_NAN(line.len))
@@ -192,16 +194,16 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
    line.span.arrayMask |= SPAN_INDEX;
    if (ctx->Light.ShadeModel == GL_SMOOTH) {
       compute_plane(line.x0, line.y0, line.x1, line.y1,
-                    (GLfloat) v0->index, (GLfloat) v1->index, line.iPlane);
+                    v0->index, v1->index, line.iPlane);
    }
    else {
-      constant_plane((GLfloat) v1->index, line.iPlane);
+      constant_plane(v1->index, line.iPlane);
    }
 #endif
 #ifdef DO_TEX
    {
       const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
-      const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+      const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
       const GLfloat invW0 = v0->win[3];
       const GLfloat invW1 = v1->win[3];
       const GLfloat s0 = v0->texcoord[0][0] * invW0;
@@ -227,7 +229,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
       for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
          if (ctx->Texture.Unit[u]._ReallyEnabled) {
             const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
-            const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel];
+            const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
             const GLfloat invW0 = v0->win[3];
             const GLfloat invW1 = v1->win[3];
             const GLfloat s0 = v0->texcoord[u][0] * invW0;
@@ -294,11 +296,11 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
    }
 
 #if defined(DO_TEX) || defined(DO_MULTITEX)
-   _mesa_write_texture_span(ctx, &(line.span));
+   _swrast_write_texture_span(ctx, &(line.span));
 #elif defined(DO_RGBA)
-   _mesa_write_rgba_span(ctx, &(line.span));
+   _swrast_write_rgba_span(ctx, &(line.span));
 #else
-   _mesa_write_index_span(ctx, &(line.span));
+   _swrast_write_index_span(ctx, &(line.span));
 #endif
 }