diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2001-01-24 00:04:58 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2001-01-24 00:04:58 +0000 |
commit | 74b493a5e61237de081a438e774e5d8139d4c6b7 (patch) | |
tree | a8bc94a65bacc67b9b1473f91a2bd84cd2b25937 /src/mesa/tnl/t_array_import.c | |
parent | 125fddc31dc9959901d9f1ece693b09f04426d48 (diff) |
Lots of GLchan datatype changes.
Added GLvector4us datatype in math/m_vector.[ch]
Added _math_trans_4us() in math/m_translate.[ch]
Choose GLvector4ub, GLvector4us, GLvector4f at compile time based on CHAN_BITS.
Made Driver.ClearColor() and Driver.ClearIndex() optional driver functions.
Changed args to Driver.ClearColor(), updated drivers.
Reordered files in Makefile.X11
Diffstat (limited to 'src/mesa/tnl/t_array_import.c')
-rw-r--r-- | src/mesa/tnl/t_array_import.c | 40 |
1 files changed, 36 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 0379bd402b..b88391c852 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -1,4 +1,4 @@ -/* $Id: t_array_import.c,v 1.6 2001/01/08 21:56:00 keithw Exp $ */ +/* $Id: t_array_import.c,v 1.7 2001/01/24 00:04:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -107,10 +107,10 @@ static void _tnl_import_color( GLcontext *ctx, &is_writeable); inputs->Color.data = tmp->Ptr; - inputs->Color.start = (GLubyte *)tmp->Ptr; + inputs->Color.start = (GLchan *)tmp->Ptr; inputs->Color.stride = tmp->StrideB; inputs->Color.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE); - if (inputs->Color.stride != 4*sizeof(GLubyte)) + if (inputs->Color.stride != 4*sizeof(GLchan)) inputs->Color.flags |= VEC_BAD_STRIDE; if (!is_writeable) inputs->Color.flags |= VEC_NOT_WRITEABLE; @@ -132,7 +132,7 @@ static void _tnl_import_secondarycolor( GLcontext *ctx, &is_writeable); inputs->SecondaryColor.data = tmp->Ptr; - inputs->SecondaryColor.start = (GLubyte *)tmp->Ptr; + inputs->SecondaryColor.start = (GLchan *)tmp->Ptr; inputs->SecondaryColor.stride = tmp->StrideB; inputs->SecondaryColor.flags &= ~(VEC_BAD_STRIDE|VEC_NOT_WRITEABLE); if (inputs->SecondaryColor.stride != 4*sizeof(GLubyte)) @@ -464,21 +464,53 @@ void _tnl_fill_immediate_drawarrays( GLcontext *ctx, struct immediate *IM, } if (required & VERT_RGBA) { +#if CHAN_TYPE == GL_UNSIGNED_BYTE _math_trans_4ub( IM->Color + IM->Start, ctx->Array.Color.Ptr, ctx->Array.Color.StrideB, ctx->Array.Color.Type, ctx->Array.Color.Size, start, n ); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + _math_trans_4us( IM->Color + IM->Start, + ctx->Array.Color.Ptr, + ctx->Array.Color.StrideB, + ctx->Array.Color.Type, + ctx->Array.Color.Size, + start, n ); +#elif CHAN_TYPE == GL_FLOAT + _math_trans_4f( IM->Color + IM->Start, + ctx->Array.Color.Ptr, + ctx->Array.Color.StrideB, + ctx->Array.Color.Type, + ctx->Array.Color.Size, + start, n ); +#endif } if (required & VERT_SPEC_RGB) { +#if CHAN_TYPE == GL_UNSIGNED_BYTE _math_trans_4ub( IM->SecondaryColor + IM->Start, ctx->Array.SecondaryColor.Ptr, ctx->Array.SecondaryColor.StrideB, ctx->Array.SecondaryColor.Type, ctx->Array.SecondaryColor.Size, start, n ); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + _math_trans_4us( IM->SecondaryColor + IM->Start, + ctx->Array.SecondaryColor.Ptr, + ctx->Array.SecondaryColor.StrideB, + ctx->Array.SecondaryColor.Type, + ctx->Array.SecondaryColor.Size, + start, n ); +#elif CHAN_TYPE == GL_FLOAT + _math_trans_4f( IM->SecondaryColor + IM->Start, + ctx->Array.SecondaryColor.Ptr, + ctx->Array.SecondaryColor.StrideB, + ctx->Array.SecondaryColor.Type, + ctx->Array.SecondaryColor.Size, + start, n ); +#endif } if (required & VERT_FOG_COORD) { |