diff --git a/tools/qfbsp/include/options.h b/tools/qfbsp/include/options.h index 50654fff5..5a674f39c 100644 --- a/tools/qfbsp/include/options.h +++ b/tools/qfbsp/include/options.h @@ -39,6 +39,7 @@ typedef struct { qboolean noclip; qboolean onlyents; qboolean usehulls; + qboolean watervis; int hullnum; int subdivide_size; char *mapfile; diff --git a/tools/qfbsp/source/options.c b/tools/qfbsp/source/options.c index 7b290ff28..a52ae1252 100644 --- a/tools/qfbsp/source/options.c +++ b/tools/qfbsp/source/options.c @@ -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); } diff --git a/tools/qfbsp/source/portals.c b/tools/qfbsp/source/portals.c index 5548e2f64..1938481da 100644 --- a/tools/qfbsp/source/portals.c +++ b/tools/qfbsp/source/portals.c @@ -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)