Skip to content

Commit 4857018

Browse files
committed
Fix compiler bug with min and max
1 parent ae54f66 commit 4857018

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

Spore ModAPI/SourceCode/Math.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ namespace Math
4848
// convert to [-PI, PI]
4949
if (angle2 >= PI) angle2 = angle2 - PI2;
5050

51-
float minAngle = min(angle1, angle2);
52-
float maxAngle = max(angle1, angle2);
51+
float minAngle = eastl::min(angle1, angle2);
52+
float maxAngle = eastl::max(angle1, angle2);
5353

5454
float result = PI2 - maxAngle + minAngle;
5555
if ((maxAngle - minAngle) <= result)
@@ -520,16 +520,16 @@ namespace Math
520520

521521
bool BoundingBox::Intersect(const BoundingBox& other, BoundingBox& dst) const
522522
{
523-
dst.lower.x = max(lower.x, other.lower.x);
524-
dst.upper.x = min(upper.x, other.upper.x);
523+
dst.lower.x = eastl::max(lower.x, other.lower.x);
524+
dst.upper.x = eastl::min(upper.x, other.upper.x);
525525
if (dst.lower.x >= dst.upper.x) return false;
526526

527-
dst.lower.y = max(lower.y, other.lower.y);
528-
dst.upper.y = min(upper.y, other.upper.y);
527+
dst.lower.y = eastl::max(lower.y, other.lower.y);
528+
dst.upper.y = eastl::min(upper.y, other.upper.y);
529529
if (dst.lower.y >= dst.upper.y) return false;
530530

531-
dst.lower.z = max(lower.z, other.lower.z);
532-
dst.upper.z = min(upper.z, other.upper.z);
531+
dst.lower.z = eastl::max(lower.z, other.lower.z);
532+
dst.upper.z = eastl::min(upper.z, other.upper.z);
533533
if (dst.lower.z >= dst.upper.z) return false;
534534

535535
return true;

0 commit comments

Comments
 (0)