s/BlendEquatioRGB/BlendEquationRGB/
[mesa.git] / src / mesa / swrast / s_aalinetemp.h
index e1e12569155c1d490aa5ea2ef54a24b443aea068..3a68e528a73e625a09c11abc9f579f94519c76d3 100644 (file)
@@ -1,10 +1,9 @@
-/* $Id: s_aalinetemp.h,v 1.19 2002/04/12 15:39:58 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  5.1
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2003  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"),
@@ -45,41 +44,41 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
       return;
 
    line->span.end++;
-   line->span.coverage[i] = coverage;
-   line->span.xArray[i] = ix;
-   line->span.yArray[i] = iy;
+   line->span.array->coverage[i] = coverage;
+   line->span.array->x[i] = ix;
+   line->span.array->y[i] = iy;
 
    /*
     * Compute Z, color, texture coords, fog for the fragment by
     * solving the plane equations at (ix,iy).
     */
 #ifdef DO_Z
-   line->span.zArray[i] = (GLdepth) solve_plane(fx, fy, line->zPlane);
+   line->span.array->z[i] = (GLdepth) IROUND(solve_plane(fx, fy, line->zPlane));
 #endif
 #ifdef DO_FOG
-   line->span.fogArray[i] = solve_plane(fx, fy, line->fPlane);
+   line->span.array->fog[i] = solve_plane(fx, fy, line->fPlane);
 #endif
 #ifdef DO_RGBA
-   line->span.color.rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane);
-   line->span.color.rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane);
-   line->span.color.rgba[i][BCOMP] = solve_plane_chan(fx, fy, line->bPlane);
-   line->span.color.rgba[i][ACOMP] = solve_plane_chan(fx, fy, line->aPlane);
+   line->span.array->rgba[i][RCOMP] = solve_plane_chan(fx, fy, line->rPlane);
+   line->span.array->rgba[i][GCOMP] = solve_plane_chan(fx, fy, line->gPlane);
+   line->span.array->rgba[i][BCOMP] = solve_plane_chan(fx, fy, line->bPlane);
+   line->span.array->rgba[i][ACOMP] = solve_plane_chan(fx, fy, line->aPlane);
 #endif
 #ifdef DO_INDEX
-   line->span.color.index[i] = (GLint) solve_plane(fx, fy, line->iPlane);
+   line->span.array->index[i] = (GLint) solve_plane(fx, fy, line->iPlane);
 #endif
 #ifdef DO_SPEC
-   line->span.specArray[i][RCOMP] = solve_plane_chan(fx, fy, line->srPlane);
-   line->span.specArray[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane);
-   line->span.specArray[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane);
+   line->span.array->spec[i][RCOMP] = solve_plane_chan(fx, fy, line->srPlane);
+   line->span.array->spec[i][GCOMP] = solve_plane_chan(fx, fy, line->sgPlane);
+   line->span.array->spec[i][BCOMP] = solve_plane_chan(fx, fy, line->sbPlane);
 #endif
 #ifdef DO_TEX
    {
       const GLfloat invQ = solve_plane_recip(fx, fy, line->vPlane[0]);
-      line->span.texcoords[0][i][0] = solve_plane(fx, fy, line->sPlane[0]) * invQ;
-      line->span.texcoords[0][i][1] = solve_plane(fx, fy, line->tPlane[0]) * invQ;
-      line->span.texcoords[0][i][2] = solve_plane(fx, fy, line->uPlane[0]) * invQ;
-      line->span.lambda[0][i] = compute_lambda(line->sPlane[0], line->tPlane[0], invQ,
+      line->span.array->texcoords[0][i][0] = solve_plane(fx, fy, line->sPlane[0]) * invQ;
+      line->span.array->texcoords[0][i][1] = solve_plane(fx, fy, line->tPlane[0]) * invQ;
+      line->span.array->texcoords[0][i][2] = solve_plane(fx, fy, line->uPlane[0]) * invQ;
+      line->span.array->lambda[0][i] = compute_lambda(line->sPlane[0], line->tPlane[0], invQ,
                                           line->texWidth[0], line->texHeight[0]);
    }
 #elif defined(DO_MULTITEX)
@@ -88,10 +87,10 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
       for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
          if (ctx->Texture.Unit[unit]._ReallyEnabled) {
             const GLfloat invQ = solve_plane_recip(fx, fy, line->vPlane[unit]);
-            line->span.texcoords[unit][i][0] = solve_plane(fx, fy, line->sPlane[unit]) * invQ;
-            line->span.texcoords[unit][i][1] = solve_plane(fx, fy, line->tPlane[unit]) * invQ;
-            line->span.texcoords[unit][i][2] = solve_plane(fx, fy, line->uPlane[unit]) * invQ;
-            line->span.lambda[unit][i] = compute_lambda(line->sPlane[unit],
+            line->span.array->texcoords[unit][i][0] = solve_plane(fx, fy, line->sPlane[unit]) * invQ;
+            line->span.array->texcoords[unit][i][1] = solve_plane(fx, fy, line->tPlane[unit]) * invQ;
+            line->span.array->texcoords[unit][i][2] = solve_plane(fx, fy, line->uPlane[unit]) * invQ;
+            line->span.array->lambda[unit][i] = compute_lambda(line->sPlane[unit],
                                                line->tPlane[unit], invQ,
                                                line->texWidth[unit], line->texHeight[unit]);
          }
@@ -101,11 +100,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,14 +131,13 @@ 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))
       return;
 
    INIT_SPAN(line.span, GL_LINE, 0, 0, SPAN_XY | SPAN_COVERAGE);
-   /*line.span.arrayMask |= (SPAN_XY | SPAN_COVERAGE);*/
 
    line.xAdj = line.dx / line.len * line.halfWidth;
    line.yAdj = line.dy / line.len * line.halfWidth;
@@ -202,7 +200,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
 #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;
@@ -228,7 +226,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;
@@ -295,11 +293,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
 }