diff --git a/include/vis/vis.h b/include/vis/vis.h index ad48fab2..3db77d27 100644 --- a/include/vis/vis.h +++ b/include/vis/vis.h @@ -49,12 +49,13 @@ winding_t *CopyWinding(winding_t * w); void PlaneFromWinding(const winding_t * w, plane_t *plane); qboolean PlaneCompare(plane_t *p1, plane_t *p2); -typedef enum { stat_none, stat_working, stat_done } vstatus_t; +typedef enum { pstat_none = 0, pstat_working, pstat_done } pstatus_t; + typedef struct { plane_t plane; // normal pointing into neighbor int leaf; // neighbor winding_t *winding; - vstatus_t status; + pstatus_t status; byte *visbits; byte *mightsee; int nummightsee; diff --git a/vis/flow.c b/vis/flow.c index 81c4a2ec..41aaaf99 100644 --- a/vis/flow.c +++ b/vis/flow.c @@ -193,7 +193,7 @@ RecursiveLeafFlow(int leafnum, threaddata_t * thread, pstack_t * prevstack) continue; // can't possibly see it } // if the portal can't see anything we haven't allready seen, skip it - if (p->status == stat_done) { + if (p->status == pstat_done) { c_vistest++; test = (long *)p->visbits; } else { @@ -354,9 +354,8 @@ PortalFlow(portal_t * p) { threaddata_t data; - if (p->status != stat_working) + if (p->status != pstat_working) Error("%s: reflowed", __func__); - p->status = stat_working; p->visbits = malloc(leafbytes); memset(p->visbits, 0, leafbytes); @@ -372,7 +371,7 @@ PortalFlow(portal_t * p) RecursiveLeafFlow(p->leaf, &data, &data.pstack_head); - p->status = stat_done; + p->status = pstat_done; } diff --git a/vis/vis.c b/vis/vis.c index f0559e33..eb62edb9 100644 --- a/vis/vis.c +++ b/vis/vis.c @@ -350,14 +350,14 @@ GetNextPortal(void) p = NULL; for (j = 0, tp = portals; j < numportals * 2; j++, tp++) { - if (tp->nummightsee < min && tp->status == stat_none) { + if (tp->nummightsee < min && tp->status == pstat_none) { min = tp->nummightsee; p = tp; } } if (p) { - p->status = stat_working; + p->status = pstat_working; progress++; printf("\r%i of %i: %i%%", progress, 2 * numportals, 50 * progress / numportals); @@ -460,7 +460,7 @@ LeafFlow(int leafnum) leaf = &leafs[leafnum]; for (i = 0; i < leaf->numportals; i++) { p = leaf->portals[i]; - if (p->status != stat_done) + if (p->status != pstat_done) Error("portal not done"); for (j = 0; j < leafbytes; j++) outbuffer[j] |= p->visbits[j]; @@ -516,7 +516,7 @@ CalcPortalVis(void) if (fastvis) { for (i = 0; i < numportals * 2; i++) { portals[i].visbits = portals[i].mightsee; - portals[i].status = stat_done; + portals[i].status = pstat_done; } return; }