remove extraneous warnings when they don't matter
This commit is contained in:
parent
e5602358c1
commit
5b56ecfb28
|
|
@ -73,7 +73,7 @@ struct bspbrush_t
|
||||||
qvec3d sphere_origin;
|
qvec3d sphere_origin;
|
||||||
double sphere_radius;
|
double sphere_radius;
|
||||||
|
|
||||||
bool update_bounds();
|
bool update_bounds(bool warn_on_failures);
|
||||||
|
|
||||||
std::unique_ptr<bspbrush_t> copy_unique() const;
|
std::unique_ptr<bspbrush_t> copy_unique() const;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ bool CreateBrushWindings(bspbrush_t *brush)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return brush->update_bounds();
|
return brush->update_bounds(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -578,7 +578,7 @@ void Brush_LoadEntity(mapentity_t *entity, const int hullnum, bspbrush_vector_t
|
||||||
qbsp_options.target_game->print_content_stats(*stats, "brushes");
|
qbsp_options.target_game->print_content_stats(*stats, "brushes");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bspbrush_t::update_bounds()
|
bool bspbrush_t::update_bounds(bool warn_on_failures)
|
||||||
{
|
{
|
||||||
this->bounds = {};
|
this->bounds = {};
|
||||||
|
|
||||||
|
|
@ -591,11 +591,15 @@ bool bspbrush_t::update_bounds()
|
||||||
for (size_t i = 0; i < 3; i++) {
|
for (size_t i = 0; i < 3; i++) {
|
||||||
// todo: map_source_location in bspbrush_t
|
// todo: map_source_location in bspbrush_t
|
||||||
if (this->bounds.mins()[0] <= -qbsp_options.worldextent.value() || this->bounds.maxs()[0] >= qbsp_options.worldextent.value()) {
|
if (this->bounds.mins()[0] <= -qbsp_options.worldextent.value() || this->bounds.maxs()[0] >= qbsp_options.worldextent.value()) {
|
||||||
|
if (warn_on_failures) {
|
||||||
logging::print("WARNING: {}: brush bounds out of range\n", mapbrush ? mapbrush->line : parser_source_location());
|
logging::print("WARNING: {}: brush bounds out of range\n", mapbrush ? mapbrush->line : parser_source_location());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this->bounds.mins()[0] >= qbsp_options.worldextent.value() || this->bounds.maxs()[0] <= -qbsp_options.worldextent.value()) {
|
if (this->bounds.mins()[0] >= qbsp_options.worldextent.value() || this->bounds.maxs()[0] <= -qbsp_options.worldextent.value()) {
|
||||||
|
if (warn_on_failures) {
|
||||||
logging::print("WARNING: {}: no visible sides on brush\n", mapbrush ? mapbrush->line : parser_source_location());
|
logging::print("WARNING: {}: no visible sides on brush\n", mapbrush ? mapbrush->line : parser_source_location());
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -527,9 +527,12 @@ static twosided<std::unique_ptr<bspbrush_t>> SplitBrush(std::unique_ptr<bspbrush
|
||||||
// see if we have valid polygons on both sides
|
// see if we have valid polygons on both sides
|
||||||
|
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
result[i]->update_bounds();
|
|
||||||
|
|
||||||
bool bogus = false;
|
bool bogus = false;
|
||||||
|
|
||||||
|
if (!result[i]->update_bounds(false)) {
|
||||||
|
stats.c_bogus++;
|
||||||
|
bogus = true;
|
||||||
|
} else {
|
||||||
for (int j = 0; j < 3; j++) {
|
for (int j = 0; j < 3; j++) {
|
||||||
if (result[i]->bounds.mins()[j] < -qbsp_options.worldextent.value() || result[i]->bounds.maxs()[j] > qbsp_options.worldextent.value()) {
|
if (result[i]->bounds.mins()[j] < -qbsp_options.worldextent.value() || result[i]->bounds.maxs()[j] > qbsp_options.worldextent.value()) {
|
||||||
stats.c_bogus++;
|
stats.c_bogus++;
|
||||||
|
|
@ -537,6 +540,7 @@ static twosided<std::unique_ptr<bspbrush_t>> SplitBrush(std::unique_ptr<bspbrush
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (result[i]->sides.size() < 3 || bogus) {
|
if (result[i]->sides.size() < 3 || bogus) {
|
||||||
result[i] = nullptr;
|
result[i] = nullptr;
|
||||||
|
|
@ -1035,8 +1039,6 @@ static std::unique_ptr<tree_t> BrushBSP_internal(mapentity_t *entity, std::vecto
|
||||||
{
|
{
|
||||||
auto tree = std::make_unique<tree_t>();
|
auto tree = std::make_unique<tree_t>();
|
||||||
|
|
||||||
logging::funcheader();
|
|
||||||
|
|
||||||
size_t c_faces = 0;
|
size_t c_faces = 0;
|
||||||
size_t c_nonvisfaces = 0;
|
size_t c_nonvisfaces = 0;
|
||||||
size_t c_brushes = 0;
|
size_t c_brushes = 0;
|
||||||
|
|
@ -1142,5 +1144,6 @@ static std::unique_ptr<tree_t> BrushBSP_internal(mapentity_t *entity, std::vecto
|
||||||
|
|
||||||
std::unique_ptr<tree_t> BrushBSP(mapentity_t *entity, const std::vector<std::unique_ptr<bspbrush_t>> &brushlist, std::optional<bool> forced_quick_tree)
|
std::unique_ptr<tree_t> BrushBSP(mapentity_t *entity, const std::vector<std::unique_ptr<bspbrush_t>> &brushlist, std::optional<bool> forced_quick_tree)
|
||||||
{
|
{
|
||||||
|
logging::funcheader();
|
||||||
return BrushBSP_internal(entity, MakeBspBrushList(brushlist), forced_quick_tree);
|
return BrushBSP_internal(entity, MakeBspBrushList(brushlist), forced_quick_tree);
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue