From 6b1e4ea5a54ea852a904440cd9fa50251f63f64c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 May 2001 18:13:43 +0000 Subject: fixed a number of multi-texture line bugs --- src/mesa/swrast/s_aaline.c | 23 +++++++++++++++++------ src/mesa/swrast/s_aalinetemp.h | 15 +++++++-------- src/mesa/swrast/s_lines.c | 30 +++++++++++++----------------- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/mesa/swrast/s_aaline.c b/src/mesa/swrast/s_aaline.c index 34a026e1e7..395ad3f941 100644 --- a/src/mesa/swrast/s_aaline.c +++ b/src/mesa/swrast/s_aaline.c @@ -1,4 +1,4 @@ -/* $Id: s_aaline.c,v 1.10 2001/05/17 09:32:17 keithw Exp $ */ +/* $Id: s_aaline.c,v 1.11 2001/05/21 18:13:43 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -488,6 +488,13 @@ segment(GLcontext *ctx, #define DO_Z #define DO_RGBA #define DO_MULTITEX +#include "s_aalinetemp.h" + + +#define NAME(x) aa_multitex_spec_##x +#define DO_Z +#define DO_RGBA +#define DO_MULTITEX #define DO_SPEC #include "s_aalinetemp.h" @@ -503,13 +510,17 @@ _swrast_choose_aa_line_function(GLcontext *ctx) if (ctx->Visual.rgbMode) { /* RGBA */ if (ctx->Texture._ReallyEnabled) { - if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY || - ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || - ctx->Fog.ColorSumEnabled) + if (ctx->Texture._ReallyEnabled > TEXTURE0_ANY) { /* Multitextured! */ - swrast->Line = aa_multitex_rgba_line; - else + if (ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR || + ctx->Fog.ColorSumEnabled) + swrast->Line = aa_multitex_spec_line; + else + swrast->Line = aa_multitex_rgba_line; + } + else { swrast->Line = aa_tex_rgba_line; + } } else { swrast->Line = aa_rgba_line; diff --git a/src/mesa/swrast/s_aalinetemp.h b/src/mesa/swrast/s_aalinetemp.h index 02ad04d0cf..bcfd22f019 100644 --- a/src/mesa/swrast/s_aalinetemp.h +++ b/src/mesa/swrast/s_aalinetemp.h @@ -1,4 +1,4 @@ -/* $Id: s_aalinetemp.h,v 1.11 2001/05/17 14:49:38 brianp Exp $ */ +/* $Id: s_aalinetemp.h,v 1.12 2001/05/21 18:13:43 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -122,7 +122,7 @@ NAME(plot)(GLcontext *ctx, const struct LineInfo *line, PB_WRITE_MULTITEX_SPEC_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha, specRed, specGreen, specBlue, tex); #else - PB_WRITE_MULTITEX_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha, texcoords); + PB_WRITE_MULTITEX_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha, tex); #endif #elif defined(DO_TEX) PB_WRITE_TEX_PIXEL(pb, ix, iy, z, fog, red, green, blue, alpha, @@ -239,16 +239,15 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) line.texWidth[0] = (GLfloat) texImage->Width; line.texHeight[0] = (GLfloat) texImage->Height; } -#elif defined(DO_MULITEX) +#elif defined(DO_MULTITEX) { GLuint u; for (u = 0; u < ctx->Const.MaxTextureUnits; u++) { - if (ctx->Texture.Unit[u].ReallyEnabled) { - const struct gl_texture_object *obj = ctx->Texture.Unit[u].Current; + if (ctx->Texture.Unit[u]._ReallyEnabled) { + const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current; const struct gl_texture_image *texImage = obj->Image[obj->BaseLevel]; const GLfloat invW0 = v0->win[3]; const GLfloat invW1 = v1->win[3]; - GLfloat (*texCoord)[4] = VB->TexCoordPtr[u]->data; const GLfloat s0 = v0->texcoord[u][0] * invW0; const GLfloat s1 = v1->texcoord[u][0] * invW1; const GLfloat t0 = v0->texcoord[u][1] * invW0; @@ -259,8 +258,8 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1) const GLfloat q1 = v1->texcoord[u][3] * invW0; compute_plane(line.x0, line.y0, line.x1, line.y1, s0, s1, line.sPlane[u]); compute_plane(line.x0, line.y0, line.x1, line.y1, t0, t1, line.tPlane[u]); - compute_plane(line.x0, line.y0, line.x1, line.y1, u0, u1, line.uPlane[u]); - compute_plane(line.x0, line.y0, line.x1, line.y1, v0, v1, line.vPlane[u]); + compute_plane(line.x0, line.y0, line.x1, line.y1, r0, r1, line.uPlane[u]); + compute_plane(line.x0, line.y0, line.x1, line.y1, q0, q1, line.vPlane[u]); line.texWidth[u] = (GLfloat) texImage->Width; line.texHeight[u] = (GLfloat) texImage->Height; } diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 19b0d9a1a4..c5523a432c 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.17 2001/05/17 09:32:17 keithw Exp $ */ +/* $Id: s_lines.c,v 1.18 2001/05/21 18:13:43 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -780,10 +780,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][0] = fragTexcoord[u][0]; \ - PB->s[u][1] = fragTexcoord[u][1]; \ - PB->s[u][2] = fragTexcoord[u][2]; \ - PB->s[u][3] = fragTexcoord[u][3]; \ + PB->s[u][count] = fragTexcoord[u][0]; \ + PB->t[u][count] = fragTexcoord[u][1]; \ + PB->u[u][count] = fragTexcoord[u][2]; \ } \ } \ count++; \ @@ -817,10 +816,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][0] = fragTexcoord[u][0]; \ - PB->s[u][1] = fragTexcoord[u][1]; \ - PB->s[u][2] = fragTexcoord[u][2]; \ - PB->s[u][3] = fragTexcoord[u][3]; \ + PB->s[u][count] = fragTexcoord[u][0]; \ + PB->t[u][count] = fragTexcoord[u][1]; \ + PB->u[u][count] = fragTexcoord[u][2]; \ } \ } \ count++; \ @@ -881,10 +879,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][0] = fragTexcoord[u][0]; \ - PB->s[u][1] = fragTexcoord[u][1]; \ - PB->s[u][2] = fragTexcoord[u][2]; \ - PB->s[u][3] = fragTexcoord[u][3]; \ + PB->s[u][count] = fragTexcoord[u][0]; \ + PB->t[u][count] = fragTexcoord[u][1]; \ + PB->u[u][count] = fragTexcoord[u][2]; \ } \ } \ count++; \ @@ -916,10 +913,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][0] = fragTexcoord[u][0]; \ - PB->s[u][1] = fragTexcoord[u][1]; \ - PB->s[u][2] = fragTexcoord[u][2]; \ - PB->s[u][3] = fragTexcoord[u][3]; \ + PB->s[u][count] = fragTexcoord[u][0]; \ + PB->t[u][count] = fragTexcoord[u][1]; \ + PB->u[u][count] = fragTexcoord[u][2]; \ } \ } \ count++; \ -- cgit v1.2.3