1
0
Fork 0

Changes to support new gpc api with hole tracking support.

This commit is contained in:
curt 1999-04-16 00:00:42 +00:00
parent 1b3d52b21f
commit 20228603ed
2 changed files with 9 additions and 9 deletions

View file

@ -119,7 +119,7 @@ bool FGClipper::load_polys(const string& path) {
<< lastx << ", " << lasty );
}
gpc_add_contour( poly, &v_list );
gpc_add_contour( poly, &v_list, 0 );
}
@ -172,7 +172,7 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
polys_in.safety_base.num_contours = 0;
polys_in.safety_base.contour = NULL;
gpc_add_contour( &polys_in.safety_base, &v_list );
gpc_add_contour( &polys_in.safety_base, &v_list, 0 );
// process polygons in priority order
for ( int i = 0; i < FG_MAX_AREA_TYPES; ++i ) {
@ -206,11 +206,11 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
// << endl;
// tmp output accum
FILE *ofp= fopen("tmp-debug", "w");
gpc_write_polygon(ofp, &tmp);
gpc_write_polygon(ofp, 1, &tmp);
fclose(ofp);
ofp= fopen("accum-debug", "w");
gpc_write_polygon(ofp, &accum);
gpc_write_polygon(ofp, 1, &accum);
fclose(ofp);
gpc_polygon_clip(GPC_DIFF, &tmp, &accum, result_diff);
@ -259,12 +259,12 @@ bool FGClipper::clip_all(const point2d& min, const point2d& max) {
// tmp output accum
FILE *ofp= fopen("accum", "w");
gpc_write_polygon(ofp, &accum);
gpc_write_polygon(ofp, 1, &accum);
fclose(ofp);
// tmp output safety_base
ofp= fopen("remains", "w");
gpc_write_polygon(ofp, remains);
gpc_write_polygon(ofp, 1, remains);
fclose(ofp);
return true;

View file

@ -93,7 +93,7 @@ static void clip_and_write_poly( string root, long int p_index, AreaType area,
base.num_contours = 0;
base.contour = NULL;
gpc_add_contour( &base, &v_list );
gpc_add_contour( &base, &v_list, 0 );
// FG_LOG( FG_GENERAL, FG_DEBUG, "base = 4 vertices" );
@ -126,7 +126,7 @@ static void clip_and_write_poly( string root, long int p_index, AreaType area,
FILE *rfp= fopen( polyfile.c_str(), "w" );
fprintf( rfp, "%s\n", poly_type.c_str() );
gpc_write_polygon( rfp, &result );
gpc_write_polygon( rfp, 1, &result );
fclose( rfp );
}
@ -160,7 +160,7 @@ void add_to_shape(int count, double *coords, gpc_polygon *shape) {
}
v_list.num_vertices = count;
gpc_add_contour( shape, &v_list );
gpc_add_contour( shape, &v_list, 0 );
}