diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-03-02 16:32:50 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-03-02 16:32:50 +0000 |
commit | 60edc4395bf0a4d758ec6e7cfa1b985ab61dc36f (patch) | |
tree | e41be68970fdbdb51e9a3f2ba4895d2c032cfc1c | |
parent | fae20567c2c98332e2a424f61578777bcf6e22af (diff) |
Using glColor3 commands to update materials could result in an undefined
alpha value. Fixed.
-rw-r--r-- | src/mesa/tnl/t_vb_light.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index cd5792e458..1a89bf311a 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -1,8 +1,8 @@ /* * Mesa 3-D graphics library - * Version: 6.1 + * Version: 6.2.2 * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -50,6 +50,7 @@ struct material_cursor { const GLfloat *ptr; GLuint stride; GLfloat *current; + GLuint size; /* 1, 2, 3 or 4 */ }; struct light_stage_data { @@ -79,7 +80,7 @@ static void update_materials( GLcontext *ctx, GLuint i; for (i = 0 ; i < store->mat_count ; i++) { - COPY_4V(store->mat[i].current, store->mat[i].ptr); + COPY_CLEAN_4V(store->mat[i].current, store->mat[i].size, store->mat[i].ptr); STRIDE_F(store->mat[i].ptr, store->mat[i].stride); } @@ -110,8 +111,9 @@ static GLuint prepare_materials( GLcontext *ctx, if (VB->AttribPtr[i]->stride) { GLuint j = store->mat_count++; GLuint attr = i - _TNL_ATTRIB_MAT_FRONT_AMBIENT; - store->mat[j].ptr = VB->AttribPtr[i]->start; + store->mat[j].ptr = VB->AttribPtr[i]->start; store->mat[j].stride = VB->AttribPtr[i]->stride; + store->mat[j].size = VB->AttribPtr[i]->size; store->mat[j].current = ctx->Light.Material.Attrib[attr]; store->mat_bitmask |= (1<<attr); } @@ -344,7 +346,7 @@ static void dtr( struct tnl_pipeline_stage *stage ) _mesa_vector4f_free( &store->LitIndex[0] ); _mesa_vector4f_free( &store->LitIndex[1] ); FREE( store ); - stage->privatePtr = 0; + stage->privatePtr = NULL; } } |