From 8f79f6a97239c196ca50bb2653c8194f614ad603 Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Wed, 21 Dec 2022 01:03:03 -0700 Subject: [PATCH] vis: rename portal_t -> visportal_t fixes symbol collision causing crashes on macOS --- include/vis/vis.hh | 16 ++++++++-------- vis/flow.cc | 12 ++++++------ vis/vis.cc | 16 ++++++++-------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/vis/vis.hh b/include/vis/vis.hh index a768fb2e..f15d2b59 100644 --- a/include/vis/vis.hh +++ b/include/vis/vis.hh @@ -102,10 +102,10 @@ struct viswinding_t : polylib::winding_base_t portals; // always numportals * 2; front and back +extern std::vector portals; // always numportals * 2; front and back extern std::vector leafs; extern int c_noclip; @@ -201,7 +201,7 @@ extern fs::path portalfile, statefile, statetmpfile; void BasePortalVis(void); -void PortalFlow(portal_t *p); +void PortalFlow(visportal_t *p); void CalcAmbientSounds(mbsp_t *bsp); diff --git a/vis/flow.cc b/vis/flow.cc index bbed5b02..b539c38a 100644 --- a/vis/flow.cc +++ b/vis/flow.cc @@ -145,7 +145,7 @@ static int CheckStack(leaf_t *leaf, threaddata_t *thread) static void RecursiveLeafFlow(int leafnum, threaddata_t *thread, pstack_t &prevstack) { pstack_t stack{}; - portal_t *p; + visportal_t *p; qplane3d backplane; leaf_t *leaf; int i, j, err, numblocks; @@ -333,7 +333,7 @@ static void RecursiveLeafFlow(int leafnum, threaddata_t *thread, pstack_t &prevs PortalFlow =============== */ -void PortalFlow(portal_t *p) +void PortalFlow(visportal_t *p) { threaddata_t data{p->visbits}; @@ -359,7 +359,7 @@ void PortalFlow(portal_t *p) ============================================================================ */ -static void SimpleFlood(portal_t &srcportal, int leafnum, const leafbits_t &portalsee) +static void SimpleFlood(visportal_t &srcportal, int leafnum, const leafbits_t &portalsee) { if (srcportal.mightsee[leafnum]) return; @@ -369,7 +369,7 @@ static void SimpleFlood(portal_t &srcportal, int leafnum, const leafbits_t &port leaf_t &leaf = leafs[leafnum]; for (size_t i = 0; i < leaf.numportals; i++) { - const portal_t *p = leaf.portals[i]; + const visportal_t *p = leaf.portals[i]; if (portalsee[p - portals.data()]) { SimpleFlood(srcportal, p->leaf, portalsee); @@ -388,7 +388,7 @@ static void BasePortalThread(size_t portalnum) float d; leafbits_t portalsee(numportals * 2); - portal_t &p = portals[portalnum]; + visportal_t &p = portals[portalnum]; viswinding_t &w = p.winding; p.mightsee.resize(portalleafs); @@ -398,7 +398,7 @@ static void BasePortalThread(size_t portalnum) continue; } - portal_t &tp = portals[i]; + visportal_t &tp = portals[i]; viswinding_t &tw = tp.winding; // Quick test - completely at the back? diff --git a/vis/vis.cc b/vis/vis.cc index f021167d..1e26b98d 100644 --- a/vis/vis.cc +++ b/vis/vis.cc @@ -36,7 +36,7 @@ int numportals; int portalleafs; /* leafs (PRT1) or clusters (PRT2) */ int portalleafs_real; /* real no. of leafs after expanding PRT2 clusters. Not used for Q2. */ -std::vector portals; // always numportals * 2; front and back +std::vector portals; // always numportals * 2; front and back std::vector leafs; int c_portaltest, c_portalpass, c_portalcheck, c_mightseeupdate; @@ -247,9 +247,9 @@ static std::atomic_int64_t portalIndex; the earlier information. ============= */ -portal_t *GetNextPortal(void) +visportal_t *GetNextPortal(void) { - portal_t *ret = nullptr; + visportal_t *ret = nullptr; uint32_t min = INT_MAX; portal_mutex.lock(); @@ -286,7 +286,7 @@ static void UpdateMightsee(const leaf_t &source, const leaf_t &dest) { size_t leafnum = &dest - leafs.data(); for (size_t i = 0; i < source.numportals; i++) { - portal_t *p = source.portals[i]; + visportal_t *p = source.portals[i]; if (p->status != pstat_none) { continue; } @@ -308,11 +308,11 @@ static void UpdateMightsee(const leaf_t &source, const leaf_t &dest) Called with the lock held. ============= */ -static void PortalCompleted(portal_t *completed) +static void PortalCompleted(visportal_t *completed) { int i, j, k, bit, numblocks; int leafnum; - const portal_t *p, *p2; + const visportal_t *p, *p2; uint32_t changed; portal_mutex.lock(); @@ -378,7 +378,7 @@ static duration stateinterval; */ void LeafThread(size_t) { - portal_t *p; + visportal_t *p; portal_mutex.lock(); /* Save state if sufficient time has elapsed */ @@ -418,7 +418,7 @@ static void ClusterFlow(int clusternum, leafbits_t &buffer, mbsp_t *bsp) uint8_t *outbuffer; int i, j; int numvis, numblocks; - const portal_t *p; + const visportal_t *p; /* * Collect visible bits from all portals into buffer