qbsp: partially revert "csg: mirror faces, even for solid, to help leaf content assignment" and turn it into a flag

(comit a910dd861a)
fixes https://github.com/ericwa/tyrutils-ericw/issues/175 (swtest2.map)
This commit is contained in:
Eric Wasylishen 2017-09-16 11:18:04 -06:00
parent 78fb256862
commit d4f3e5de65
3 changed files with 6 additions and 2 deletions

View File

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

View File

@ -375,7 +375,7 @@ SaveFacesToPlaneList(face_t *facelist, bool mirror, std::map<int, face_t *> &pla
|| face->contents[1] == CONTENTS_DETAIL_ILLUSIONARY
|| face->contents[1] == CONTENTS_DETAIL_FENCE
|| (face->cflags[1] & CFLAGS_WAS_ILLUSIONARY)
|| face->contents[1] == CONTENTS_SOLID) {
|| (options.fContentHack && face->contents[1] == CONTENTS_SOLID)) {
// if CFLAGS_BMODEL_MIRROR_INSIDE is set, never change to skip
if (!(face->cflags[1] & CFLAGS_BMODEL_MIRROR_INSIDE)) {
@ -678,7 +678,7 @@ CSGFaces(const mapentity_t *entity)
* All of the faces left on the outside list are real surface faces
* If the brush is non-solid, mirror faces for the inside view
*/
mirror = true;//brush->contents != CONTENTS_SOLID);
mirror = options.fContentHack ? true : (brush->contents != CONTENTS_SOLID);
SaveFacesToPlaneList(outside, mirror, planefaces);
progress++;

View File

@ -689,6 +689,7 @@ PrintOptions(void)
" -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"
" -contenthack Hack to fix leaks through solids. Causes missing faces in some cases so disabled by default.\n"
" sourcefile .MAP file to process\n"
" destfile .BSP file to output\n");
@ -891,6 +892,8 @@ ParseOptions(char *szOptions)
options.fTestExpand = true;
} else if (!Q_strcasecmp(szTok, "leaktest")) {
options.fLeakTest = true;
} else if (!Q_strcasecmp(szTok, "contenthack")) {
options.fContentHack = true;
} else if (!Q_strcasecmp(szTok, "?") || !Q_strcasecmp(szTok, "help"))
PrintOptions();
else