* Test if ID names a display list.
*/
static GLboolean
-islist(struct gl_context *ctx, GLuint list)
+islist(struct gl_context *ctx, GLuint list,
+ struct gl_display_list ** dlist)
{
- if (list > 0 && _mesa_lookup_list(ctx, list)) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
+ struct gl_display_list * dl =
+ list > 0 ? _mesa_lookup_list(ctx, list) : NULL;
+
+ if (dlist)
+ *dlist = dl;
+
+ return dl != NULL;
}
Node *n;
GLboolean done;
- if (list == 0 || !islist(ctx, list))
+ if (list == 0 || !islist(ctx, list, &dlist))
return;
if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
return;
}
- dlist = _mesa_lookup_list(ctx, list);
- if (!dlist)
- return;
-
ctx->ListState.CallDepth++;
vbo_save_BeginCallList(ctx, dlist);
GET_CURRENT_CONTEXT(ctx);
FLUSH_VERTICES(ctx, 0); /* must be called before assert */
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
- return islist(ctx, list);
+ return islist(ctx, list, NULL);
}
return;
}
- if (!islist(ctx, list)) {
+ if (!islist(ctx, list, &dlist)) {
fprintf(f, "%u is not a display list ID\n", list);
goto out;
}
- dlist = _mesa_lookup_list(ctx, list);
- if (!dlist) {
- goto out;
- }
-
n = dlist->Head;
fprintf(f, "START-LIST %u, address %p\n", list, (void *) n);