-/* $Id: context.c,v 1.92 2000/10/09 22:42:40 brianp Exp $ */
+/* $Id: context.c,v 1.93 2000/10/20 19:54:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
ASSIGN_3V( ctx->Current.Normal, 0.0, 0.0, 1.0 );
ctx->Current.Primitive = (GLenum) (GL_POLYGON + 1);
- ctx->Current.Flag = (VERT_NORM|VERT_INDEX|VERT_RGBA|VERT_EDGE|
- VERT_TEX0_1|VERT_TEX1_1|VERT_MATERIAL);
+ ctx->Current.Flag = (VERT_NORM |
+ VERT_INDEX |
+ VERT_RGBA |
+ VERT_EDGE |
+ VERT_TEX0_1 |
+ VERT_TEX1_1 |
+ VERT_TEX2_1 | /* XXX fix for MAX_TEXTURE_UNITS > 3 */
+ VERT_MATERIAL);
init_fallback_arrays( ctx );
-/* $Id: lines.c,v 1.15 2000/09/30 18:42:29 brianp Exp $ */
+/* $Id: lines.c,v 1.16 2000/10/20 19:54:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* antialiased lines */
if (rgbmode) {
if (ctx->Texture.ReallyEnabled) {
- if (ctx->Texture.ReallyEnabled >= TEXTURE1_1D
+ if (ctx->Texture.MultiTextureEnabled
|| ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR)
/* Multitextured! */
ctx->Driver.LineFunc = aa_multitex_rgba_line;
}
}
else if (ctx->Texture.ReallyEnabled) {
- if (ctx->Texture.ReallyEnabled >= TEXTURE1_1D
+ if (ctx->Texture.MultiTextureEnabled
|| ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
/* multi-texture and/or separate specular color */
if (ctx->Light.ShadeModel==GL_SMOOTH)
-/* $Id: points.c,v 1.14 2000/09/29 16:58:44 brianp Exp $ */
+/* $Id: points.c,v 1.15 2000/10/20 19:54:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
/* coverage is in [0,256] */
alpha = (alpha * coverage) >> 8;
}
- if (ctx->Texture.ReallyEnabled >= TEXTURE1_1D) {
+ if (ctx->Texture.MultiTextureEnabled) {
PB_WRITE_MULTITEX_PIXEL( PB, x,y,z, red, green, blue,
alpha, texcoord );
}
for (iy = y0; iy <= y1; iy++) {
for (ix = x0; ix <= x1; ix++) {
- if (ctx->Texture.ReallyEnabled >= TEXTURE1_1D) {
+ if (ctx->Texture.MultiTextureEnabled) {
PB_WRITE_MULTITEX_PIXEL( PB, ix, iy, z,
red, green, blue, alpha,
texcoord );
alpha = (alpha * coverage) >> 8;
}
alpha = (GLint) (alpha * alphaf);
- if (ctx->Texture.ReallyEnabled >= TEXTURE1_1D) {
+ if (ctx->Texture.MultiTextureEnabled) {
PB_WRITE_MULTITEX_PIXEL( PB, x, y, z,
red, green, blue, alpha,
texcoord );
ctx->Driver.PointsFunc = antialiased_rgba_points;
}
else if (ctx->Texture.ReallyEnabled) {
- if (ctx->Texture.ReallyEnabled >= TEXTURE1_1D ||
+ if (ctx->Texture.MultiTextureEnabled ||
ctx->Light.Model.ColorControl==GL_SEPARATE_SPECULAR_COLOR) {
ctx->Driver.PointsFunc = multitextured_rgba_points;
}
-/* $Id: state.c,v 1.31 2000/10/18 15:02:59 brianp Exp $ */
+/* $Id: state.c,v 1.32 2000/10/20 19:54:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
}
if (ctx->NewState & (NEW_TEXTURING | NEW_TEXTURE_ENABLE)) {
+ ctx->Texture.MultiTextureEnabled = GL_FALSE;
ctx->Texture.NeedNormals = GL_FALSE;
gl_update_dirty_texobjs(ctx);
ctx->Enabled &= ~(ENABLE_TEXGEN0 | ENABLE_TEXGEN1 | ENABLE_TEXGEN2);
ctx->Texture.NeedEyeCoords = GL_TRUE;
}
}
+
+ if (i > 0 && ctx->Texture.Unit[i].ReallyEnabled) {
+ ctx->Texture.MultiTextureEnabled = GL_TRUE;
+ }
}
}
-/* $Id: varray.c,v 1.24 2000/10/18 15:02:59 brianp Exp $ */
+/* $Id: varray.c,v 1.25 2000/10/20 19:54:49 brianp Exp $ */
/*
* Mesa 3-D graphics library
#if MAX_TEXTURE_UNITS > 2
if (translate & VERT_TEX2_ANY)
- (ctx->Array.TexCoordEltFunc[1])( IM->TexCoord[2],
+ (ctx->Array.TexCoordEltFunc[2])( IM->TexCoord[2],
&ctx->Array.TexCoord[2],
flags, elts, (VERT_ELT|VERT_TEX2_ANY),
start, count);
#endif
+#if MAX_TEXTURE_UNITS > 3
+ if (translate & VERT_TEX3_ANY)
+ (ctx->Array.TexCoordEltFunc[3])( IM->TexCoord[3],
+ &ctx->Array.TexCoord[3],
+ flags, elts, (VERT_ELT|VERT_TEX3_ANY),
+ start, count);
+#endif
for (i = start ; i < count ; i++)
if (flags[i] & VERT_ELT)
TexCoord[2], start, n );
}
#endif
+#if MAX_TEXTURE_UNITS > 3
+ if (required & VERT_TEX3_ANY) {
+ IM->v.TexCoord[3].size = TexCoord[3]->Size;
+ ctx->Array.TexCoordFunc[3]( IM->TexCoord[3] + VB_START,
+ TexCoord[3], start, n );
+ }
+#endif
VB->ObjPtr = &IM->v.Obj;
VB->NormalPtr = &IM->v.Normal;