Merge branch 'origin'
[mesa.git] / src / mesa / swrast / s_aatritemp.h
index b5d82a615c122fb983a417dd72bf21d49a79c404..b5470a02980a0d9973460f23f96c5cde87ffc124 100644 (file)
@@ -1,10 +1,8 @@
-/* $Id: s_aatritemp.h,v 1.34 2003/01/28 00:14:32 brianp Exp $ */
-
 /*
  * Mesa 3-D graphics library
- * Version:  5.1
+ * Version:  6.5
  *
- * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2005  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"),
@@ -53,7 +51,7 @@
    GLboolean ltor;
    GLfloat majDx, majDy;  /* major (i.e. long) edge dx and dy */
    
-   struct sw_span span;
+   SWspan span;
    
 #ifdef DO_Z
    GLfloat zPlane[4];
@@ -83,7 +81,7 @@
    GLfloat texWidth[MAX_TEXTURE_COORD_UNITS];
    GLfloat texHeight[MAX_TEXTURE_COORD_UNITS];
 #endif
-   GLfloat bf = SWRAST_CONTEXT(ctx)->_backface_sign;
+   GLfloat bf = SWRAST_CONTEXT(ctx)->_BackfaceSign;
    
    
    INIT_SPAN(span, GL_POLYGON, 0, 0, SPAN_COVERAGE);
       ltor = (GLboolean) (area < 0.0F);
    }
 
-#ifndef DO_OCCLUSION_TEST
-   ctx->OcclusionResult = GL_TRUE;
-#endif
-
    /* Plane equation setup:
     * We evaluate plane equations at window (x,y) coordinates in order
     * to compute color, Z, fog, texcoords, etc.  This isn't terribly
 #ifdef DO_INDEX
    if (ctx->Light.ShadeModel == GL_SMOOTH) {
       compute_plane(p0, p1, p2, (GLfloat) v0->index,
-                    (GLfloat) v1->index, (GLfloat) v2->index, iPlane);
+                    v1->index, v2->index, iPlane);
    }
    else {
-      constant_plane((GLfloat) v2->index, iPlane);
+      constant_plane(v2->index, iPlane);
    }
    span.arrayMask |= SPAN_INDEX;
 #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 invW2 = v2->win[3];
       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 invW2 = v2->win[3];
          while (coverage > 0.0F) {
             /* (cx,cy) = center of fragment */
             const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
-            struct span_arrays *array = span.array;
+            SWspanarrays *array = span.array;
 #ifdef DO_INDEX
             array->coverage[count] = (GLfloat) compute_coveragei(pMin, pMid, pMax, ix, iy);
 #else
             array->coverage[count] = coverage;
 #endif
 #ifdef DO_Z
-            array->z[count] = (GLdepth) solve_plane(cx, cy, zPlane);
+            array->z[count] = (GLuint) solve_plane(cx, cy, zPlane);
 #endif
 #ifdef DO_FOG
            array->fog[count] = solve_plane(cx, cy, fogPlane);
          span.y = iy;
          span.end = (GLuint) ix - (GLuint) startX;
          ASSERT(span.interpMask == 0);
-#if defined(DO_MULTITEX) || defined(DO_TEX)
-         _mesa_write_texture_span(ctx, &span);
-#elif defined(DO_RGBA)
-         _mesa_write_rgba_span(ctx, &span);
-#elif defined(DO_INDEX)
-         _mesa_write_index_span(ctx, &span);
+#if defined(DO_RGBA)
+         _swrast_write_rgba_span(ctx, &span);
+#else
+         _swrast_write_index_span(ctx, &span);
 #endif
       }
    }
          while (coverage > 0.0F) {
             /* (cx,cy) = center of fragment */
             const GLfloat cx = ix + 0.5F, cy = iy + 0.5F;
-            struct span_arrays *array = span.array;
+            SWspanarrays *array = span.array;
 #ifdef DO_INDEX
             array->coverage[ix] = (GLfloat) compute_coveragei(pMin, pMax, pMid, ix, iy);
 #else
             array->coverage[ix] = coverage;
 #endif
 #ifdef DO_Z
-            array->z[ix] = (GLdepth) solve_plane(cx, cy, zPlane);
+            array->z[ix] = (GLuint) solve_plane(cx, cy, zPlane);
 #endif
 #ifdef DO_FOG
             array->fog[ix] = solve_plane(cx, cy, fogPlane);
          /* shift all values to the left */
          /* XXX this is temporary */
          {
-            struct span_arrays *array = span.array;
+            SWspanarrays *array = span.array;
             GLint j;
             for (j = 0; j < (GLint) n; j++) {
 #ifdef DO_RGBA
 #ifdef DO_MULTITEX
          /* shift texcoords */
          {
-            struct span_arrays *array = span.array;
+            SWspanarrays *array = span.array;
             GLuint unit;
             for (unit = 0; unit < ctx->Const.MaxTextureUnits; unit++) {
                if (ctx->Texture.Unit[unit]._ReallyEnabled) {
          span.y = iy;
          span.end = n;
          ASSERT(span.interpMask == 0);
-#if defined(DO_MULTITEX) || defined(DO_TEX)
-         _mesa_write_texture_span(ctx, &span);
-#elif defined(DO_RGBA)
-         _mesa_write_rgba_span(ctx, &span);
-#elif defined(DO_INDEX)
-         _mesa_write_index_span(ctx, &span);
+#if defined(DO_RGBA)
+         _swrast_write_rgba_span(ctx, &span);
+#else
+         _swrast_write_index_span(ctx, &span);
 #endif
       }
    }