mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 15:22:04 +00:00
white and grey space cleanup
This commit is contained in:
parent
c1c36f79f5
commit
7d7e578b71
3 changed files with 33 additions and 117 deletions
|
@ -32,15 +32,16 @@
|
|||
#include "QF/qtypes.h"
|
||||
|
||||
typedef struct {
|
||||
int verbosity; // 0=silent
|
||||
int threads;
|
||||
qboolean minimal;
|
||||
int level;
|
||||
char *bspfile;
|
||||
int verbosity; // 0=silent
|
||||
int threads;
|
||||
qboolean minimal;
|
||||
int level;
|
||||
char *bspfile;
|
||||
} options_t;
|
||||
|
||||
extern options_t options;
|
||||
int DecodeArgs (int argc, char **argv);
|
||||
void usage (int status);
|
||||
extern const char *this_program;
|
||||
|
||||
#endif//__options_h
|
||||
|
|
|
@ -50,14 +50,14 @@ extern pthread_mutex_t *my_mutex;
|
|||
#define MAX_PORTALS_ON_LEAF 128
|
||||
|
||||
typedef struct {
|
||||
vec3_t normal;
|
||||
float dist;
|
||||
vec3_t normal;
|
||||
float dist;
|
||||
} plane_t;
|
||||
|
||||
typedef struct {
|
||||
qboolean original; // don't free, it's part of the portal
|
||||
int numpoints;
|
||||
vec3_t points[8]; // variable sized
|
||||
qboolean original; // don't free, it's part of the portal
|
||||
int numpoints;
|
||||
vec3_t points[8]; // variable sized
|
||||
} winding_t;
|
||||
|
||||
typedef enum {
|
||||
|
@ -67,46 +67,46 @@ typedef enum {
|
|||
} vstatus_t;
|
||||
|
||||
typedef struct {
|
||||
plane_t plane; // normal pointing into neighbor
|
||||
int leaf; // neighbor
|
||||
winding_t *winding;
|
||||
vstatus_t status;
|
||||
byte *visbits;
|
||||
byte *mightsee;
|
||||
int nummightsee;
|
||||
int numcansee;
|
||||
plane_t plane; // normal pointing into neighbor
|
||||
int leaf; // neighbor
|
||||
winding_t *winding;
|
||||
vstatus_t status;
|
||||
byte *visbits;
|
||||
byte *mightsee;
|
||||
int nummightsee;
|
||||
int numcansee;
|
||||
} portal_t;
|
||||
|
||||
typedef struct seperating_plane_s {
|
||||
struct seperating_plane_s *next;
|
||||
plane_t plane; // from portal is on positive side
|
||||
plane_t plane; // from portal is on positive side
|
||||
} sep_t;
|
||||
|
||||
typedef struct passage_s {
|
||||
struct passage_s *next;
|
||||
int from, to; // leaf numbers
|
||||
sep_t *planes;
|
||||
int from, to; // leaf numbers
|
||||
sep_t *planes;
|
||||
} passage_t;
|
||||
|
||||
typedef struct leaf_s {
|
||||
int numportals;
|
||||
passage_t *passages;
|
||||
portal_t *portals[MAX_PORTALS_ON_LEAF];
|
||||
int numportals;
|
||||
passage_t *passages;
|
||||
portal_t *portals[MAX_PORTALS_ON_LEAF];
|
||||
} leaf_t;
|
||||
|
||||
typedef struct pstack_s {
|
||||
struct pstack_s *next;
|
||||
leaf_t *leaf;
|
||||
portal_t *portal; // portal exiting
|
||||
winding_t *source, *pass;
|
||||
plane_t portalplane;
|
||||
byte *mightsee; // bit string
|
||||
leaf_t *leaf;
|
||||
portal_t *portal; // portal exiting
|
||||
winding_t *source, *pass;
|
||||
plane_t portalplane;
|
||||
byte *mightsee; // bit string
|
||||
} pstack_t;
|
||||
|
||||
typedef struct {
|
||||
byte *leafvis; // bit string
|
||||
portal_t *base;
|
||||
pstack_t pstack_head;
|
||||
byte *leafvis; // bit string
|
||||
portal_t *base;
|
||||
pstack_t pstack_head;
|
||||
} threaddata_t;
|
||||
|
||||
extern int numportals;
|
||||
|
|
|
@ -89,55 +89,6 @@ dstring_t *visdata;
|
|||
byte *uncompressed; // [bitbytes * portalleafs]
|
||||
|
||||
|
||||
#if 0
|
||||
void
|
||||
NormalizePlane (plane_t *dp)
|
||||
{
|
||||
vec_t ax, ay, az;
|
||||
|
||||
if (dp->normal[0] == -1.0) {
|
||||
dp->normal[0] = 1.0;
|
||||
dp->dist = -dp->dist;
|
||||
return;
|
||||
}
|
||||
if (dp->normal[1] == -1.0) {
|
||||
dp->normal[1] = 1.0;
|
||||
dp->dist = -dp->dist;
|
||||
return;
|
||||
}
|
||||
if (dp->normal[2] == -1.0) {
|
||||
dp->normal[2] = 1.0;
|
||||
dp->dist = -dp->dist;
|
||||
return;
|
||||
}
|
||||
|
||||
ax = fabs (dp->normal[0]);
|
||||
ay = fabs (dp->normal[1]);
|
||||
az = fabs (dp->normal[2]);
|
||||
|
||||
if (ax >= ay && ax >= az) {
|
||||
if (dp->normal[0] < 0) {
|
||||
VectorSubtract (vec3_origin, dp->normal, dp->normal);
|
||||
dp->dist = -dp->dist;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (ay >= ax && ay >= az) {
|
||||
if (dp->normal[1] < 0) {
|
||||
VectorSubtract (vec3_origin, dp->normal, dp->normal);
|
||||
dp->dist = -dp->dist;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (dp->normal[2] < 0) {
|
||||
VectorSubtract (vec3_origin, dp->normal, dp->normal);
|
||||
dp->dist = -dp->dist;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
PlaneFromWinding (winding_t *winding, plane_t *plane)
|
||||
{
|
||||
|
@ -174,37 +125,6 @@ FreeWinding (winding_t *winding)
|
|||
free (winding);
|
||||
}
|
||||
|
||||
// FIXME: currently unused
|
||||
void
|
||||
pw (winding_t *winding)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < winding->numpoints; i++)
|
||||
printf ("(%5.1f, %5.1f, %5.1f)\n", winding->points[i][0],
|
||||
winding->points[i][1],
|
||||
winding->points[i][2]);
|
||||
}
|
||||
|
||||
// FIXME: currently unused
|
||||
void
|
||||
prl (leaf_t *leaf)
|
||||
{
|
||||
int i;
|
||||
portal_t *portal;
|
||||
plane_t plane;
|
||||
|
||||
for (i = 0; i < leaf->numportals; i++) {
|
||||
portal = leaf->portals[i];
|
||||
plane = portal->plane;
|
||||
printf ("portal %4i to leaf %4i : %7.1f : (%4.1f, %4.1f, %4.1f)\n",
|
||||
(int) (portal - portals),
|
||||
portal->leaf, plane.dist,
|
||||
plane.normal[0], plane.normal[1], plane.normal[2]);
|
||||
}
|
||||
}
|
||||
|
||||
winding_t *
|
||||
CopyWinding (winding_t *winding)
|
||||
{
|
||||
|
@ -442,12 +362,7 @@ LeafFlow (int leafnum)
|
|||
printf ("leaf %4i : %4i visible\n", leafnum, numvis);
|
||||
totalvis += numvis;
|
||||
|
||||
#if 0
|
||||
i = (portalleafs + 7) >> 3;
|
||||
memcpy (compressed, outbuffer, i);
|
||||
#else
|
||||
i = CompressRow (outbuffer, compressed);
|
||||
#endif
|
||||
|
||||
bsp->leafs[leafnum + 1].visofs = visdata->size;
|
||||
dstring_append (visdata, compressed, i);
|
||||
|
|
Loading…
Reference in a new issue