Changed SWvertex's index field to GLfloat and fix a few other bits.
/*
* Mesa 3-D graphics library
- * Version: 5.0.3
+ * 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"),
}
+/**
+ * Compute coverage value for color index mode.
+ * XXX this may not be quite correct.
+ * \return coverage in [0,15].
+ */
+static GLfloat
+compute_coveragei(const struct LineInfo *info,
+ GLint winx, GLint winy)
+{
+ return compute_coveragef(info, winx, winy) * 15.0F;
+}
+
+
typedef void (*plot_func)(GLcontext *ctx, struct LineInfo *line,
int ix, int iy);
-
/*
* 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"),
{
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)
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
#ifdef INTERP_INDEX
interpFlags |= SPAN_INDEX;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
- span.index = IntToFixed(vert0->index);
- span.indexStep = IntToFixed(vert1->index - vert0->index) / numPixels;
+ span.index = FloatToFixed(vert0->index);
+ span.indexStep = FloatToFixed(vert1->index - vert0->index) / numPixels;
}
else {
- span.index = IntToFixed(vert1->index);
+ span.index = FloatToFixed(vert1->index);
span.indexStep = 0;
}
#endif
/*
* Mesa 3-D graphics library
- * Version: 6.0
+ * Version: 6.1
*
* Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
const GLchan specBlue = vert->specular[2];
#endif
#if FLAGS & INDEX
- const GLuint colorIndex = vert->index;
+ const GLuint colorIndex = (GLuint) vert->index; /* XXX round? */
#endif
#if FLAGS & TEXTURE
GLfloat texcoord[MAX_TEXTURE_COORD_UNITS][4];
#define INTERP_FOG 1
#define SETUP_CODE \
span.interpMask |= SPAN_INDEX; \
- span.index = IntToFixed(v2->index); \
+ span.index = FloatToFixed(v2->index);\
span.indexStep = 0;
#define RENDER_SPAN( span ) _swrast_write_index_span(ctx, &span);
#include "s_tritemp.h"
printf(" %g, %g, %g\n", v1->win[0], v1->win[1], v1->win[2]);
printf(" %g, %g, %g\n", v2->win[0], v2->win[1], v2->win[2]);
*/
+ ASSERT(v0->win[2] >= 0.0);
+ ASSERT(v1->win[2] >= 0.0);
+ ASSERT(v2->win[2] >= 0.0);
/* Compute fixed point x,y coords w/ half-pixel offsets and snapping.
* And find the order of the 3 vertices along the Y axis.
#ifdef INTERP_INDEX
span.interpMask |= SPAN_INDEX;
if (ctx->Light.ShadeModel == GL_SMOOTH) {
- GLfloat eMaj_di = (GLfloat) ((GLint) vMax->index - (GLint) vMin->index);
- GLfloat eBot_di = (GLfloat) ((GLint) vMid->index - (GLint) vMin->index);
+ GLfloat eMaj_di = vMax->index - vMin->index;
+ GLfloat eBot_di = vMid->index - vMin->index;
didx = oneOverArea * (eMaj_di * eBot.dy - eMaj.dy * eBot_di);
didy = oneOverArea * (eMaj.dx * eBot_di - eMaj_di * eBot.dx);
span.indexStep = SignedFloatToFixed(didx);
diOuter = SignedFloatToFixed(didy + dxOuter * didx);
}
else {
- iLeft = (GLfixed) (v2->index * FIXED_SCALE);
+ iLeft = FloatToFixed(v2->index);
diOuter = 0;
}
#endif
/*
* 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"),
GLchan color[4];
GLchan specular[4];
GLfloat fog;
- GLuint index;
+ GLfloat index;
GLfloat pointSize;
} SWvertex;