diff options
author | Keith Whitwell <[email protected]> | 2001-02-16 18:14:41 +0000 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2001-02-16 18:14:41 +0000 |
commit | 46b0988c673b28e072fd0cbf477632a9ab6f9f18 (patch) | |
tree | 3463116da957c6f13dcb0b415ca8476640503fc7 /src/mesa/swrast/s_lines.c | |
parent | 2448fc7deeaa870d879de17158f243f239c05b15 (diff) |
Allow swrast to cope (fairly) cleanly with GL_SEPERATE_SPECULAR when
texturing is not enabled, and without requiring the two colors be
added externally.
As a part of this, collapsed the decomposition of quads into triangles
inside swrast to be hardwired into _swrast_Quad; removed s_quads.[ch].
Removed checks on texture state from t_vb_light.c, which was previously
required by swrast.
Moved the t_dd_ templates to a new directory.
Diffstat (limited to 'src/mesa/swrast/s_lines.c')
-rw-r--r-- | src/mesa/swrast/s_lines.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_lines.c b/src/mesa/swrast/s_lines.c index d448bd59e4e..af62dba3d99 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.10 2001/01/23 23:39:37 brianp Exp $ */ +/* $Id: s_lines.c,v 1.11 2001/02/16 18:14:41 keithw Exp $ */ /* * Mesa 3-D graphics library @@ -26,6 +26,7 @@ #include "glheader.h" +#include "colormac.h" #include "macros.h" #include "mmath.h" #include "s_aaline.h" @@ -909,6 +910,22 @@ static void flat_multitextured_line( GLcontext *ctx, } +void _swrast_add_spec_terms_line( GLcontext *ctx, + const SWvertex *v0, + const SWvertex *v1 ) +{ + SWvertex *ncv0 = (SWvertex *)v0; + SWvertex *ncv1 = (SWvertex *)v1; + GLchan c[2][4]; + COPY_CHAN4( c[0], ncv0->color ); + COPY_CHAN4( c[1], ncv1->color ); + ACC_3V( ncv0->color, ncv0->specular ); + ACC_3V( ncv1->color, ncv1->specular ); + SWRAST_CONTEXT(ctx)->SpecLine( ctx, ncv0, ncv1 ); + COPY_CHAN4( ncv0->color, c[0] ); + COPY_CHAN4( ncv1->color, c[1] ); +} + #ifdef DEBUG extern void @@ -978,9 +995,8 @@ _swrast_choose_line( GLcontext *ctx ) ASSERT(swrast->Triangle); } else if (ctx->Texture._ReallyEnabled) { - if (swrast->_MultiTextureEnabled - || ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR - || ctx->Fog.ColorSumEnabled) { + if (swrast->_MultiTextureEnabled || + (ctx->_TriangleCaps & DD_SEPERATE_SPECULAR)) { /* multi-texture and/or separate specular color */ if (ctx->Light.ShadeModel==GL_SMOOTH) swrast->Line = smooth_multitextured_line; |