qbsp: add -splitsky and -splitturb, finer control over -splitspecial

This commit is contained in:
Eric Wasylishen 2016-04-16 22:53:33 -06:00
parent fff8cbffbc
commit 1340529234
3 changed files with 13 additions and 3 deletions

View File

@ -128,11 +128,13 @@ IsSkipName(const char *name)
} }
static bool static bool
IsSplitName(const char *name) IsSpecialName(const char *name)
{ {
if (options.fSplitspecial) if (options.fSplitspecial)
return false; 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 true;
return false; return false;
} }
@ -220,7 +222,7 @@ FindTexinfoEnt(texinfo_t *texinfo, const mapentity_t *entity)
flags |= TEX_SKIP; flags |= TEX_SKIP;
if (IsHintName(texname)) if (IsHintName(texname))
flags |= TEX_HINT; flags |= TEX_HINT;
if (IsSplitName(texname)) if (IsSpecialName(texname))
flags |= TEX_SPECIAL; flags |= TEX_SPECIAL;
if (atoi(ValueForKey(entity, "_dirt")) == -1) if (atoi(ValueForKey(entity, "_dirt")) == -1)
flags |= TEX_NODIRT; flags |= TEX_NODIRT;

View File

@ -594,6 +594,8 @@ PrintOptions(void)
" -verbose Print out more .MAP information\n" " -verbose Print out more .MAP information\n"
" -noverbose Print out almost no information at all\n" " -noverbose Print out almost no information at all\n"
" -splitspecial Doesn't combine sky and water faces into one large face\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" " -notranswater Computes portal information for opaque water\n"
" -transsky Computes portal information for transparent sky\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" " -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; options.fAllverbose = true;
else if (!Q_strcasecmp(szTok, "splitspecial")) else if (!Q_strcasecmp(szTok, "splitspecial"))
options.fSplitspecial = true; 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")) else if (!Q_strcasecmp(szTok, "notranswater"))
options.fTranswater = false; options.fTranswater = false;
else if (!Q_strcasecmp(szTok, "transwater")) else if (!Q_strcasecmp(szTok, "transwater"))

View File

@ -471,6 +471,8 @@ typedef struct options_s {
bool fVerbose; bool fVerbose;
bool fAllverbose; bool fAllverbose;
bool fSplitspecial; bool fSplitspecial;
bool fSplitturb;
bool fSplitsky;
bool fTranswater; bool fTranswater;
bool fTranssky; bool fTranssky;
bool fOldaxis; bool fOldaxis;