summaryrefslogtreecommitdiff
path: root/src/mesa/tnl/t_vb_light.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2001-01-24 00:04:58 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2001-01-24 00:04:58 +0000
commit74b493a5e61237de081a438e774e5d8139d4c6b7 (patch)
treea8bc94a65bacc67b9b1473f91a2bd84cd2b25937 /src/mesa/tnl/t_vb_light.c
parent125fddc31dc9959901d9f1ece693b09f04426d48 (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_vb_light.c')
-rw-r--r--src/mesa/tnl/t_vb_light.c41
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 60a87ef8ab..a4f7cfa3c3 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;
}