From 6dc85575000127630489b407c50a4b3ea87c9acb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 17 Jul 2003 13:43:59 +0000 Subject: Merge Jose's documentation and core Mesa changes from embedded branch --- src/mesa/main/colortab.c | 66 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 20 deletions(-) (limited to 'src/mesa/main/colortab.c') diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 78ef93caa6..9a1734bf4b 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -92,26 +92,6 @@ base_colortab_format( GLenum format ) } -void -_mesa_init_colortable( struct gl_color_table *p ) -{ - p->FloatTable = GL_FALSE; - p->Table = NULL; - p->Size = 0; - p->IntFormat = GL_RGBA; -} - - - -void -_mesa_free_colortable_data( struct gl_color_table *p ) -{ - if (p->Table) { - FREE(p->Table); - p->Table = NULL; - } -} - /* * Examine table's format and set the component sizes accordingly. @@ -1345,3 +1325,49 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) return; } } + +/**********************************************************************/ +/***** Initialization *****/ +/**********************************************************************/ + + +void +_mesa_init_one_colortable( struct gl_color_table *p ) +{ + p->FloatTable = GL_FALSE; + p->Table = NULL; + p->Size = 0; + p->IntFormat = GL_RGBA; +} + + + +void +_mesa_free_one_colortable( struct gl_color_table *p ) +{ + if (p->Table) { + FREE(p->Table); + p->Table = NULL; + } +} + +void _mesa_init_colortable( GLcontext * ctx ) +{ + /* Color tables */ + _mesa_init_one_colortable(&ctx->ColorTable); + _mesa_init_one_colortable(&ctx->ProxyColorTable); + _mesa_init_one_colortable(&ctx->PostConvolutionColorTable); + _mesa_init_one_colortable(&ctx->ProxyPostConvolutionColorTable); + _mesa_init_one_colortable(&ctx->PostColorMatrixColorTable); + _mesa_init_one_colortable(&ctx->ProxyPostColorMatrixColorTable); +} + +void _mesa_free_colortable_data( GLcontext *ctx ) +{ + _mesa_free_one_colortable( &ctx->ColorTable ); + _mesa_free_one_colortable( &ctx->ProxyColorTable ); + _mesa_free_one_colortable( &ctx->PostConvolutionColorTable ); + _mesa_free_one_colortable( &ctx->ProxyPostConvolutionColorTable ); + _mesa_free_one_colortable( &ctx->PostColorMatrixColorTable ); + _mesa_free_one_colortable( &ctx->ProxyPostColorMatrixColorTable ); +} -- cgit v1.2.3