-/* $Id: lines.c,v 1.11 2000/06/28 23:09:36 brianp Exp $ */
+/* $Id: lines.c,v 1.12 2000/07/14 14:04:07 brianp Exp $ */
/*
* Mesa 3-D graphics library
static void general_flat_rgba_line( GLcontext *ctx,
GLuint vert0, GLuint vert1, GLuint pvert )
{
- GLint count;
- GLint *pbx = ctx->PB->x;
- GLint *pby = ctx->PB->y;
- GLdepth *pbz = ctx->PB->z;
- GLubyte *color = ctx->VB->ColorPtr->data[pvert];
+ const GLubyte *color = ctx->VB->ColorPtr->data[pvert];
PB_SET_COLOR( ctx->PB, color[0], color[1], color[2], color[3] );
- count = ctx->PB->count;
if (ctx->Line.StippleFlag) {
/* stippled */
#define INTERP_Z 1
#define WIDE 1
#define STIPPLE 1
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- count++; \
- CHECK_FULL(count);
+#define PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, Z);
#include "linetemp.h"
}
else {
/* special case: unstippled and width=2 */
#define INTERP_XY 1
#define INTERP_Z 1
-#define XMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X; \
- pby[count] = Y; pby[count+1] = Y+1; \
- pbz[count] = Z; pbz[count+1] = Z; \
- count += 2; \
- CHECK_FULL(count);
-#define YMAJOR_PLOT(X,Y) \
- pbx[count] = X; pbx[count+1] = X+1; \
- pby[count] = Y; pby[count+1] = Y; \
- pbz[count] = Z; pbz[count+1] = Z; \
- count += 2; \
- CHECK_FULL(count);
+#define XMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, Z); \
+ PB_WRITE_PIXEL(ctx->PB, X, Y+1, Z);
+#define YMAJOR_PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, Z); \
+ PB_WRITE_PIXEL(ctx->PB, X+1, Y, Z);
#include "linetemp.h"
}
else {
#define INTERP_XY 1
#define INTERP_Z 1
#define WIDE 1
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- count++; \
- CHECK_FULL(count);
+#define PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, Z);
#include "linetemp.h"
}
}
- ctx->PB->count = count;
gl_flush_pb(ctx);
}
}
+
+#ifdef DEBUG
+void
+_mesa_print_line_function(GLcontext *ctx)
+{
+ printf("Line Func == ");
+ if (ctx->Driver.LineFunc == flat_ci_line)
+ printf("flat_ci_line\n");
+ else if (ctx->Driver.LineFunc == flat_ci_z_line)
+ printf("flat_ci_z_line\n");
+ else if (ctx->Driver.LineFunc == flat_rgba_line)
+ printf("flat_rgba_line\n");
+ else if (ctx->Driver.LineFunc == flat_rgba_z_line)
+ printf("flat_rgba_z_line\n");
+ else if (ctx->Driver.LineFunc == smooth_ci_line)
+ printf("smooth_ci_line\n");
+ else if (ctx->Driver.LineFunc == smooth_ci_z_line)
+ printf("smooth_ci_z_line\n");
+ else if (ctx->Driver.LineFunc == smooth_rgba_line)
+ printf("smooth_rgba_line\n");
+ else if (ctx->Driver.LineFunc == smooth_rgba_z_line)
+ printf("smooth_rgba_z_line\n");
+ else if (ctx->Driver.LineFunc == general_smooth_ci_line)
+ printf("general_smooth_ci_line\n");
+ else if (ctx->Driver.LineFunc == general_flat_ci_line)
+ printf("general_flat_ci_line\n");
+ else if (ctx->Driver.LineFunc == general_smooth_rgba_line)
+ printf("general_smooth_rgba_line\n");
+ else if (ctx->Driver.LineFunc == general_flat_rgba_line)
+ printf("general_flat_rgba_line\n");
+ else if (ctx->Driver.LineFunc == flat_textured_line)
+ printf("flat_textured_line\n");
+ else if (ctx->Driver.LineFunc == smooth_textured_line)
+ printf("smooth_textured_line\n");
+ else if (ctx->Driver.LineFunc == smooth_multitextured_line)
+ printf("smooth_multitextured_line\n");
+ else if (ctx->Driver.LineFunc == flat_multitextured_line)
+ printf("flat_multitextured_line\n");
+ else if (ctx->Driver.LineFunc == aa_rgba_line)
+ printf("aa_rgba_line\n");
+ else if (ctx->Driver.LineFunc == aa_tex_rgba_line)
+ printf("aa_tex_rgba_line\n");
+ else if (ctx->Driver.LineFunc == aa_multitex_rgba_line)
+ printf("aa_multitex_rgba_line\n");
+ else if (ctx->Driver.LineFunc == aa_ci_line)
+ printf("aa_ci_line\n");
+ else if (ctx->Driver.LineFunc == null_line)
+ printf("null_line\n");
+ else
+ printf("Driver func %p\n", ctx->Driver.PointsFunc);
+}
+#endif
+
+
+
/*
* Determine which line drawing function to use given the current
* rendering context.
/* GL_SELECT mode */
ctx->Driver.LineFunc = gl_select_line;
}
-}
+ /*_mesa_print_line_function(ctx);*/
+}