diff options
author | Brian <[email protected]> | 2007-03-26 11:30:05 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-03-26 11:30:05 -0600 |
commit | 38a1c2b4959d35236933c14d3944cce94283ca30 (patch) | |
tree | c82629e61cc04ad279deaeae578bc5e584d425ce /src/mesa/swrast/s_span.c | |
parent | b5d988dd19291e4e1e6f18e4163c2acac66729de (diff) |
Add _swrast_span_default_secondary_color() for use with glBitmap, glDrawPixels, etc.
Secondary color wasn't getting added to post-texture color when drawing
bitmaps, images. See bug 10409.
Diffstat (limited to 'src/mesa/swrast/s_span.c')
-rw-r--r-- | src/mesa/swrast/s_span.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index fa7761269d9..dab3d548fc9 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -121,6 +121,35 @@ _swrast_span_default_color( GLcontext *ctx, SWspan *span ) } +void +_swrast_span_default_secondary_color(GLcontext *ctx, SWspan *span) +{ + if (ctx->Visual.rgbMode) { + GLchan r, g, b, a; + UNCLAMPED_FLOAT_TO_CHAN(r, ctx->Current.RasterSecondaryColor[0]); + UNCLAMPED_FLOAT_TO_CHAN(g, ctx->Current.RasterSecondaryColor[1]); + UNCLAMPED_FLOAT_TO_CHAN(b, ctx->Current.RasterSecondaryColor[2]); + UNCLAMPED_FLOAT_TO_CHAN(a, ctx->Current.RasterSecondaryColor[3]); +#if CHAN_TYPE == GL_FLOAT + span->specRed = r; + span->specGreen = g; + span->specBlue = b; + /8span->specAlpha = a;*/ +#else + span->specRed = IntToFixed(r); + span->specGreen = IntToFixed(g); + span->specBlue = IntToFixed(b); + /*span->specAlpha = IntToFixed(a);*/ +#endif + span->specRedStep = 0; + span->specGreenStep = 0; + span->specBlueStep = 0; + /*span->specAlphaStep = 0;*/ + span->interpMask |= SPAN_SPEC; + } +} + + /** * Init span's texcoord interpolation values to the RasterPos texcoords. * Used during setup for glDraw/CopyPixels. |