-/* $Id: attrib.c,v 1.2 1999/09/16 11:54:56 keithw Exp $ */
+/* $Id: attrib.c,v 1.10 1999/11/08 15:28:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
-
+#include <stdlib.h>
#ifdef PC_HEADER
#include "all.h"
#else
-#include <stdlib.h>
+#ifndef XFree86Server
#include <stdio.h>
-#include <string.h>
+#else
+#include "GL/xf86glx.h"
+#endif
#include "attrib.h"
#include "context.h"
+#include "glmisc.h"
#include "enable.h"
#include "enums.h"
#include "macros.h"
-#include "misc.h"
#include "simple_list.h"
#include "texstate.h"
#include "types.h"
-#ifdef XFree86Server
-#undef MISC_H
-#include "GL/xf86glx.h"
-#endif
#endif
-#define MALLOC_STRUCT(T) (struct T *) malloc( sizeof(struct T) )
-
/*
*/
static struct gl_attrib_node *new_attrib_node( GLbitfield kind )
{
- struct gl_attrib_node *an;
-
- an = (struct gl_attrib_node *) malloc( sizeof(struct gl_attrib_node) );
+ struct gl_attrib_node *an = MALLOC_STRUCT(gl_attrib_node);
if (an) {
an->kind = kind;
}
if (mask & GL_POLYGON_STIPPLE_BIT) {
GLuint *stipple;
- stipple = (GLuint *) malloc( 32*sizeof(GLuint) );
+ stipple = (GLuint *) MALLOC( 32*sizeof(GLuint) );
MEMCPY( stipple, ctx->PolygonStipple, 32*sizeof(GLuint) );
newnode = new_attrib_node( GL_POLYGON_STIPPLE_BIT );
newnode->data = stipple;
}
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL);
TEST_AND_UPDATE(ctx->Polygon.CullFlag, enable->CullFace, GL_CULL_FACE);
+ TEST_AND_UPDATE(ctx->Depth.Test, enable->DepthTest, GL_DEPTH_TEST);
TEST_AND_UPDATE(ctx->Color.DitherFlag, enable->Dither, GL_DITHER);
TEST_AND_UPDATE(ctx->Fog.Enabled, enable->Fog, GL_FOG);
TEST_AND_UPDATE(ctx->Light.Enabled, enable->Lighting, GL_LIGHTING);
break;
case GL_FOG_BIT:
{
- GLboolean anyChange = (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
+ GLboolean anyChange = (GLboolean) (memcmp( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) ) != 0);
MEMCPY( &ctx->Fog, attr->data, sizeof(struct gl_fog_attrib) );
if (anyChange && ctx->Driver.Fogfv) {
- const GLfloat mode = ctx->Fog.Mode;
+ const GLfloat mode = (GLfloat) ctx->Fog.Mode;
const GLfloat density = ctx->Fog.Density;
const GLfloat start = ctx->Fog.Start;
const GLfloat end = ctx->Fog.End;
(*ctx->Driver.ClearStencil)( ctx, ctx->Stencil.Clear );
if (ctx->Driver.Enable)
(*ctx->Driver.Enable)( ctx, GL_STENCIL_TEST, ctx->Stencil.Enabled );
-/* ctx->TriangleCaps &= ~DD_STENCIL; */
-/* if (ctx->Stencil.Enabled) */
-/* ctx->TriangleCaps |= DD_STENCIL; */
+ ctx->TriangleCaps &= ~DD_STENCIL;
+ if (ctx->Stencil.Enabled)
+ ctx->TriangleCaps |= DD_STENCIL;
break;
case GL_TRANSFORM_BIT:
}
next = attr->next;
- free( (void *) attr->data );
- free( (void *) attr );
+ FREE( attr->data );
+ FREE( attr );
attr = next;
}
}
next = attr->next;
- free( (void *) attr->data );
- free( (void *) attr );
+ FREE( attr->data );
+ FREE( attr );
attr = next;
}