summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-07-14 14:04:07 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-07-14 14:04:07 +0000
commitf19cba049d7af1824ddc0236e4ff1e910d6002a7 (patch)
treea83ba330942dc79aed7a00aada777f92dfa52a54
parentf8246e2fdad5180ce300ad1ff187c248d75c12ad (diff)
Fixed pixel color problem in general_flat_rgba_line(). Added debug code
-rw-r--r--src/mesa/main/lines.c98
1 files changed, 65 insertions, 33 deletions
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index f25beb4dad..991cbd0668 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -1,4 +1,4 @@
-/* $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
@@ -557,13 +557,8 @@ static void general_smooth_rgba_line( GLcontext *ctx,
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 */
@@ -571,12 +566,7 @@ static void general_flat_rgba_line( GLcontext *ctx,
#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 {
@@ -585,18 +575,10 @@ static void general_flat_rgba_line( GLcontext *ctx,
/* 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 {
@@ -604,17 +586,11 @@ static void general_flat_rgba_line( GLcontext *ctx,
#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);
}
@@ -1033,6 +1009,61 @@ static void null_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv )
}
+
+#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.
@@ -1143,5 +1174,6 @@ void gl_set_line_function( GLcontext *ctx )
/* GL_SELECT mode */
ctx->Driver.LineFunc = gl_select_line;
}
-}
+ /*_mesa_print_line_function(ctx);*/
+}