diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2001-02-15 01:33:52 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2001-02-15 01:33:52 +0000 |
commit | c6b2a92613a5110dbf387721af8ec505744183b9 (patch) | |
tree | 00358af747ddad95ba79c8649b39329e48b2cfd1 /src/mesa/tnl/t_imm_api.c | |
parent | 4e52e192b2507a001817c8172713016cef69206b (diff) |
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.
Diffstat (limited to 'src/mesa/tnl/t_imm_api.c')
-rw-r--r-- | src/mesa/tnl/t_imm_api.c | 21 |
1 files changed, 14 insertions, 7 deletions
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]; |