diff options
author | Brian Paul <[email protected]> | 2003-09-18 23:21:08 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-09-18 23:21:08 +0000 |
commit | 29b4076f9acff96a867760fc885f5eaeb7586977 (patch) | |
tree | 8257664555bea58b6f9f2ebc4e3d0f2ddce719c3 /src/mesa/swrast | |
parent | 1a8ebb8c2f939609004a13b75d2b85236e709716 (diff) |
Move away from using the ctx->_TriangleCaps bitfield.
New macros in context.h for testing state: NEED_SECONDARY_COLOR
and NEED_TWO_SIDED_LIGHTING.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_aatriangle.c | 2 | ||||
-rw-r--r-- | src/mesa/swrast/s_context.c | 10 | ||||
-rw-r--r-- | src/mesa/swrast/s_lines.c | 3 |
3 files changed, 7 insertions, 8 deletions
diff --git a/src/mesa/swrast/s_aatriangle.c b/src/mesa/swrast/s_aatriangle.c index 21b8c0437ef..7f2f3e338a4 100644 --- a/src/mesa/swrast/s_aatriangle.c +++ b/src/mesa/swrast/s_aatriangle.c @@ -464,7 +464,7 @@ _swrast_set_aa_triangle_function(GLcontext *ctx) ASSERT(ctx->Polygon.SmoothFlag); if (ctx->Texture._EnabledCoordUnits != 0) { - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) { + if (NEED_SECONDARY_COLOR(ctx)) { if (ctx->Texture._EnabledCoordUnits > 1) { SWRAST_CONTEXT(ctx)->Triangle = spec_multitex_aa_tri; } diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c index 9e429aef857..99da79afd5f 100644 --- a/src/mesa/swrast/s_context.c +++ b/src/mesa/swrast/s_context.c @@ -226,8 +226,8 @@ _swrast_validate_triangle( GLcontext *ctx, _swrast_validate_derived( ctx ); swrast->choose_triangle( ctx ); - if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) && - ctx->Texture._EnabledUnits == 0) { + if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) { + /* separate specular color, but no texture */ swrast->SpecTriangle = swrast->Triangle; swrast->Triangle = _swrast_add_spec_terms_triangle; } @@ -243,8 +243,7 @@ _swrast_validate_line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) _swrast_validate_derived( ctx ); swrast->choose_line( ctx ); - if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) && - ctx->Texture._EnabledUnits == 0) { + if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) { swrast->SpecLine = swrast->Line; swrast->Line = _swrast_add_spec_terms_line; } @@ -261,8 +260,7 @@ _swrast_validate_point( GLcontext *ctx, const SWvertex *v0 ) _swrast_validate_derived( ctx ); swrast->choose_point( ctx ); - if ((ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) && - ctx->Texture._EnabledUnits == 0) { + if (ctx->Texture._EnabledUnits == 0 && NEED_SECONDARY_COLOR(ctx)) { swrast->SpecPoint = swrast->Point; swrast->Point = _swrast_add_spec_terms_point; } diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index 97143a2f4b7..f003395d428 100644 --- a/src/mesa/swrast/s_lines.c +++ b/src/mesa/swrast/s_lines.c @@ -24,6 +24,7 @@ #include "glheader.h" +#include "context.h" #include "colormac.h" #include "macros.h" #include "s_aaline.h" @@ -304,7 +305,7 @@ _swrast_choose_line( GLcontext *ctx ) else if (ctx->Texture._EnabledCoordUnits) { /* textured lines */ if (ctx->Texture._EnabledCoordUnits > 0x1 - || (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR)) { + || NEED_SECONDARY_COLOR(ctx)) { /* multi-texture and/or separate specular color */ USE(multitextured_line); } |