vis: rename portal_t -> visportal_t
fixes symbol collision causing crashes on macOS
This commit is contained in:
parent
ba155a3bf5
commit
8f79f6a972
|
|
@ -102,10 +102,10 @@ struct viswinding_t : polylib::winding_base_t<polylib::winding_storage_hybrid_t<
|
|||
Used for visdist to get the distance from a winding to a portal
|
||||
============================================================================
|
||||
*/
|
||||
inline float distFromPortal(struct portal_t &p);
|
||||
inline float distFromPortal(struct visportal_t &p);
|
||||
};
|
||||
|
||||
struct portal_t
|
||||
struct visportal_t
|
||||
{
|
||||
qplane3d plane; // normal pointing into neighbor
|
||||
int leaf; // neighbor
|
||||
|
|
@ -116,7 +116,7 @@ struct portal_t
|
|||
int numcansee;
|
||||
};
|
||||
|
||||
inline float viswinding_t::distFromPortal(portal_t &p)
|
||||
inline float viswinding_t::distFromPortal(visportal_t &p)
|
||||
{
|
||||
vec_t mindist = 1e20;
|
||||
|
||||
|
|
@ -147,7 +147,7 @@ struct leaf_t
|
|||
{
|
||||
int numportals;
|
||||
passage_t *passages;
|
||||
portal_t *portals[MAX_PORTALS_ON_LEAF];
|
||||
visportal_t *portals[MAX_PORTALS_ON_LEAF];
|
||||
};
|
||||
|
||||
constexpr size_t MAX_SEPARATORS = MAX_WINDING;
|
||||
|
|
@ -157,7 +157,7 @@ struct pstack_t
|
|||
{
|
||||
pstack_t *next;
|
||||
leaf_t *leaf;
|
||||
portal_t *portal; // portal exiting
|
||||
visportal_t *portal; // portal exiting
|
||||
viswinding_t *source, *pass;
|
||||
viswinding_t windings[STACK_WINDINGS]; // Fixed size windings
|
||||
bool windings_used[STACK_WINDINGS];
|
||||
|
|
@ -174,7 +174,7 @@ viswinding_t *ClipStackWinding(viswinding_t *in, pstack_t &stack, const qplane3d
|
|||
struct threaddata_t
|
||||
{
|
||||
leafbits_t &leafvis;
|
||||
portal_t *base;
|
||||
visportal_t *base;
|
||||
pstack_t pstack_head;
|
||||
};
|
||||
|
||||
|
|
@ -182,7 +182,7 @@ extern int numportals;
|
|||
extern int portalleafs;
|
||||
extern int portalleafs_real;
|
||||
|
||||
extern std::vector<portal_t> portals; // always numportals * 2; front and back
|
||||
extern std::vector<visportal_t> portals; // always numportals * 2; front and back
|
||||
extern std::vector<leaf_t> 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);
|
||||
|
||||
|
|
|
|||
12
vis/flow.cc
12
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?
|
||||
|
|
|
|||
16
vis/vis.cc
16
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<portal_t> portals; // always numportals * 2; front and back
|
||||
std::vector<visportal_t> portals; // always numportals * 2; front and back
|
||||
std::vector<leaf_t> 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
|
||||
|
|
|
|||
Loading…
Reference in New Issue