worked on 2D/3D raytracing
adjusted BVH improved 2D/3D BVH new bounding volumes new test cases renamed some test-cases for grouping reasons made GPC header-only using slight adjustments
This commit is contained in:
@@ -54,8 +54,8 @@ Copyright: (C) Advanced Interfaces Group,
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define LEFT 0
|
||||
#define RIGHT 1
|
||||
#define GPC_LEFT 0
|
||||
#define GPC_RIGHT 1
|
||||
|
||||
#define ABOVE 0
|
||||
#define BELOW 1
|
||||
@@ -504,8 +504,8 @@ static edge_node *build_lmt(lmt_node **lmt, sb_tree **sbtree,
|
||||
&(e[i + 1]) : NULL;
|
||||
e[i].pred= ((num_edges > 1) && (i > 0)) ? &(e[i - 1]) : NULL;
|
||||
e[i].next_bound= NULL;
|
||||
e[i].bside[CLIP]= (op == GPC_DIFF) ? RIGHT : LEFT;
|
||||
e[i].bside[SUBJ]= LEFT;
|
||||
e[i].bside[CLIP]= (op == GPC_DIFF) ? GPC_RIGHT : GPC_LEFT;
|
||||
e[i].bside[SUBJ]= GPC_LEFT;
|
||||
}
|
||||
insert_bound(bound_list(lmt, edge_table[min].vertex.y), e);
|
||||
}
|
||||
@@ -554,8 +554,8 @@ static edge_node *build_lmt(lmt_node **lmt, sb_tree **sbtree,
|
||||
&(e[i + 1]) : NULL;
|
||||
e[i].pred= ((num_edges > 1) && (i > 0)) ? &(e[i - 1]) : NULL;
|
||||
e[i].next_bound= NULL;
|
||||
e[i].bside[CLIP]= (op == GPC_DIFF) ? RIGHT : LEFT;
|
||||
e[i].bside[SUBJ]= LEFT;
|
||||
e[i].bside[CLIP]= (op == GPC_DIFF) ? GPC_RIGHT : GPC_LEFT;
|
||||
e[i].bside[SUBJ]= GPC_LEFT;
|
||||
}
|
||||
insert_bound(bound_list(lmt, edge_table[min].vertex.y), e);
|
||||
}
|
||||
@@ -736,7 +736,7 @@ static int count_contours(polygon_node *polygon)
|
||||
{
|
||||
/* Count the vertices in the current contour */
|
||||
nv= 0;
|
||||
for (v= polygon->proxy->v[LEFT]; v; v= v->next)
|
||||
for (v= polygon->proxy->v[GPC_LEFT]; v; v= v->next)
|
||||
nv++;
|
||||
|
||||
/* Record valid vertex counts in the active field */
|
||||
@@ -748,7 +748,7 @@ static int count_contours(polygon_node *polygon)
|
||||
else
|
||||
{
|
||||
/* Invalid contour: just free the heap */
|
||||
for (v= polygon->proxy->v[LEFT]; v; v= nextv)
|
||||
for (v= polygon->proxy->v[GPC_LEFT]; v; v= nextv)
|
||||
{
|
||||
nextv= v->next;
|
||||
FREE(v);
|
||||
@@ -770,10 +770,10 @@ static void add_left(polygon_node *p, double x, double y)
|
||||
nv->y= y;
|
||||
|
||||
/* Add vertex nv to the left end of the polygon's vertex list */
|
||||
nv->next= p->proxy->v[LEFT];
|
||||
nv->next= p->proxy->v[GPC_LEFT];
|
||||
|
||||
/* Update proxy->[LEFT] to point to nv */
|
||||
p->proxy->v[LEFT]= nv;
|
||||
/* Update proxy->[GPC_LEFT] to point to nv */
|
||||
p->proxy->v[GPC_LEFT]= nv;
|
||||
}
|
||||
|
||||
|
||||
@@ -787,8 +787,8 @@ static void merge_left(polygon_node *p, polygon_node *q, polygon_node *list)
|
||||
if (p->proxy != q->proxy)
|
||||
{
|
||||
/* Assign p's vertex list to the left end of q's list */
|
||||
p->proxy->v[RIGHT]->next= q->proxy->v[LEFT];
|
||||
q->proxy->v[LEFT]= p->proxy->v[LEFT];
|
||||
p->proxy->v[GPC_RIGHT]->next= q->proxy->v[GPC_LEFT];
|
||||
q->proxy->v[GPC_LEFT]= p->proxy->v[GPC_LEFT];
|
||||
|
||||
/* Redirect any p->proxy references to q->proxy */
|
||||
|
||||
@@ -815,10 +815,10 @@ static void add_right(polygon_node *p, double x, double y)
|
||||
nv->next= NULL;
|
||||
|
||||
/* Add vertex nv to the right end of the polygon's vertex list */
|
||||
p->proxy->v[RIGHT]->next= nv;
|
||||
p->proxy->v[GPC_RIGHT]->next= nv;
|
||||
|
||||
/* Update proxy->v[RIGHT] to point to nv */
|
||||
p->proxy->v[RIGHT]= nv;
|
||||
/* Update proxy->v[GPC_RIGHT] to point to nv */
|
||||
p->proxy->v[GPC_RIGHT]= nv;
|
||||
}
|
||||
|
||||
|
||||
@@ -832,8 +832,8 @@ static void merge_right(polygon_node *p, polygon_node *q, polygon_node *list)
|
||||
if (p->proxy != q->proxy)
|
||||
{
|
||||
/* Assign p's vertex list to the right end of q's list */
|
||||
q->proxy->v[RIGHT]->next= p->proxy->v[LEFT];
|
||||
q->proxy->v[RIGHT]= p->proxy->v[RIGHT];
|
||||
q->proxy->v[GPC_RIGHT]->next= p->proxy->v[GPC_LEFT];
|
||||
q->proxy->v[GPC_RIGHT]= p->proxy->v[GPC_RIGHT];
|
||||
|
||||
/* Redirect any p->proxy references to q->proxy */
|
||||
for (target= p->proxy; list; list= list->next)
|
||||
@@ -869,9 +869,9 @@ static void add_local_min(polygon_node **p, edge_node *edge,
|
||||
(*p)->active= TRUE;
|
||||
(*p)->next= existing_min;
|
||||
|
||||
/* Make v[LEFT] and v[RIGHT] point to new vertex nv */
|
||||
(*p)->v[LEFT]= nv;
|
||||
(*p)->v[RIGHT]= nv;
|
||||
/* Make v[GPC_LEFT] and v[GPC_RIGHT] point to new vertex nv */
|
||||
(*p)->v[GPC_LEFT]= nv;
|
||||
(*p)->v[GPC_RIGHT]= nv;
|
||||
|
||||
/* Assign polygon p to the edge */
|
||||
edge->outp[ABOVE]= *p;
|
||||
@@ -911,10 +911,10 @@ static void new_tristrip(polygon_node **tn, edge_node *edge,
|
||||
{
|
||||
MALLOC(*tn, sizeof(polygon_node), "tristrip node creation", polygon_node);
|
||||
(*tn)->next= NULL;
|
||||
(*tn)->v[LEFT]= NULL;
|
||||
(*tn)->v[RIGHT]= NULL;
|
||||
(*tn)->v[GPC_LEFT]= NULL;
|
||||
(*tn)->v[GPC_RIGHT]= NULL;
|
||||
(*tn)->active= 1;
|
||||
add_vertex(&((*tn)->v[LEFT]), x, y);
|
||||
add_vertex(&((*tn)->v[GPC_LEFT]), x, y);
|
||||
edge->outp[ABOVE]= *tn;
|
||||
}
|
||||
else
|
||||
@@ -1125,7 +1125,7 @@ void gpc_polygon_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
polygon_node *out_poly= NULL, *p, *q, *poly, *npoly, *cf= NULL;
|
||||
vertex_node *vtx, *nv;
|
||||
h_state horiz[2];
|
||||
int in[2], exists[2], parity[2]= {LEFT, LEFT};
|
||||
int in[2], exists[2], parity[2]= {GPC_LEFT, GPC_LEFT};
|
||||
int c, v, contributing, search, scanbeam= 0, sbt_entries= 0;
|
||||
int vclass, bl, br, tl, tr;
|
||||
double *sbt= NULL, xb, px, yb, yt, dy, ix, iy;
|
||||
@@ -1178,7 +1178,7 @@ void gpc_polygon_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
|
||||
/* Invert clip polygon for difference operation */
|
||||
if (op == GPC_DIFF)
|
||||
parity[CLIP]= RIGHT;
|
||||
parity[CLIP]= GPC_RIGHT;
|
||||
|
||||
local_min= lmt;
|
||||
|
||||
@@ -1721,7 +1721,7 @@ void gpc_polygon_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
"vertex creation", gpc_vertex);
|
||||
|
||||
v= result->contour[c].num_vertices - 1;
|
||||
for (vtx= poly->proxy->v[LEFT]; vtx; vtx= nv)
|
||||
for (vtx= poly->proxy->v[GPC_LEFT]; vtx; vtx= nv)
|
||||
{
|
||||
nv= vtx->next;
|
||||
result->contour[c].vertex[v].x= vtx->x;
|
||||
@@ -1741,7 +1741,7 @@ void gpc_polygon_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
npoly= poly->next;
|
||||
FREE(poly);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Tidy up */
|
||||
reset_it(&it);
|
||||
@@ -1786,7 +1786,7 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
vertex_node *lt, *ltn, *rt, *rtn;
|
||||
h_state horiz[2];
|
||||
vertex_type cft;
|
||||
int in[2], exists[2], parity[2]= {LEFT, LEFT};
|
||||
int in[2], exists[2], parity[2]= {GPC_LEFT, GPC_LEFT};
|
||||
int s, v, contributing, search, scanbeam= 0, sbt_entries= 0;
|
||||
int vclass, bl, br, tl, tr;
|
||||
double *sbt= NULL, xb, px, nx, yb, yt, dy, ix, iy;
|
||||
@@ -1831,7 +1831,7 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
|
||||
/* Invert clip polygon for difference operation */
|
||||
if (op == GPC_DIFF)
|
||||
parity[CLIP]= RIGHT;
|
||||
parity[CLIP]= GPC_RIGHT;
|
||||
|
||||
local_min= lmt;
|
||||
|
||||
@@ -1990,17 +1990,17 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
case ERI:
|
||||
edge->outp[ABOVE]= cf->outp[ABOVE];
|
||||
if (xb != cf->xb)
|
||||
VERTEX(edge, ABOVE, RIGHT, xb, yb);
|
||||
VERTEX(edge, ABOVE, GPC_RIGHT, xb, yb);
|
||||
cf= NULL;
|
||||
break;
|
||||
case ELI:
|
||||
VERTEX(edge, BELOW, LEFT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_LEFT, xb, yb);
|
||||
edge->outp[ABOVE]= NULL;
|
||||
cf= edge;
|
||||
break;
|
||||
case EMX:
|
||||
if (xb != cf->xb)
|
||||
VERTEX(edge, BELOW, RIGHT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_RIGHT, xb, yb);
|
||||
edge->outp[ABOVE]= NULL;
|
||||
cf= NULL;
|
||||
break;
|
||||
@@ -2008,11 +2008,11 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
if (cft == LED)
|
||||
{
|
||||
if (cf->bot.y != yb)
|
||||
VERTEX(cf, BELOW, LEFT, cf->xb, yb);
|
||||
VERTEX(cf, BELOW, GPC_LEFT, cf->xb, yb);
|
||||
new_tristrip(&tlist, cf, cf->xb, yb);
|
||||
}
|
||||
edge->outp[ABOVE]= cf->outp[ABOVE];
|
||||
VERTEX(edge, ABOVE, RIGHT, xb, yb);
|
||||
VERTEX(edge, ABOVE, GPC_RIGHT, xb, yb);
|
||||
break;
|
||||
case ILI:
|
||||
new_tristrip(&tlist, edge, xb, yb);
|
||||
@@ -2023,33 +2023,33 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
if (cft == LED)
|
||||
{
|
||||
if (cf->bot.y != yb)
|
||||
VERTEX(cf, BELOW, LEFT, cf->xb, yb);
|
||||
VERTEX(cf, BELOW, GPC_LEFT, cf->xb, yb);
|
||||
new_tristrip(&tlist, cf, cf->xb, yb);
|
||||
}
|
||||
VERTEX(edge, BELOW, RIGHT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_RIGHT, xb, yb);
|
||||
edge->outp[ABOVE]= NULL;
|
||||
break;
|
||||
case IMX:
|
||||
VERTEX(edge, BELOW, LEFT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_LEFT, xb, yb);
|
||||
edge->outp[ABOVE]= NULL;
|
||||
cft= IMX;
|
||||
break;
|
||||
case IMM:
|
||||
VERTEX(edge, BELOW, LEFT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_LEFT, xb, yb);
|
||||
edge->outp[ABOVE]= cf->outp[ABOVE];
|
||||
if (xb != cf->xb)
|
||||
VERTEX(cf, ABOVE, RIGHT, xb, yb);
|
||||
VERTEX(cf, ABOVE, GPC_RIGHT, xb, yb);
|
||||
cf= edge;
|
||||
break;
|
||||
case EMM:
|
||||
VERTEX(edge, BELOW, RIGHT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_RIGHT, xb, yb);
|
||||
edge->outp[ABOVE]= NULL;
|
||||
new_tristrip(&tlist, edge, xb, yb);
|
||||
cf= edge;
|
||||
break;
|
||||
case LED:
|
||||
if (edge->bot.y == yb)
|
||||
VERTEX(edge, BELOW, LEFT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_LEFT, xb, yb);
|
||||
edge->outp[ABOVE]= edge->outp[BELOW];
|
||||
cf= edge;
|
||||
cft= LED;
|
||||
@@ -2060,21 +2060,21 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
{
|
||||
if (cf->bot.y == yb)
|
||||
{
|
||||
VERTEX(edge, BELOW, RIGHT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_RIGHT, xb, yb);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (edge->bot.y == yb)
|
||||
{
|
||||
VERTEX(cf, BELOW, LEFT, cf->xb, yb);
|
||||
VERTEX(edge, BELOW, RIGHT, xb, yb);
|
||||
VERTEX(cf, BELOW, GPC_LEFT, cf->xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_RIGHT, xb, yb);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
VERTEX(edge, BELOW, RIGHT, xb, yb);
|
||||
VERTEX(edge, ABOVE, RIGHT, xb, yb);
|
||||
VERTEX(edge, BELOW, GPC_RIGHT, xb, yb);
|
||||
VERTEX(edge, ABOVE, GPC_RIGHT, xb, yb);
|
||||
}
|
||||
cf= NULL;
|
||||
break;
|
||||
@@ -2199,8 +2199,8 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
if (p)
|
||||
{
|
||||
P_EDGE(prev_edge, e0, ABOVE, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, LEFT, px, iy);
|
||||
VERTEX(e0, ABOVE, RIGHT, ix, iy);
|
||||
VERTEX(prev_edge, ABOVE, GPC_LEFT, px, iy);
|
||||
VERTEX(e0, ABOVE, GPC_RIGHT, ix, iy);
|
||||
e1->outp[ABOVE]= e0->outp[ABOVE];
|
||||
e0->outp[ABOVE]= NULL;
|
||||
}
|
||||
@@ -2209,8 +2209,8 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
if (q)
|
||||
{
|
||||
N_EDGE(next_edge, e1, ABOVE, nx, iy);
|
||||
VERTEX(e1, ABOVE, LEFT, ix, iy);
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(e1, ABOVE, GPC_LEFT, ix, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
e0->outp[ABOVE]= e1->outp[ABOVE];
|
||||
e1->outp[ABOVE]= NULL;
|
||||
}
|
||||
@@ -2218,29 +2218,29 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
case EMX:
|
||||
if (p && q)
|
||||
{
|
||||
VERTEX(e0, ABOVE, LEFT, ix, iy);
|
||||
VERTEX(e0, ABOVE, GPC_LEFT, ix, iy);
|
||||
e0->outp[ABOVE]= NULL;
|
||||
e1->outp[ABOVE]= NULL;
|
||||
}
|
||||
break;
|
||||
case IMN:
|
||||
P_EDGE(prev_edge, e0, ABOVE, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, LEFT, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, GPC_LEFT, px, iy);
|
||||
N_EDGE(next_edge, e1, ABOVE, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
new_tristrip(&tlist, prev_edge, px, iy);
|
||||
e1->outp[ABOVE]= prev_edge->outp[ABOVE];
|
||||
VERTEX(e1, ABOVE, RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, GPC_RIGHT, ix, iy);
|
||||
new_tristrip(&tlist, e0, ix, iy);
|
||||
next_edge->outp[ABOVE]= e0->outp[ABOVE];
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
break;
|
||||
case ILI:
|
||||
if (p)
|
||||
{
|
||||
VERTEX(e0, ABOVE, LEFT, ix, iy);
|
||||
VERTEX(e0, ABOVE, GPC_LEFT, ix, iy);
|
||||
N_EDGE(next_edge, e1, ABOVE, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
e1->outp[ABOVE]= e0->outp[ABOVE];
|
||||
e0->outp[ABOVE]= NULL;
|
||||
}
|
||||
@@ -2248,9 +2248,9 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
case IRI:
|
||||
if (q)
|
||||
{
|
||||
VERTEX(e1, ABOVE, RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, GPC_RIGHT, ix, iy);
|
||||
P_EDGE(prev_edge, e0, ABOVE, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, LEFT, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, GPC_LEFT, px, iy);
|
||||
e0->outp[ABOVE]= e1->outp[ABOVE];
|
||||
e1->outp[ABOVE]= NULL;
|
||||
}
|
||||
@@ -2258,40 +2258,40 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
case IMX:
|
||||
if (p && q)
|
||||
{
|
||||
VERTEX(e0, ABOVE, RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, LEFT, ix, iy);
|
||||
VERTEX(e0, ABOVE, GPC_RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, GPC_LEFT, ix, iy);
|
||||
e0->outp[ABOVE]= NULL;
|
||||
e1->outp[ABOVE]= NULL;
|
||||
P_EDGE(prev_edge, e0, ABOVE, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, LEFT, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, GPC_LEFT, px, iy);
|
||||
new_tristrip(&tlist, prev_edge, px, iy);
|
||||
N_EDGE(next_edge, e1, ABOVE, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
next_edge->outp[ABOVE]= prev_edge->outp[ABOVE];
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
}
|
||||
break;
|
||||
case IMM:
|
||||
if (p && q)
|
||||
{
|
||||
VERTEX(e0, ABOVE, RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, LEFT, ix, iy);
|
||||
VERTEX(e0, ABOVE, GPC_RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, GPC_LEFT, ix, iy);
|
||||
P_EDGE(prev_edge, e0, ABOVE, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, LEFT, px, iy);
|
||||
VERTEX(prev_edge, ABOVE, GPC_LEFT, px, iy);
|
||||
new_tristrip(&tlist, prev_edge, px, iy);
|
||||
N_EDGE(next_edge, e1, ABOVE, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
e1->outp[ABOVE]= prev_edge->outp[ABOVE];
|
||||
VERTEX(e1, ABOVE, RIGHT, ix, iy);
|
||||
VERTEX(e1, ABOVE, GPC_RIGHT, ix, iy);
|
||||
new_tristrip(&tlist, e0, ix, iy);
|
||||
next_edge->outp[ABOVE]= e0->outp[ABOVE];
|
||||
VERTEX(next_edge, ABOVE, RIGHT, nx, iy);
|
||||
VERTEX(next_edge, ABOVE, GPC_RIGHT, nx, iy);
|
||||
}
|
||||
break;
|
||||
case EMM:
|
||||
if (p && q)
|
||||
{
|
||||
VERTEX(e0, ABOVE, LEFT, ix, iy);
|
||||
VERTEX(e0, ABOVE, GPC_LEFT, ix, iy);
|
||||
new_tristrip(&tlist, e1, ix, iy);
|
||||
e0->outp[ABOVE]= e1->outp[ABOVE];
|
||||
}
|
||||
@@ -2408,13 +2408,13 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
v= 0;
|
||||
if (INVERT_TRISTRIPS)
|
||||
{
|
||||
lt= tn->v[RIGHT];
|
||||
rt= tn->v[LEFT];
|
||||
lt= tn->v[GPC_RIGHT];
|
||||
rt= tn->v[GPC_LEFT];
|
||||
}
|
||||
else
|
||||
{
|
||||
lt= tn->v[LEFT];
|
||||
rt= tn->v[RIGHT];
|
||||
lt= tn->v[GPC_LEFT];
|
||||
rt= tn->v[GPC_RIGHT];
|
||||
}
|
||||
while (lt || rt)
|
||||
{
|
||||
@@ -2442,12 +2442,12 @@ void gpc_tristrip_clip(gpc_op op, gpc_polygon *subj, gpc_polygon *clip,
|
||||
else
|
||||
{
|
||||
/* Invalid tristrip: just free the heap */
|
||||
for (lt= tn->v[LEFT]; lt; lt= ltn)
|
||||
for (lt= tn->v[GPC_LEFT]; lt; lt= ltn)
|
||||
{
|
||||
ltn= lt->next;
|
||||
FREE(lt);
|
||||
}
|
||||
for (rt= tn->v[RIGHT]; rt; rt=rtn)
|
||||
for (rt= tn->v[GPC_RIGHT]; rt; rt=rtn)
|
||||
{
|
||||
rtn= rt->next;
|
||||
FREE(rt);
|
||||
|
||||
Reference in New Issue
Block a user