From 1340529234890b4d4a9e2ce6ee9c4a5b00ebfb4f Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Sat, 16 Apr 2016 22:53:33 -0600 Subject: [PATCH] qbsp: add -splitsky and -splitturb, finer control over -splitspecial --- qbsp/map.cc | 8 +++++--- qbsp/qbsp.cc | 6 ++++++ qbsp/qbsp.h | 2 ++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/qbsp/map.cc b/qbsp/map.cc index 8373b1c0..8c9fdd7f 100644 --- a/qbsp/map.cc +++ b/qbsp/map.cc @@ -128,11 +128,13 @@ IsSkipName(const char *name) } static bool -IsSplitName(const char *name) +IsSpecialName(const char *name) { if (options.fSplitspecial) return false; - if (name[0] == '*' || !Q_strncasecmp(name, "sky", 3)) + if (name[0] == '*' && !options.fSplitturb) + return true; + if (!Q_strncasecmp(name, "sky", 3) && !options.fSplitsky) return true; return false; } @@ -220,7 +222,7 @@ FindTexinfoEnt(texinfo_t *texinfo, const mapentity_t *entity) flags |= TEX_SKIP; if (IsHintName(texname)) flags |= TEX_HINT; - if (IsSplitName(texname)) + if (IsSpecialName(texname)) flags |= TEX_SPECIAL; if (atoi(ValueForKey(entity, "_dirt")) == -1) flags |= TEX_NODIRT; diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index f2b290c0..5a553cac 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -594,6 +594,8 @@ PrintOptions(void) " -verbose Print out more .MAP information\n" " -noverbose Print out almost no information at all\n" " -splitspecial Doesn't combine sky and water faces into one large face\n" + " -splitsky Doesn't combine sky faces into one large face\n" + " -splitturb Doesn't combine water faces into one large face\n" " -notranswater Computes portal information for opaque water\n" " -transsky Computes portal information for transparent sky\n" " -notex Write only placeholder textures, to depend upon replacements, to keep file sizes down, or to skirt copyrights\n" @@ -714,6 +716,10 @@ ParseOptions(char *szOptions) options.fAllverbose = true; else if (!Q_strcasecmp(szTok, "splitspecial")) options.fSplitspecial = true; + else if (!Q_strcasecmp(szTok, "splitsky")) + options.fSplitsky = true; + else if (!Q_strcasecmp(szTok, "splitturb")) + options.fSplitturb = true; else if (!Q_strcasecmp(szTok, "notranswater")) options.fTranswater = false; else if (!Q_strcasecmp(szTok, "transwater")) diff --git a/qbsp/qbsp.h b/qbsp/qbsp.h index 90cf23d3..2bb50ad3 100644 --- a/qbsp/qbsp.h +++ b/qbsp/qbsp.h @@ -471,6 +471,8 @@ typedef struct options_s { bool fVerbose; bool fAllverbose; bool fSplitspecial; + bool fSplitturb; + bool fSplitsky; bool fTranswater; bool fTranssky; bool fOldaxis;