qbsp: add -leaktest option (from q2)

This commit is contained in:
Eric Wasylishen 2017-07-15 12:23:11 -06:00
parent 5d204036b7
commit 1a15d5f0e9
3 changed files with 10 additions and 1 deletions

View File

@ -359,6 +359,7 @@ public:
bool fOmitDetailFence;
bool fForcePRT1;
bool fTestExpand;
bool fLeakTest;
options_t() {
memset(this, 0, sizeof(options_t));

View File

@ -384,6 +384,11 @@ FillOutside(node_t *node, const int hullnum)
strcat(options.szBSPName, ".prt");
remove(options.szBSPName);
if (options.fLeakTest) {
logprint("Aborting because -leaktest was used.\n");
exit(1);
}
return false;
}

View File

@ -687,6 +687,7 @@ PrintOptions(void)
" -omitdetailfence func_detail_fence brushes are omitted from the compile\n"
" -convert <fmt> Convert a .MAP to a different .MAP format. fmt can be: quake, quake2, valve, bp (brush primitives).\n"
" -expand Write hull 1 expanded brushes to expanded.map for debugging\n"
" -leaktest Make compilation fail if the map leaks\n"
" sourcefile .MAP file to process\n"
" destfile .BSP file to output\n");
@ -887,6 +888,8 @@ ParseOptions(char *szOptions)
logprint(" Only use this for viewing portals in a map editor.\n");
} else if (!Q_strcasecmp(szTok, "expand")) {
options.fTestExpand = true;
} else if (!Q_strcasecmp(szTok, "leaktest")) {
options.fLeakTest = true;
} else if (!Q_strcasecmp(szTok, "?") || !Q_strcasecmp(szTok, "help"))
PrintOptions();
else