-/* $Id: t_vb_lighttmp.h,v 1.16 2001/08/02 22:39:51 keithw Exp $ */
+/* $Id: t_vb_lighttmp.h,v 1.17 2001/08/13 22:17:19 keithw Exp $ */
/*
* Mesa 3-D graphics library
# define CHECK_MATERIAL(x) (flags[x] & VERT_MATERIAL)
# define CHECK_END_VB(x) (flags[x] & VERT_END_VB)
# if (IDX & LIGHT_COLORMATERIAL)
-# define CMSTRIDE STRIDE_F(CMcolor, (4 * sizeof(GLfloat)))
+# define CMSTRIDE STRIDE_F(CMcolor, CMstride)
# define CHECK_COLOR_MATERIAL(x) (flags[x] & VERT_RGBA)
# define CHECK_VALIDATE(x) (flags[x] & (VERT_RGBA|VERT_MATERIAL))
# define DO_ANOTHER_NORMAL(x) \
spec[1] = Bspec;
if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT)
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
import_color_material( ctx, stage );
CMcolor = (GLfloat *) VB->ColorPtr[0]->Ptr;
color[1] = Bcolor;
if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT)
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
import_color_material( ctx, stage );
CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
(void) nstride;
if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT)
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
import_color_material( ctx, stage );
CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
do {
- if ( CHECK_COLOR_MATERIAL(j) )
+ if ( CHECK_COLOR_MATERIAL(j) ) {
+/* fprintf(stderr, "colormaterial at %d (%p)\n", j, CMcolor); */
_mesa_update_color_material( ctx, CMcolor );
+ }
if ( CHECK_MATERIAL(j) )
_mesa_update_material( ctx, new_material[j], new_material_mask[j] );
UNCLAMPED_FLOAT_TO_CHAN(sumA[1], ctx->Light.Material[1].Diffuse[3]);
if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT)
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
import_color_material( ctx, stage );
CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;
indexResult[1] = VB->IndexPtr[1]->data;
if (IDX & LIGHT_COLORMATERIAL) {
- if (VB->ColorPtr[0]->Type != GL_FLOAT)
+ if (VB->ColorPtr[0]->Type != GL_FLOAT ||
+ VB->ColorPtr[0]->Size != 4)
import_color_material( ctx, stage );
CMcolor = (GLfloat *)VB->ColorPtr[0]->Ptr;