#include <assert.h>
#include <math.h>
+#include <stdbool.h>
#include <stdlib.h>
#include <limits.h>
#include "vispath.h"
/*end visual studio*/
extern COORD *ptVis(vconfig_t *, int, Ppoint_t);
- extern int directVis(Ppoint_t, int, Ppoint_t, int, vconfig_t *);
+ extern bool directVis(Ppoint_t, int, Ppoint_t, int, vconfig_t *);
extern void visibility(vconfig_t *);
extern int *makePath(Ppoint_t p, int pp, COORD * pvis,
Ppoint_t q, int qp, COORD * qvis,
* If a point is associated with a polygon, the edges of the polygon
* are ignored when checking visibility.
*/
-int directVis(Ppoint_t p, int pp, Ppoint_t q, int qp, vconfig_t * conf)
+bool directVis(Ppoint_t p, int pp, Ppoint_t q, int qp, vconfig_t * conf)
{
int V = conf->N;
Ppoint_t *pts = conf->P;
for (k = 0; k < s1; k++) {
if (INTERSECT(p, q, pts[k], pts[nextPt[k]], pts[prevPt[k]]))
- return 0;
+ return false;
}
for (k = e1; k < s2; k++) {
if (INTERSECT(p, q, pts[k], pts[nextPt[k]], pts[prevPt[k]]))
- return 0;
+ return false;
}
for (k = e2; k < V; k++) {
if (INTERSECT(p, q, pts[k], pts[nextPt[k]], pts[prevPt[k]]))
- return 0;
+ return false;
}
- return 1;
+ return true;
}