qbsp: make "mixed face contents" error non-fatal if one of the leafnode or face is CONTENTS_EMPTY. from txqbsp-xt.

Fixes an issue necros was having.
This commit is contained in:
Eric Wasylishen 2015-07-30 18:31:38 -06:00
parent f24b1a1101
commit 9fd7305479
3 changed files with 42 additions and 3 deletions

View File

@ -149,4 +149,5 @@ const char *rgszWarnings[cWarnings] = {
"Healing degenerate edge (%f) at (%.3f %.3f %.3f)", "Healing degenerate edge (%f) at (%.3f %.3f %.3f)",
"No target for rotation entity \"%s\"", "No target for rotation entity \"%s\"",
"line %d: Face with degenerate QuArK-style texture axes", "line %d: Face with degenerate QuArK-style texture axes",
"Mixed face contents (%s, %s) near (%.2f %.2f %.2f)"
}; };

View File

@ -592,6 +592,37 @@ DivideNodeBounds(node_t *node, plane_t *split)
node->children[1]->mins, node->children[1]->maxs); node->children[1]->mins, node->children[1]->maxs);
} }
/*
==================
GetContentsName
==================
*/
const char *
GetContentsName( int Contents ) {
switch( Contents ) {
case CONTENTS_EMPTY:
return "Empty";
case CONTENTS_SOLID:
return "Solid";
case CONTENTS_WATER:
return "Water";
case CONTENTS_SLIME:
return "Slime";
case CONTENTS_LAVA:
return "Lava";
case CONTENTS_SKY:
return "Sky";
default:
return "Error";
}
}
/* /*
================== ==================
LinkConvexFaces LinkConvexFaces
@ -617,9 +648,15 @@ LinkConvexFaces(surface_t *planelist, node_t *leafnode)
count++; count++;
if (!leafnode->contents) if (!leafnode->contents)
leafnode->contents = f->contents[0]; leafnode->contents = f->contents[0];
else if (leafnode->contents != f->contents[0]) else if (leafnode->contents != f->contents[0]) {
Error("Mixed face contents in leafnode near (%.2f %.2f %.2f)", const bool OnlyWarn = leafnode->contents == CONTENTS_EMPTY || f->contents[ 0 ] == CONTENTS_EMPTY;
f->w.points[0][0], f->w.points[0][1], f->w.points[0][2]); Message(msgWarning, warnMixedFaceContents,
GetContentsName( leafnode->contents ), GetContentsName( f->contents[ 0 ] ),
f->w.points[0][0], f->w.points[0][1], f->w.points[0][2]);
if (!OnlyWarn) {
Error("Last mixed face contents was fatal");
}
}
} }
} }

View File

@ -46,5 +46,6 @@ enum {
warnDegenerateEdge, warnDegenerateEdge,
warnNoRotateTarget, warnNoRotateTarget,
warnDegenerateQuArKTX, warnDegenerateQuArKTX,
warnMixedFaceContents,
cWarnings cWarnings
}; };