summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/lines.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2000-05-10 22:36:05 +0000
committerBrian Paul <[email protected]>2000-05-10 22:36:05 +0000
commitda99cded2609312feeb656979b0c26328ed7294a (patch)
tree6c9967ad45052305a4ec7420813fa7f04e318130 /src/mesa/main/lines.c
parent7a39d2f833807f8defd2304b0ff180944c23ea0c (diff)
fixed PB bugs, removed MutablePixels, MonoPixels from GLcontext
Diffstat (limited to 'src/mesa/main/lines.c')
-rw-r--r--src/mesa/main/lines.c90
1 files changed, 33 insertions, 57 deletions
diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
index ba877a85e19..28f9e38fbf5 100644
--- a/src/mesa/main/lines.c
+++ b/src/mesa/main/lines.c
@@ -1,4 +1,4 @@
-/* $Id: lines.c,v 1.9 2000/03/03 18:55:45 brianp Exp $ */
+/* $Id: lines.c,v 1.10 2000/05/10 22:36:05 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -116,22 +116,13 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
static void flat_ci_line( GLcontext *ctx,
GLuint vert0, GLuint vert1, GLuint pvert )
{
- GLint count;
- GLint *pbx = ctx->PB->x;
- GLint *pby = ctx->PB->y;
- PB_SET_INDEX( ctx, ctx->PB, ctx->VB->IndexPtr->data[pvert] );
- count = ctx->PB->count;
+ PB_SET_INDEX( ctx->PB, ctx->VB->IndexPtr->data[pvert] );
#define INTERP_XY 1
-
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- count++;
+#define PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, 0);
#include "linetemp.h"
- ctx->PB->count = count;
gl_flush_pb(ctx);
}
@@ -141,25 +132,14 @@ static void flat_ci_line( GLcontext *ctx,
static void flat_ci_z_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;
- PB_SET_INDEX( ctx, ctx->PB, ctx->VB->IndexPtr->data[pvert] );
- count = ctx->PB->count;
+ PB_SET_INDEX( ctx->PB, ctx->VB->IndexPtr->data[pvert] );
#define INTERP_XY 1
#define INTERP_Z 1
-
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- count++;
+#define PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, Z);
#include "linetemp.h"
- ctx->PB->count = count;
gl_flush_pb(ctx);
}
@@ -169,23 +149,14 @@ static void flat_ci_z_line( GLcontext *ctx,
static void flat_rgba_line( GLcontext *ctx,
GLuint vert0, GLuint vert1, GLuint pvert )
{
- GLint count;
- GLint *pbx = ctx->PB->x;
- GLint *pby = ctx->PB->y;
- GLubyte *color = ctx->VB->ColorPtr->data[pvert];
- PB_SET_COLOR( ctx, ctx->PB, color[0], color[1], color[2], color[3] );
- count = ctx->PB->count;
+ const GLubyte *color = ctx->VB->ColorPtr->data[pvert];
+ PB_SET_COLOR( ctx->PB, color[0], color[1], color[2], color[3] );
#define INTERP_XY 1
-
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- count++;
+#define PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, 0);
#include "linetemp.h"
- ctx->PB->count = count;
gl_flush_pb(ctx);
}
@@ -195,26 +166,15 @@ static void flat_rgba_line( GLcontext *ctx,
static void flat_rgba_z_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];
- PB_SET_COLOR( ctx, ctx->PB, color[0], color[1], color[2], color[3] );
- count = ctx->PB->count;
+ const GLubyte *color = ctx->VB->ColorPtr->data[pvert];
+ PB_SET_COLOR( ctx->PB, color[0], color[1], color[2], color[3] );
#define INTERP_XY 1
#define INTERP_Z 1
-
-#define PLOT(X,Y) \
- pbx[count] = X; \
- pby[count] = Y; \
- pbz[count] = Z; \
- count++;
+#define PLOT(X,Y) PB_WRITE_PIXEL(ctx->PB, X, Y, Z);
#include "linetemp.h"
- ctx->PB->count = count;
gl_flush_pb(ctx);
}
@@ -227,9 +187,11 @@ static void smooth_ci_line( GLcontext *ctx,
GLint count = ctx->PB->count;
GLint *pbx = ctx->PB->x;
GLint *pby = ctx->PB->y;
- GLuint *pbi = ctx->PB->i;
+ GLuint *pbi = ctx->PB->index;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
#define INTERP_XY 1
#define INTERP_INDEX 1
@@ -255,9 +217,11 @@ static void smooth_ci_z_line( GLcontext *ctx,
GLint *pbx = ctx->PB->x;
GLint *pby = ctx->PB->y;
GLdepth *pbz = ctx->PB->z;
- GLuint *pbi = ctx->PB->i;
+ GLuint *pbi = ctx->PB->index;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_INDEX 1
@@ -287,6 +251,8 @@ static void smooth_rgba_line( GLcontext *ctx,
GLubyte (*pbrgba)[4] = ctx->PB->rgba;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
#define INTERP_XY 1
#define INTERP_RGB 1
#define INTERP_ALPHA 1
@@ -319,6 +285,8 @@ static void smooth_rgba_z_line( GLcontext *ctx,
GLubyte (*pbrgba)[4] = ctx->PB->rgba;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
#define INTERP_XY 1
#define INTERP_Z 1
#define INTERP_RGB 1
@@ -358,9 +326,11 @@ static void general_smooth_ci_line( GLcontext *ctx,
GLint *pbx = ctx->PB->x;
GLint *pby = ctx->PB->y;
GLdepth *pbz = ctx->PB->z;
- GLuint *pbi = ctx->PB->i;
+ GLuint *pbi = ctx->PB->index;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
if (ctx->Line.StippleFlag) {
/* stippled */
#define INTERP_XY 1
@@ -430,7 +400,7 @@ static void general_flat_ci_line( GLcontext *ctx,
GLint *pbx = ctx->PB->x;
GLint *pby = ctx->PB->y;
GLdepth *pbz = ctx->PB->z;
- PB_SET_INDEX( ctx, ctx->PB, ctx->VB->IndexPtr->data[pvert] );
+ PB_SET_INDEX( ctx->PB, ctx->VB->IndexPtr->data[pvert] );
count = ctx->PB->count;
if (ctx->Line.StippleFlag) {
@@ -498,6 +468,8 @@ static void general_smooth_rgba_line( GLcontext *ctx,
GLubyte (*pbrgba)[4] = ctx->PB->rgba;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
if (ctx->Line.StippleFlag) {
/* stippled */
#define INTERP_XY 1
@@ -590,7 +562,7 @@ static void general_flat_rgba_line( GLcontext *ctx,
GLint *pby = ctx->PB->y;
GLdepth *pbz = ctx->PB->z;
GLubyte *color = ctx->VB->ColorPtr->data[pvert];
- PB_SET_COLOR( ctx, ctx->PB, color[0], color[1], color[2], color[3] );
+ PB_SET_COLOR( ctx->PB, color[0], color[1], color[2], color[3] );
count = ctx->PB->count;
if (ctx->Line.StippleFlag) {
@@ -659,7 +631,7 @@ static void flat_textured_line( GLcontext *ctx,
GLfloat *pbt = ctx->PB->t[0];
GLfloat *pbu = ctx->PB->u[0];
GLubyte *color = ctx->VB->ColorPtr->data[pv];
- PB_SET_COLOR( ctx, ctx->PB, color[0], color[1], color[2], color[3] );
+ PB_SET_COLOR( ctx->PB, color[0], color[1], color[2], color[3] );
count = ctx->PB->count;
if (ctx->Line.StippleFlag) {
@@ -722,6 +694,8 @@ static void smooth_textured_line( GLcontext *ctx,
GLubyte (*pbrgba)[4] = ctx->PB->rgba;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
if (ctx->Line.StippleFlag) {
/* stippled */
#define INTERP_XY 1
@@ -799,6 +773,8 @@ static void smooth_multitextured_line( GLcontext *ctx,
GLubyte (*pbspec)[3] = ctx->PB->spec;
(void) pvert;
+ ctx->PB->mono = GL_FALSE;
+
if (ctx->Line.StippleFlag) {
/* stippled */
#define INTERP_XY 1