summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/light.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>1999-10-19 18:37:02 +0000
committerKeith Whitwell <[email protected]>1999-10-19 18:37:02 +0000
commitd471473b5842154c0b44b7bec149401f6dab43cc (patch)
tree5a6e53fde0662dcd2eb4b3455eaaf0a470126c1d /src/mesa/main/light.c
parent52880f85b5270fb156c1b75effabc9c2c8b61511 (diff)
Changes to reduce the memory footprint of display lists
Diffstat (limited to 'src/mesa/main/light.c')
-rw-r--r--src/mesa/main/light.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
index a9a125b6afd..966b548082b 100644
--- a/src/mesa/main/light.c
+++ b/src/mesa/main/light.c
@@ -1,4 +1,4 @@
-/* $Id: light.c,v 1.4 1999/10/08 09:27:11 keithw Exp $ */
+/* $Id: light.c,v 1.5 1999/10/19 18:37:04 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -664,14 +664,22 @@ void gl_Materialfv( GLcontext *ctx,
IM = ctx->input;
count = IM->Count;
+ if (!IM->Material) {
+ IM->Material =
+ (struct gl_material (*)[2]) MALLOC( sizeof(struct gl_material) *
+ VB_SIZE * 2 );
+ IM->MaterialMask = (GLuint *) MALLOC( sizeof(GLuint) * VB_SIZE );
+ }
+
+
if (!(IM->Flag[count] & VERT_MATERIAL)) {
IM->Flag[count] |= VERT_MATERIAL;
- IM->MaterialMask[count] = 0;
+ IM->MaterialMask[count] = 0;
}
+
IM->MaterialMask[count] |= bitmask;
mat = IM->Material[count];
- IM->LastMaterial = count;
if (bitmask & FRONT_AMBIENT_BIT) {
COPY_4FV( mat[0].Ambient, params );