/*
* Mesa 3-D graphics library
- * Version: 6.5
+ * Version: 6.5.1
*
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
*
}
+/**
+ * Lookup function to just encapsulate casting.
+ */
+static INLINE struct mesa_display_list *
+lookup_list(GLcontext *ctx, GLuint list)
+{
+ return (struct mesa_display_list *)
+ _mesa_HashLookup(ctx->Shared->DisplayList, list);
+}
+
+
/**
- * Destroy all nodes in a display list.
- * \param list - display list number
+ * Delete the named display list, but don't remove from hash table.
+ * \param dlist - display list pointer
*/
void
-_mesa_destroy_list(GLcontext *ctx, GLuint list)
+_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist)
{
- struct mesa_display_list *dlist;
Node *n, *block;
GLboolean done;
- if (list == 0)
- return;
-
- dlist =
- (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
- list);
- if (!dlist)
- return;
-
n = block = dlist->node;
done = block ? GL_FALSE : GL_TRUE;
}
_mesa_free(dlist);
- _mesa_HashRemove(ctx->Shared->DisplayList, list);
}
+/**
+ * Destroy a display list and remove from hash table.
+ * \param list - display list number
+ */
+static void
+destroy_list(GLcontext *ctx, GLuint list)
+{
+ struct mesa_display_list *dlist;
+
+ if (list == 0)
+ return;
+
+ dlist = lookup_list(ctx, list);
+ if (!dlist)
+ return;
+
+ _mesa_delete_list(ctx, dlist);
+ _mesa_HashRemove(ctx->Shared->DisplayList, list);
+}
+
/*
* Translate the nth element of list from type to GLuint.
static GLboolean
islist(GLcontext *ctx, GLuint list)
{
- if (list > 0 && _mesa_HashLookup(ctx->Shared->DisplayList, list)) {
+ if (list > 0 && lookup_list(ctx, list)) {
return GL_TRUE;
}
else {
return;
}
-
- dlist =
- (struct mesa_display_list *) _mesa_HashLookup(ctx->Shared->DisplayList,
- list);
+ dlist = lookup_list(ctx, list);
if (!dlist)
return;
return;
}
for (i = list; i < list + range; i++) {
- _mesa_destroy_list(ctx, i);
+ destroy_list(ctx, i);
}
}
(void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0);
/* Destroy old list, if any */
- _mesa_destroy_list(ctx, ctx->ListState.CurrentListNum);
+ destroy_list(ctx, ctx->ListState.CurrentListNum);
/* Install the list */
_mesa_HashInsert(ctx->Shared->DisplayList, ctx->ListState.CurrentListNum,
ctx->ListState.CurrentList);
return;
}
- dlist = (struct mesa_display_list *)
- _mesa_HashLookup(ctx->Shared->DisplayList, list);
+ dlist = lookup_list(ctx, list);
if (!dlist)
return;
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.5.1
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2006 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"),
#if _HAVE_FULL_GL
-extern void _mesa_destroy_list( GLcontext *ctx, GLuint list );
+extern void
+_mesa_delete_list(GLcontext *ctx, struct mesa_display_list *dlist);
extern void GLAPIENTRY _mesa_CallList( GLuint list );
#else
-/** No-op */
-#define _mesa_destroy_list(c,l) ((void)0)
-
/** No-op */
#define _mesa_init_dlist_table(t,ts) ((void)0)