mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 18:01:15 +00:00
various var cleanups
This commit is contained in:
parent
918f2dd203
commit
ded572b31f
3 changed files with 17 additions and 29 deletions
|
@ -117,16 +117,15 @@ extern int c_portalpass;
|
|||
extern int c_portalcheck;
|
||||
extern int bitbytes;
|
||||
extern int bitlongs;
|
||||
extern struct bsp_s *bsp;
|
||||
|
||||
extern portal_t *portals;
|
||||
extern leaf_t *leafs;
|
||||
extern qboolean showgetleaf;
|
||||
extern byte *vismap, *vismap_p, *vismap_end; // past visfile
|
||||
extern byte *uncompressed;
|
||||
|
||||
extern int c_portalskip, c_leafskip;
|
||||
extern int c_vistest, c_mighttest;
|
||||
extern int c_chains;
|
||||
extern int c_mighttest;
|
||||
extern int c_vistest;
|
||||
|
||||
void FreeWinding (winding_t *winding);
|
||||
winding_t *NewWinding (int points);
|
||||
|
@ -138,6 +137,4 @@ void BasePortalVis (void);
|
|||
void PortalFlow (portal_t *portal);
|
||||
void CalcAmbientSounds (void);
|
||||
|
||||
extern struct bsp_s *bsp;
|
||||
|
||||
#endif// __vis_h
|
||||
|
|
|
@ -59,13 +59,8 @@ static const char rcsid[] =
|
|||
#include "vis.h"
|
||||
#include "options.h"
|
||||
|
||||
int c_chains;
|
||||
int c_portalskip, c_leafskip;
|
||||
int c_vistest, c_mighttest;
|
||||
int c_leafsee, c_portalsee;
|
||||
|
||||
byte portalsee[MAX_PORTALS];
|
||||
|
||||
static int leafsee;
|
||||
static byte portalsee[MAX_PORTALS];
|
||||
|
||||
void
|
||||
CheckStack (leaf_t *leaf, threaddata_t *thread)
|
||||
|
@ -240,10 +235,8 @@ RecursiveLeafFlow (int leafnum, threaddata_t *thread, pstack_t *prevstack)
|
|||
for (i = 0; i < leaf->numportals; i++) {
|
||||
p = leaf->portals[i];
|
||||
|
||||
if (!(prevstack->mightsee[p->leaf >> 3] & (1 << (p->leaf & 7)))) {
|
||||
c_leafskip++;
|
||||
if (!(prevstack->mightsee[p->leaf >> 3] & (1 << (p->leaf & 7))))
|
||||
continue; // can't possibly see it
|
||||
}
|
||||
// if the portal can't see anything we haven't already seen, skip it
|
||||
if (p->status == stat_done) {
|
||||
c_vistest++;
|
||||
|
@ -259,10 +252,9 @@ RecursiveLeafFlow (int leafnum, threaddata_t *thread, pstack_t *prevstack)
|
|||
more = true;
|
||||
}
|
||||
|
||||
if (!more) { // can't see anything new
|
||||
c_portalskip++;
|
||||
if (!more) // can't see anything new
|
||||
continue;
|
||||
}
|
||||
|
||||
// get plane of portal, point normal into the neighbor leaf
|
||||
stack.portalplane = p->plane;
|
||||
VectorSubtract (vec3_origin, p->plane.normal, backplane.normal);
|
||||
|
@ -393,7 +385,7 @@ SimpleFlood (portal_t *srcportal, int leafnum)
|
|||
if (srcportal->mightsee[leafnum >> 3] & (1 << (leafnum & 7)))
|
||||
return;
|
||||
srcportal->mightsee[leafnum >> 3] |= (1 << (leafnum & 7));
|
||||
c_leafsee++;
|
||||
leafsee++;
|
||||
|
||||
leaf = &leafs[leafnum];
|
||||
|
||||
|
@ -416,7 +408,6 @@ BasePortalVis (void)
|
|||
for (i = 0, p = portals; i < numportals * 2; i++, p++) {
|
||||
p->mightsee = calloc (1, bitbytes);
|
||||
|
||||
c_portalsee = 0;
|
||||
memset (portalsee, 0, numportals * 2);
|
||||
|
||||
for (j = 0, tp = portals; j < numportals * 2; j++, tp++) {
|
||||
|
@ -444,11 +435,10 @@ BasePortalVis (void)
|
|||
continue; // no points on front
|
||||
|
||||
portalsee[j] = 1;
|
||||
c_portalsee++;
|
||||
}
|
||||
|
||||
c_leafsee = 0;
|
||||
leafsee = 0;
|
||||
SimpleFlood (p, p->leaf);
|
||||
p->nummightsee = c_leafsee;
|
||||
p->nummightsee = leafsee;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,21 +70,23 @@ bsp_t *bsp;
|
|||
|
||||
options_t options;
|
||||
|
||||
int numportals;
|
||||
int portalleafs;
|
||||
int c_chains;
|
||||
int c_mighttest;
|
||||
int c_portaltest;
|
||||
int c_portalpass;
|
||||
int c_portalcheck;
|
||||
int c_vistest;
|
||||
|
||||
int numportals;
|
||||
int portalleafs;
|
||||
int originalvismapsize;
|
||||
int totalvis;
|
||||
int count_sep;
|
||||
int bitbytes; // (portalleafs + 63)>>3
|
||||
int bitlongs;
|
||||
int leafon; // the next leaf to be given to a thread to process
|
||||
|
||||
portal_t *portals;
|
||||
leaf_t *leafs;
|
||||
qboolean showgetleaf = true;
|
||||
dstring_t *visdata;
|
||||
byte *uncompressed; // [bitbytes * portalleafs]
|
||||
|
||||
|
@ -381,7 +383,6 @@ CalcPortalVis (void)
|
|||
return;
|
||||
}
|
||||
|
||||
leafon = 0;
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
{
|
||||
pthread_t work_threads[MAX_THREADS];
|
||||
|
|
Loading…
Reference in a new issue