From c6b2a92613a5110dbf387721af8ec505744183b9 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 15 Feb 2001 01:33:52 +0000 Subject: Fix propogation of material values in VB's that don't reach the lighting stage. (Materials now treated more like colors, etc.). Continue whipping the dd templates into shape. Remove old NormalLength code; may come back as a driver helper, but not useful for, eg. hardware t&l drivers. --- src/mesa/tnl/t_imm_api.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/mesa/tnl/t_imm_api.c') diff --git a/src/mesa/tnl/t_imm_api.c b/src/mesa/tnl/t_imm_api.c index 0ba46b9b7c..5dd287cedc 100644 --- a/src/mesa/tnl/t_imm_api.c +++ b/src/mesa/tnl/t_imm_api.c @@ -1229,17 +1229,24 @@ _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) if (bitmask == 0) return; - if (!IM->Material) { - IM->Material = (GLmaterial (*)[2]) MALLOC( sizeof(GLmaterial) * - IMM_SIZE * 2 ); - IM->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE ); - } - if (!(IM->Flag[count] & VERT_MATERIAL)) { + if (!IM->Material) { + IM->Material = (GLmaterial (*)[2]) MALLOC( sizeof(GLmaterial) * + IMM_SIZE * 2 ); + IM->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * IMM_SIZE ); + } + else if (IM->MaterialOrMask & ~bitmask) { + gl_copy_material_pairs( IM->Material[count], + IM->Material[IM->LastMaterial], + IM->MaterialOrMask & ~bitmask ); + } + IM->Flag[count] |= VERT_MATERIAL; + IM->LastMaterial = count; IM->MaterialMask[count] = 0; } - + + IM->MaterialOrMask |= bitmask; IM->MaterialMask[count] |= bitmask; mat = IM->Material[count]; -- cgit v1.2.3