- replaced MIN/MAX in all non-common code.

This commit is contained in:
Christoph Oelckers 2021-10-30 10:16:52 +02:00
commit 1d0aed219e
43 changed files with 147 additions and 146 deletions

View file

@ -57,8 +57,8 @@ DoomLevelAABBTree::DoomLevelAABBTree(FLevelLocals *lev)
FVector2 aabb_min, aabb_max;
const auto &left = nodes[staticroot];
const auto &right = nodes[dynamicroot];
aabb_min.X = MIN(left.aabb_left, right.aabb_left);
aabb_min.Y = MIN(left.aabb_top, right.aabb_top);
aabb_min.X = min(left.aabb_left, right.aabb_left);
aabb_min.Y = min(left.aabb_top, right.aabb_top);
aabb_max.X = MAX(left.aabb_right, right.aabb_right);
aabb_max.Y = MAX(left.aabb_bottom, right.aabb_bottom);
nodes.Push({ aabb_min, aabb_max, staticroot, dynamicroot });
@ -137,9 +137,9 @@ bool DoomLevelAABBTree::Update()
float y2 = (float)line.v2->fY();
int nodeIndex = path[0];
nodes[nodeIndex].aabb_left = MIN(x1, x2);
nodes[nodeIndex].aabb_left = min(x1, x2);
nodes[nodeIndex].aabb_right = MAX(x1, x2);
nodes[nodeIndex].aabb_top = MIN(y1, y2);
nodes[nodeIndex].aabb_top = min(y1, y2);
nodes[nodeIndex].aabb_bottom = MAX(y1, y2);
for (unsigned int j = 1; j < path.Size(); j++)
@ -147,8 +147,8 @@ bool DoomLevelAABBTree::Update()
auto &cur = nodes[path[j]];
const auto &left = nodes[cur.left_node];
const auto &right = nodes[cur.right_node];
cur.aabb_left = MIN(left.aabb_left, right.aabb_left);
cur.aabb_top = MIN(left.aabb_top, right.aabb_top);
cur.aabb_left = min(left.aabb_left, right.aabb_left);
cur.aabb_top = min(left.aabb_top, right.aabb_top);
cur.aabb_right = MAX(left.aabb_right, right.aabb_right);
cur.aabb_bottom = MAX(left.aabb_bottom, right.aabb_bottom);
}
@ -181,10 +181,10 @@ int DoomLevelAABBTree::GenerateTreeNode(int *lines, int num_lines, const FVector
float x2 = (float)maplines[mapLines[lines[i]]].v2->fX();
float y2 = (float)maplines[mapLines[lines[i]]].v2->fY();
aabb_min.X = MIN(aabb_min.X, x1);
aabb_min.X = MIN(aabb_min.X, x2);
aabb_min.Y = MIN(aabb_min.Y, y1);
aabb_min.Y = MIN(aabb_min.Y, y2);
aabb_min.X = min(aabb_min.X, x1);
aabb_min.X = min(aabb_min.X, x2);
aabb_min.Y = min(aabb_min.Y, y1);
aabb_min.Y = min(aabb_min.Y, y2);
aabb_max.X = MAX(aabb_max.X, x1);
aabb_max.X = MAX(aabb_max.X, x2);
aabb_max.Y = MAX(aabb_max.Y, y1);