-/* $Id: tess.c,v 1.13 1999/10/11 17:53:09 gareth Exp $ */
+/* $Id: tess.c,v 1.14 1999/10/12 18:49:28 gareth Exp $ */
/*
* Mesa 3-D graphics library
/*
* $Log: tess.c,v $
+ * Revision 1.14 1999/10/12 18:49:28 gareth
+ * Updated memory allocation to allow new macros to be used.
+ *
* Revision 1.13 1999/10/11 17:53:09 gareth
* Renamed GLUtesselator user data pointer to avoid confusion.
*
DEBUGP( 15, ( "-> gluNewTess()\n" ) );
- if ( ( tobj = (GLUtesselator *)
- malloc( sizeof(GLUtesselator) ) ) == NULL )
- {
+ tobj = malloc( sizeof(GLUtesselator) );
+ if ( tobj == NULL ) {
return NULL;
}
return;
}
- if ( ( tobj->current_contour =
- (tess_contour_t *) malloc( sizeof(tess_contour_t) ) ) == NULL )
- {
- DEBUGP( 0, ( "*** memory error ***\n" ) );
+ tobj->current_contour = malloc( sizeof(tess_contour_t) );
+ if ( tobj->current_contour == NULL ) {
tess_error_callback( tobj, GLU_OUT_OF_MEMORY );
return;
}
if ( last_vertex == NULL )
{
- if ( ( last_vertex = (tess_vertex_t *)
- malloc( sizeof(tess_vertex_t) ) ) == NULL )
- {
- DEBUGP( 0, ( "*** memory error ***\n" ) );
+ last_vertex = malloc( sizeof(tess_vertex_t) );
+ if ( last_vertex == NULL ) {
tess_error_callback( tobj, GLU_OUT_OF_MEMORY );
return;
}
{
tess_vertex_t *vertex;
- if ( ( vertex = (tess_vertex_t *)
- malloc( sizeof(tess_vertex_t) ) ) == NULL )
- {
- DEBUGP( 0, ( "*** memory error ***\n" ) );
+ vertex = malloc( sizeof(tess_vertex_t) );
+ if ( vertex == NULL ) {
tess_error_callback( tobj, GLU_OUT_OF_MEMORY );
return;
}
tobj->last_contour->next = tobj->contours;
tobj->contours->previous = tobj->last_contour;
- /* tess_find_contour_hierarchies(tobj); */
-
- TESS_CHECK_ERRORS( tobj );
-
- /* tess_handle_holes(tobj); */
-
TESS_CHECK_ERRORS( tobj );
/*
( ( tobj->callbacks.end != NULL ) ||
( tobj->callbacks.endData != NULL ) ) )
{
- if ( ( tobj->callbacks.edgeFlag == NULL ) &&
- ( tobj->callbacks.edgeFlagData == NULL ) )
- {
- fist_tessellation( tobj );
- }
- else
- {
- fist_tessellation( tobj );
- }
+ fist_tessellation( tobj );
}
cleanup:
{
DEBUGP( 15, ( " -> tess_cleanup( tobj:%p )\n", tobj ) );
- if ( tobj->current_contour != NULL )
- {
+ if ( tobj->current_contour != NULL ) {
delete_current_contour( tobj );
}
-
- if ( tobj->contours != NULL )
- {
+ if ( tobj->contours != NULL ) {
delete_all_contours( tobj );
}
tess_vertex_t *vertex, *next_vertex;
GLuint i;
- if ( current != NULL )
- {
+ if ( current != NULL ) {
delete_current_contour( tobj );
}