From 658702df9706860c0b6777593bf3a1791cc988e6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Jan 2002 20:15:00 +0000 Subject: changed PB (pixel buffer) to use texcoord[4] array --- src/mesa/swrast/s_lines.c | 90 +++++++++++++++++++++----------------------- src/mesa/swrast/s_linetemp.h | 14 ++++++- 2 files changed, 56 insertions(+), 48 deletions(-) (limited to 'src') diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 4d9541fd024..5331e812ddd 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -1,4 +1,4 @@ -/* $Id: s_lines.c,v 1.23 2002/01/16 18:22:19 brianp Exp $ */ +/* $Id: s_lines.c,v 1.24 2002/01/16 20:15:00 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -606,9 +606,7 @@ static void flat_textured_line( GLcontext *ctx, GLint *pby = PB->y; GLdepth *pbz = PB->z; GLfloat *pbfog = PB->fog; - GLfloat *pbs = PB->s[0]; - GLfloat *pbt = PB->t[0]; - GLfloat *pbu = PB->u[0]; + GLfloat (*pbtex)[4] = PB->tex[0]; GLchan *color = (GLchan*) vert1->color; PB_SET_COLOR( PB, color[0], color[1], color[2], color[3] ); count = PB->count; @@ -621,17 +619,17 @@ static void flat_textured_line( GLcontext *ctx, #define INTERP_TEX 1 #define WIDE 1 #define STIPPLE 1 -#define PLOT(X,Y) \ - { \ - pbx[count] = X; \ - pby[count] = Y; \ - pbz[count] = Z; \ - pbfog[count] = fog0; \ - pbs[count] = fragTexcoord[0];\ - pbt[count] = fragTexcoord[1];\ - pbu[count] = fragTexcoord[2];\ - count++; \ - CHECK_FULL(count); \ +#define PLOT(X,Y) \ + { \ + pbx[count] = X; \ + pby[count] = Y; \ + pbz[count] = Z; \ + pbfog[count] = fog0; \ + pbtex[count][0] = fragTexcoord[0]; \ + pbtex[count][1] = fragTexcoord[1]; \ + pbtex[count][2] = fragTexcoord[2]; \ + count++; \ + CHECK_FULL(count); \ } #include "s_linetemp.h" } @@ -642,17 +640,17 @@ static void flat_textured_line( GLcontext *ctx, #define INTERP_FOG 1 #define INTERP_TEX 1 #define WIDE 1 -#define PLOT(X,Y) \ - { \ - pbx[count] = X; \ - pby[count] = Y; \ - pbz[count] = Z; \ - pbfog[count] = fog0; \ - pbs[count] = fragTexcoord[0];\ - pbt[count] = fragTexcoord[1];\ - pbu[count] = fragTexcoord[2];\ - count++; \ - CHECK_FULL(count); \ +#define PLOT(X,Y) \ + { \ + pbx[count] = X; \ + pby[count] = Y; \ + pbz[count] = Z; \ + pbfog[count] = fog0; \ + pbtex[count][0] = fragTexcoord[0]; \ + pbtex[count][1] = fragTexcoord[1]; \ + pbtex[count][2] = fragTexcoord[2]; \ + count++; \ + CHECK_FULL(count); \ } #include "s_linetemp.h" } @@ -674,9 +672,7 @@ static void smooth_textured_line( GLcontext *ctx, GLint *pby = PB->y; GLdepth *pbz = PB->z; GLfloat *pbfog = PB->fog; - GLfloat *pbs = PB->s[0]; - GLfloat *pbt = PB->t[0]; - GLfloat *pbu = PB->u[0]; + GLfloat (*pbtex)[4] = PB->tex[0]; GLchan (*pbrgba)[4] = PB->rgba; PB->mono = GL_FALSE; @@ -697,9 +693,9 @@ static void smooth_textured_line( GLcontext *ctx, pby[count] = Y; \ pbz[count] = Z; \ pbfog[count] = fog0; \ - pbs[count] = fragTexcoord[0]; \ - pbt[count] = fragTexcoord[1]; \ - pbu[count] = fragTexcoord[2]; \ + pbtex[count][0] = fragTexcoord[0]; \ + pbtex[count][1] = fragTexcoord[1]; \ + pbtex[count][2] = fragTexcoord[2]; \ pbrgba[count][RCOMP] = FixedToInt(r0); \ pbrgba[count][GCOMP] = FixedToInt(g0); \ pbrgba[count][BCOMP] = FixedToInt(b0); \ @@ -724,9 +720,9 @@ static void smooth_textured_line( GLcontext *ctx, pby[count] = Y; \ pbz[count] = Z; \ pbfog[count] = fog0; \ - pbs[count] = fragTexcoord[0]; \ - pbt[count] = fragTexcoord[1]; \ - pbu[count] = fragTexcoord[2]; \ + pbtex[count][0] = fragTexcoord[0]; \ + pbtex[count][1] = fragTexcoord[1]; \ + pbtex[count][2] = fragTexcoord[2]; \ pbrgba[count][RCOMP] = FixedToInt(r0); \ pbrgba[count][GCOMP] = FixedToInt(g0); \ pbrgba[count][BCOMP] = FixedToInt(b0); \ @@ -788,9 +784,9 @@ static void smooth_multitextured_line( GLcontext *ctx, pbspec[count][BCOMP] = FixedToInt(sb0); \ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \ if (ctx->Texture.Unit[u]._ReallyEnabled) { \ - PB->s[u][count] = fragTexcoord[u][0]; \ - PB->t[u][count] = fragTexcoord[u][1]; \ - PB->u[u][count] = fragTexcoord[u][2]; \ + PB->tex[u][count][0] = fragTexcoord[u][0]; \ + PB->tex[u][count][1] = fragTexcoord[u][1]; \ + PB->tex[u][count][2] = fragTexcoord[u][2]; \ } \ } \ count++; \ @@ -824,9 +820,9 @@ static void smooth_multitextured_line( GLcontext *ctx, pbspec[count][BCOMP] = FixedToInt(sb0); \ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \ if (ctx->Texture.Unit[u]._ReallyEnabled) { \ - PB->s[u][count] = fragTexcoord[u][0]; \ - PB->t[u][count] = fragTexcoord[u][1]; \ - PB->u[u][count] = fragTexcoord[u][2]; \ + PB->tex[u][count][0] = fragTexcoord[u][0]; \ + PB->tex[u][count][1] = fragTexcoord[u][1]; \ + PB->tex[u][count][2] = fragTexcoord[u][2]; \ } \ } \ count++; \ @@ -888,9 +884,9 @@ static void flat_multitextured_line( GLcontext *ctx, pbspec[count][BCOMP] = sBlue; \ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \ if (ctx->Texture.Unit[u]._ReallyEnabled) { \ - PB->s[u][count] = fragTexcoord[u][0]; \ - PB->t[u][count] = fragTexcoord[u][1]; \ - PB->u[u][count] = fragTexcoord[u][2]; \ + PB->tex[u][count][0] = fragTexcoord[u][0]; \ + PB->tex[u][count][1] = fragTexcoord[u][1]; \ + PB->tex[u][count][2] = fragTexcoord[u][2]; \ } \ } \ count++; \ @@ -922,9 +918,9 @@ static void flat_multitextured_line( GLcontext *ctx, pbspec[count][BCOMP] = sBlue; \ for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { \ if (ctx->Texture.Unit[u]._ReallyEnabled) { \ - PB->s[u][count] = fragTexcoord[u][0]; \ - PB->t[u][count] = fragTexcoord[u][1]; \ - PB->u[u][count] = fragTexcoord[u][2]; \ + PB->tex[u][count][0] = fragTexcoord[u][0]; \ + PB->tex[u][count][1] = fragTexcoord[u][1]; \ + PB->tex[u][count][2] = fragTexcoord[u][2]; \ } \ } \ count++; \ diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index a305a45d58d..21e786b4b2d 100644 --- a/src/mesa/swrast/s_linetemp.h +++ b/src/mesa/swrast/s_linetemp.h @@ -1,4 +1,4 @@ -/* $Id: s_linetemp.h,v 1.10 2001/12/05 10:24:31 keithw Exp $ */ +/* $Id: s_linetemp.h,v 1.11 2002/01/16 20:15:01 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -188,6 +188,18 @@ return; } + /* + printf("%s():\n", __FUNCTION__); + printf(" (%f, %f) -> (%f, %f)\n", + vert0->win[0], vert0->win[1], vert1->win[0], vert1->win[1]); + printf(" (%d, %d, %d) -> (%d, %d, %d)\n", + vert0->color[0], vert0->color[1], vert0->color[2], + vert1->color[0], vert1->color[1], vert1->color[2]); + printf(" (%d, %d, %d) -> (%d, %d, %d)\n", + vert0->specular[0], vert0->specular[1], vert0->specular[2], + vert1->specular[0], vert1->specular[1], vert1->specular[2]); + */ + /* * Despite being clipped to the view volume, the line's window coordinates * may just lie outside the window bounds. That is, if the legal window -- cgit v1.2.3