-
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.0
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 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"),
* Keith Whitwell <keith@tungstengraphics.com>
*/
+#include "glheader.h"
#include "context.h"
#include "imports.h"
#include "mtypes.h"
#include "t_save_api.h"
#include "t_vtx_api.h"
-static GLint get_size( const GLfloat *f )
+static INLINE GLint get_size( const GLfloat *f )
{
if (f[3] != 1.0) return 4;
if (f[2] != 0.0) return 3;
* TODO - remove VB->ColorPtr, etc and just use the AttrPtr's.
*/
static void _tnl_bind_vertex_list( GLcontext *ctx,
- struct tnl_vertex_list *node )
+ const struct tnl_vertex_list *node )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
VB->IndexPtr[1] = 0;
VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1];
VB->SecondaryColorPtr[1] = 0;
+ VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG];
for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) {
VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i];
}
static void _playback_copy_to_current( GLcontext *ctx,
- struct tnl_vertex_list *node )
+ const struct tnl_vertex_list *node )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
- GLfloat *data;
+ const GLfloat *data;
GLuint i;
if (node->count)
_mesa_update_color_material(ctx, ctx->Current.Attrib[VERT_ATTRIB_COLOR0]);
}
+ if (node->have_materials) {
+ tnl->Driver.NotifyMaterialChange( ctx );
+ }
+
/* CurrentExecPrimitive
*/
if (node->prim_count) {
*/
void _tnl_playback_vertex_list( GLcontext *ctx, void *data )
{
- struct tnl_vertex_list *node = (struct tnl_vertex_list *)data;
+ const struct tnl_vertex_list *node = (const struct tnl_vertex_list *) data;
TNLcontext *tnl = TNL_CONTEXT(ctx);
FLUSH_CURRENT(ctx, 0);
- if (node->prim_count) {
+ if (node->prim_count > 0 && node->count > 0) {
if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END &&
(node->prim[0].mode & PRIM_BEGIN)) {
* includes operations such as glBegin or glDrawArrays.
*/
_mesa_error( ctx, GL_INVALID_OPERATION, "displaylist recursive begin");
- _tnl_loopback_vertex_list( ctx, data );
+ _tnl_loopback_vertex_list( ctx, node );
return;
}
else if (tnl->LoopbackDListCassettes ||
/* Degenerate case: list references current data and would
* require fixup. Take the easier option & loop it back.
*/
- _mesa_debug( 0, "%s: loopback dangling attr ref\n", __FUNCTION__);
- _tnl_loopback_vertex_list( ctx, data );
+ _tnl_loopback_vertex_list( ctx, node );
return;
}
*/
_playback_copy_to_current( ctx, node );
}
-
-
-
-
-