hopefully add watervis support

This commit is contained in:
Bill Currie 2003-09-03 23:04:30 +00:00
parent 4cb6c062ec
commit 194ea081eb
3 changed files with 14 additions and 3 deletions

View file

@ -39,6 +39,7 @@ typedef struct {
qboolean noclip;
qboolean onlyents;
qboolean usehulls;
qboolean watervis;
int hullnum;
int subdivide_size;
char *mapfile;

View file

@ -61,6 +61,7 @@ static struct option const long_options[] = {
{"hullnum", required_argument, 0, 'H'},
{"subdivide", required_argument, 0, 's'},
{"wadpath", required_argument, 0, 'w'},
{"watervis", no_argument, 0, 'W'},
{NULL, 0, NULL, 0}
};
@ -78,6 +79,7 @@ static const char *short_options =
"H:" // hullnum
"s:" // subdivide
"w:" // wadpath
"W" // watervis
;
@ -99,8 +101,10 @@ usage (int status)
" -u, --usehulls Use the existing hull files\n"
" -H, --hullnum [num]\n"
" -s, --subdivide [size]\n"
" -w, --wadpath [path] semicolon sparated set of dirs to \n"
" search for texture wads\n");
" -w, --wadpath [path] semicolon sparated set of dirs to\n"
" search for texture wads\n"
" -W, --watervis allow transparent liquid surfaces\n"
);
exit (status);
}
@ -156,6 +160,9 @@ DecodeArgs (int argc, char **argv)
case 'w': // wadpath
options.wadpath = optarg;
break;
case 'W': // watervis
options.watervis = true;
break;
default:
usage (1);
}

View file

@ -330,7 +330,6 @@ int num_visleafs; // leafs the player can be in
int num_visportals;
int num_realleafs;
//FIXME make work with transparent water
static int
HasContents (node_t *n, int cont)
{
@ -363,6 +362,10 @@ SameContents (node_t *n1, node_t *n2)
{
if (n1->contents == CONTENTS_SOLID || n2->contents == CONTENTS_SOLID)
return 0;
if (n1->contents == CONTENTS_SKY || n2->contents == CONTENTS_SKY)
return 0;
if (options.watervis) //FIXME be more picky?
return 1;
if (n1->detail && n2->detail)
ShareContents (n1, n2);
if (n1->detail)