-
-/* Flat, color index line */
-static void flat_ci_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
- ASSERT(!ctx->Line.StippleFlag);
- ASSERT(ctx->Line.Width == 1.0F);
-
- INIT_SPAN(span, GL_LINE, 0, SPAN_INDEX, SPAN_XY);
- /*span.arrayMask |= SPAN_XY;
- span.interpMask |= SPAN_INDEX;*/
- span.index = IntToFixed(vert1->index);
- span.indexStep = 0;
-
-#define INTERP_XY 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.end++; \
- }
-
-#include "s_linetemp.h"
-
- _mesa_write_index_span(ctx, &span);
-}
-
-
-/* Flat-shaded, RGBA line */
-static void flat_rgba_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
- ASSERT(!ctx->Line.StippleFlag);
- ASSERT(ctx->Line.Width == 1.0F);
-
- INIT_SPAN(span, GL_LINE, 0, SPAN_RGBA, SPAN_XY);
- /*span.arrayMask |= SPAN_XY;
- span.interpMask |= SPAN_RGBA;*/
- span.red = ChanToFixed(vert1->color[0]);
- span.green = ChanToFixed(vert1->color[1]);
- span.blue = ChanToFixed(vert1->color[2]);
- span.alpha = ChanToFixed(vert1->color[3]);
- span.redStep = 0;
- span.greenStep = 0;
- span.blueStep = 0;
- span.alphaStep = 0;
-
-#define INTERP_XY 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.end++; \
- }
-
-#include "s_linetemp.h"
-
- _mesa_write_rgba_span(ctx, &span);
-}
-
-
-/* Smooth shaded, color index line */
-static void smooth_ci_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
- ASSERT(!ctx->Line.StippleFlag);
- ASSERT(ctx->Line.Width == 1.0F);
-
- INIT_SPAN(span, GL_LINE, 0, 0, SPAN_XY | SPAN_INDEX);
- /*span.arrayMask |= (SPAN_XY | SPAN_INDEX);*/
-
-#define INTERP_XY 1
-#define INTERP_INDEX 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.color.index[span.end] = I; \
- span.end++; \
- }
-
-#include "s_linetemp.h"
-
- _mesa_write_index_span(ctx, &span);
-}
-
-
-/* Smooth-shaded, RGBA line */
-static void smooth_rgba_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
- ASSERT(!ctx->Line.StippleFlag);
- ASSERT(ctx->Line.Width == 1.0F);
-
- INIT_SPAN(span, GL_LINE, 0, 0, SPAN_XY | SPAN_RGBA);
- /*span.arrayMask |= (SPAN_XY | SPAN_RGBA);*/
-
-#define INTERP_XY 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.color.rgba[span.end][RCOMP] = FixedToInt(r0); \
- span.color.rgba[span.end][GCOMP] = FixedToInt(g0); \
- span.color.rgba[span.end][BCOMP] = FixedToInt(b0); \
- span.color.rgba[span.end][ACOMP] = FixedToInt(a0); \
- span.end++; \
- }
-
-#include "s_linetemp.h"
-
- _mesa_write_rgba_span(ctx, &span);
-}
-
-
-/* Smooth shaded, color index, any width, maybe stippled */
-static void general_smooth_ci_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- GLboolean xMajor = GL_FALSE;
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
-
- INIT_SPAN(span, GL_LINE, 0, 0,
- SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_INDEX);
- /*span.arrayMask |= (SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_INDEX);*/
-
-#define SET_XMAJOR 1
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_INDEX 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.zArray[span.end] = Z; \
- span.fogArray[span.end] = fog0; \
- span.color.index[span.end] = I; \
- span.end++; \
- }
-#include "s_linetemp.h"
-
- if (ctx->Line.StippleFlag) {
- span.arrayMask |= SPAN_MASK;
- compute_stipple_mask(ctx, span.end, span.mask);
- }
-
- if (ctx->Line.Width > 1.0) {
- draw_wide_line(ctx, &span, xMajor);
- }
- else {
- _mesa_write_index_span(ctx, &span);
- }
-}
-
-
-/* Flat shaded, color index, any width, maybe stippled */
-static void general_flat_ci_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- GLboolean xMajor = GL_FALSE;
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
-
- INIT_SPAN(span, GL_LINE, 0, SPAN_INDEX,
- SPAN_XY | SPAN_Z | SPAN_FOG);
- /*span.arrayMask |= (SPAN_XY | SPAN_Z | SPAN_FOG);
- span.interpMask |= SPAN_INDEX;*/
- span.index = IntToFixed(vert1->index);
- span.indexStep = 0;
-
-#define SET_XMAJOR 1
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.zArray[span.end] = Z; \
- span.fogArray[span.end] = fog0; \
- span.end++; \
- }
-#include "s_linetemp.h"
-
- if (ctx->Line.StippleFlag) {
- span.arrayMask |= SPAN_MASK;
- compute_stipple_mask(ctx, span.end, span.mask);
- }
-
- if (ctx->Line.Width > 1.0) {
- draw_wide_line(ctx, &span, xMajor);
- }
- else {
- _mesa_write_index_span(ctx, &span);
- }
-}
-
-
-
-static void general_smooth_rgba_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- GLboolean xMajor = GL_FALSE;
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_SMOOTH);
-
- INIT_SPAN(span, GL_LINE, 0, 0,
- SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_RGBA);
- /*span.arrayMask |= (SPAN_XY | SPAN_Z | SPAN_FOG | SPAN_RGBA);*/
-
-#define SET_XMAJOR 1
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define INTERP_RGB 1
-#define INTERP_ALPHA 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.zArray[span.end] = Z; \
- span.color.rgba[span.end][RCOMP] = FixedToInt(r0); \
- span.color.rgba[span.end][GCOMP] = FixedToInt(g0); \
- span.color.rgba[span.end][BCOMP] = FixedToInt(b0); \
- span.color.rgba[span.end][ACOMP] = FixedToInt(a0); \
- span.fogArray[span.end] = fog0; \
- span.end++; \
- }
-#include "s_linetemp.h"
-
- if (ctx->Line.StippleFlag) {
- span.arrayMask |= SPAN_MASK;
- compute_stipple_mask(ctx, span.end, span.mask);
- }
-
- if (ctx->Line.Width > 1.0) {
- draw_wide_line(ctx, &span, xMajor);
- }
- else {
- _mesa_write_rgba_span(ctx, &span);
- }
-}
-
-
-static void general_flat_rgba_line( GLcontext *ctx,
- const SWvertex *vert0,
- const SWvertex *vert1 )
-{
- GLboolean xMajor = GL_FALSE;
- struct sw_span span;
-
- ASSERT(ctx->Light.ShadeModel == GL_FLAT);
-
- INIT_SPAN(span, GL_LINE, 0, SPAN_RGBA,
- SPAN_XY | SPAN_Z | SPAN_FOG);
- /*span.arrayMask |= (SPAN_XY | SPAN_Z | SPAN_FOG);
- span.interpMask |= SPAN_RGBA;*/
- span.red = ChanToFixed(vert1->color[0]);
- span.green = ChanToFixed(vert1->color[1]);
- span.blue = ChanToFixed(vert1->color[2]);
- span.alpha = ChanToFixed(vert1->color[3]);
- span.redStep = 0;
- span.greenStep = 0;
- span.blueStep = 0;
- span.alphaStep = 0;
-
-#define SET_XMAJOR 1
-#define INTERP_XY 1
-#define INTERP_Z 1
-#define INTERP_FOG 1
-#define PLOT(X,Y) \
- { \
- span.xArray[span.end] = X; \
- span.yArray[span.end] = Y; \
- span.zArray[span.end] = Z; \
- span.fogArray[span.end] = fog0; \
- span.end++; \
- }