diff options
| author | Jens Nyberg <jens.nyberg@gmail.com> | 2014-03-27 00:24:48 +0100 |
|---|---|---|
| committer | Jens Nyberg <jens.nyberg@gmail.com> | 2014-03-27 00:24:48 +0100 |
| commit | 478a27e0521fb59b0b0d06c59c9b664744c33900 (patch) | |
| tree | 70606891f585e32bcf55c5abd6c33bf2bc87312e /Source/Core/VideoCommon/VertexLoader.cpp | |
| parent | 0c62ae9c1a530acd255404f389c7859194d4a057 (diff) | |
VideoCommon/VertexLoader: Remove duplicate point min and max calculation
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoader.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoader.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader.cpp b/Source/Core/VideoCommon/VertexLoader.cpp index e36c4d848c..1956902df2 100644 --- a/Source/Core/VideoCommon/VertexLoader.cpp +++ b/Source/Core/VideoCommon/VertexLoader.cpp @@ -307,22 +307,18 @@ void LOADERDECL UpdateBoundingBox() // If the polygon is inside viewport, let's update the bounding box and be done with it if ((b0 == 3) && (b0 == b1) && (b0 == b2)) { - // Line - if (numPoints == 2) - { - left = (p0.x < p1.x) ? p0.x : p1.x; - top = (p0.y < p1.y) ? p0.y : p1.y; - right = (p0.x > p1.x) ? p0.x : p1.x; - bottom = (p0.y > p1.y) ? p0.y : p1.y; - } + left = std::min(p0.x, p1.x); + top = std::min(p0.y, p1.y); + right = std::max(p0.x, p1.x); + bottom = std::max(p0.y, p1.y); // Triangle - else + if (numPoints == 3) { - left = (p0.x < p1.x) ? (p0.x < p2.x) ? p0.x : p2.x : (p1.x < p2.x) ? p1.x : p2.x; - top = (p0.y < p1.y) ? (p0.y < p2.y) ? p0.y : p2.y : (p1.y < p2.y) ? p1.y : p2.y; - right = (p0.x > p1.x) ? (p0.x > p2.x) ? p0.x : p2.x : (p1.x > p2.x) ? p1.x : p2.x; - bottom = (p0.y > p1.y) ? (p0.y > p2.y) ? p0.y : p2.y : (p1.y > p2.y) ? p1.y : p2.y; + left = std::min(left, p2.x); + top = std::min(top, p2.y); + right = std::max(right, p2.x); + bottom = std::max(bottom, p2.y); } // Update bounding box |
