From 2fd6addea60dc7edfc13a4330be95e50262435d8 Mon Sep 17 00:00:00 2001 From: asasas9500 Date: Sun, 21 Jun 2020 14:31:35 -0300 Subject: [PATCH] Fix namespace --- TR5Main/Game/collide.cpp | 10 +++++----- TR5Main/Game/collide.h | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/TR5Main/Game/collide.cpp b/TR5Main/Game/collide.cpp index 9671708be..08bc7941b 100644 --- a/TR5Main/Game/collide.cpp +++ b/TR5Main/Game/collide.cpp @@ -70,7 +70,7 @@ int CollideStaticObjects(COLL_INFO* coll, int x, int y, int z, short roomNumber, int yMin = mesh->y + sInfo->xMinc; int yMax = mesh->y + sInfo->yMaxc; - array box{sInfo->xMinc, sInfo->zMinc, sInfo->xMaxc, sInfo->zMaxc}; + std::array box{sInfo->xMinc, sInfo->zMinc, sInfo->xMaxc, sInfo->zMaxc}; RotateBoundingBox(box, mesh->yRot); xMin = box[0]; @@ -1707,12 +1707,12 @@ Vector2 GetDiagonalIntersect(int xPos, int zPos, int splitType, int radius, shor return vect; } -void RotateBoundingBox(array& box, short angle) +void RotateBoundingBox(std::array& box, short angle) { float s = sin(TO_RAD(angle)); float c = cos(TO_RAD(angle)); - array x, z; + std::array x, z; x[0] = box[0] * c; z[0] = -box[0] * s; x[1] = box[1] * s; @@ -1722,8 +1722,8 @@ void RotateBoundingBox(array& box, short angle) x[3] = box[3] * s; z[3] = box[3] * c; - auto xPair = minmax_element(begin(x), end(x)); - auto zPair = minmax_element(begin(z), end(z)); + auto xPair = std::minmax_element(begin(x), end(x)); + auto zPair = std::minmax_element(begin(z), end(z)); box[0] = *xPair.first; box[1] = *zPair.first; diff --git a/TR5Main/Game/collide.h b/TR5Main/Game/collide.h index 8c589f2ec..703c0a344 100644 --- a/TR5Main/Game/collide.h +++ b/TR5Main/Game/collide.h @@ -131,7 +131,7 @@ bool SnapToQuadrant(short& angle, int interval); int GetQuadrant(short angle); bool SnapToDiagonal(short& angle, int interval); int GetOctant(short angle); -void RotateBoundingBox(array& box, short angle); +void RotateBoundingBox(std::array& box, short angle); // New function for rotating item along XZ slopes. // (int radiusDivide) is for radiusZ, else the MaxZ is too high and cause rotation problem ! // Dont need to set a value in radiusDivide if you dont need it (radiusDivide is set to 1 by default).