From a6f56d91115a5bf93ef39cd3ee27726b6989055d Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 27 Feb 2017 13:26:01 -0700 Subject: [PATCH] qbsp: add -omitdetail option --- man/qbsp.1 | 2 ++ qbsp/brush.cc | 5 +++++ qbsp/qbsp.cc | 3 +++ qbsp/qbsp.hh | 1 + 4 files changed, 11 insertions(+) diff --git a/man/qbsp.1 b/man/qbsp.1 index 4be674c3..03897bcd 100644 --- a/man/qbsp.1 +++ b/man/qbsp.1 @@ -80,6 +80,8 @@ Generate a hexen2 bsp. "-wrbrushes" combined with "-noclip" argument. .IP "\fB\-notex\fP" Write only placeholder textures, to depend upon replacements. +.IP "\fB\-omitdetail\fP" +Detail brushes are omitted from the compile. .SH "SPECIAL TEXTURE NAMES" .PP diff --git a/qbsp/brush.cc b/qbsp/brush.cc index d1a37cc7..3bd94b54 100644 --- a/qbsp/brush.cc +++ b/qbsp/brush.cc @@ -992,6 +992,11 @@ Brush_LoadEntity(mapentity_t *dst, const mapentity_t *src, const int hullnum) if (contents == CONTENTS_ORIGIN) continue; + /* -omitdetail option */ + if (options.fOmitDetail + && ((cflags & CFLAGS_DETAIL) == CFLAGS_DETAIL)) + continue; + /* * "clip" brushes don't show up in the draw hull, but we still want to * include them in the model bounds so collision detection works diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index 5ce54b40..1e8a663e 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -629,6 +629,7 @@ PrintOptions(void) " -maxnodesize [n]Triggers simpler BSP Splitting when node exceeds size (default 1024, 0 to disable)\n" " -epsilon [n] Customize ON_EPSILON (default 0.0001)\n" " -objexport Export the map file as an .OBJ model after the CSG phase\n" + " -omitdetail Detail brushes are omitted from the compile\n" " sourcefile .MAP file to process\n" " destfile .BSP file to output\n"); @@ -806,6 +807,8 @@ ParseOptions(char *szOptions) szTok = szTok2; } else if (!Q_strcasecmp(szTok, "objexport")) { options.fObjExport = true; + } else if (!Q_strcasecmp(szTok, "omitdetail")) { + options.fOmitDetail = true; } else if (!Q_strcasecmp(szTok, "?") || !Q_strcasecmp(szTok, "help")) PrintOptions(); else diff --git a/qbsp/qbsp.hh b/qbsp/qbsp.hh index 3b73ee30..a7204b80 100644 --- a/qbsp/qbsp.hh +++ b/qbsp/qbsp.hh @@ -505,6 +505,7 @@ typedef struct options_s { char wadPath[512]; vec_t on_epsilon; bool fObjExport; + bool fOmitDetail; } options_t; extern options_t options;