diff options
Diffstat (limited to 'src/mesa/tnl/t_vb_light.c')
-rw-r--r-- | src/mesa/tnl/t_vb_light.c | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 60a87ef8abd..a4f7cfa3c31 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,4 +1,4 @@ -/* $Id: t_vb_light.c,v 1.4 2001/01/23 23:39:37 brianp Exp $ */ +/* $Id: t_vb_light.c,v 1.5 2001/01/24 00:04:59 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -49,10 +49,17 @@ typedef void (*light_func)( GLcontext *ctx, GLvector4f *input ); struct light_stage_data { +#if CHAN_TYPE == GL_UNSIGNED_BYTE GLvector4ub LitColor[2]; - GLvector1ui LitIndex[2]; GLvector4ub LitSecondary[2]; - +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + GLvector4us LitColor[2]; + GLvector4us LitSecondary[2]; +#elif CHAN_TYPE == GL_FLOAT + GLvector4f LitColor[2]; + GLvector4f LitSecondary[2]; +#endif + GLvector1ui LitIndex[2]; light_func *light_func_tab; }; @@ -216,10 +223,22 @@ static GLboolean run_init_lighting( GLcontext *ctx, */ init_lighting(); +#if CHAN_TYPE == GL_UNSIGNED_BYTE gl_vector4ub_alloc( &store->LitColor[0], 0, size, 32 ); gl_vector4ub_alloc( &store->LitColor[1], 0, size, 32 ); gl_vector4ub_alloc( &store->LitSecondary[0], 0, size, 32 ); gl_vector4ub_alloc( &store->LitSecondary[1], 0, size, 32 ); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + gl_vector4us_alloc( &store->LitColor[0], 0, size, 32 ); + gl_vector4us_alloc( &store->LitColor[1], 0, size, 32 ); + gl_vector4us_alloc( &store->LitSecondary[0], 0, size, 32 ); + gl_vector4us_alloc( &store->LitSecondary[1], 0, size, 32 ); +#elif CHAN_TYPE == GL_FLOAT + gl_vector4f_alloc( &store->LitColor[0], 0, size, 32 ); + gl_vector4f_alloc( &store->LitColor[1], 0, size, 32 ); + gl_vector4f_alloc( &store->LitSecondary[0], 0, size, 32 ); + gl_vector4f_alloc( &store->LitSecondary[1], 0, size, 32 ); +#endif gl_vector1ui_alloc( &store->LitIndex[0], 0, size, 32 ); gl_vector1ui_alloc( &store->LitIndex[1], 0, size, 32 ); @@ -259,12 +278,24 @@ static void dtr( struct gl_pipeline_stage *stage ) struct light_stage_data *store = LIGHT_STAGE_DATA(stage); if (store) { +#if CHAN_TYPE == GL_UNSIGNED_BYTE gl_vector4ub_free( &store->LitColor[0] ); gl_vector4ub_free( &store->LitColor[1] ); - gl_vector1ui_free( &store->LitIndex[0] ); - gl_vector1ui_free( &store->LitIndex[1] ); gl_vector4ub_free( &store->LitSecondary[0] ); gl_vector4ub_free( &store->LitSecondary[1] ); +#elif CHAN_TYPE == GL_UNSIGNED_SHORT + gl_vector4us_free( &store->LitColor[0] ); + gl_vector4us_free( &store->LitColor[1] ); + gl_vector4us_free( &store->LitSecondary[0] ); + gl_vector4us_free( &store->LitSecondary[1] ); +#elif CHAN_TYPE == GL_FLOAT + gl_vector4f_free( &store->LitColor[0] ); + gl_vector4f_free( &store->LitColor[1] ); + gl_vector4f_free( &store->LitSecondary[0] ); + gl_vector4f_free( &store->LitSecondary[1] ); +#endif + gl_vector1ui_free( &store->LitIndex[0] ); + gl_vector1ui_free( &store->LitIndex[1] ); FREE( store ); stage->private = 0; } |