use std::abs in remaining places that were using C abs()

This commit is contained in:
Eric Wasylishen 2023-08-07 15:23:12 -06:00
parent 89b21b2612
commit db42b2116a
4 changed files with 4 additions and 4 deletions

View File

@ -277,7 +277,7 @@ static void CheckBSPFile(const mbsp_t *bsp)
const int edgenum = bsp->dsurfedges[i];
if (!edgenum)
fmt::print("warning: surfedge {} has zero value!\n", i);
if (abs(edgenum) >= bsp->dedges.size())
if (std::abs(edgenum) >= bsp->dedges.size())
fmt::print("warning: surfedge {} is out of range (abs({}) >= {})\n", i, edgenum, bsp->dedges.size());
}

View File

@ -908,7 +908,7 @@ public:
{
vec_t max_dist = 0.0;
for (size_t i = 0; i < size(); i++) {
vec_t dist = abs(plane.distance_to(at(i)));
vec_t dist = std::abs(plane.distance_to(at(i)));
if (dist > max_dist) {
max_dist = dist;
}

View File

@ -1877,7 +1877,7 @@ static void LightFace_PhongDebug(const mbsp_t *bsp, const lightsurf_t *lightsurf
sample.color = lightsurf->samples[i].normal;
for (auto &v : sample.color) {
v = abs(v) * 255;
v = std::abs(v) * 255;
}
}

View File

@ -1029,7 +1029,7 @@ static side_t *SelectSplitPlane(
// give a value estimate for using this plane
int value = 5 * facing - 5 * splits - abs(front - back);
int value = 5 * facing - 5 * splits - std::abs(front - back);
// value = -5*splits;
// value = 5*facing - 5*splits;
if (plane.get_type() < plane_type_t::PLANE_ANYX)