diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 12843d568c..9e483837b6 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -11,6 +11,7 @@ #include "Theme.h" +#include #include #include #include diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index fb6273f752..192492711f 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index d1ceca87c1..56a5ddd44c 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 6da6ae4f27..9e85f20c43 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include @@ -15,6 +16,7 @@ #include #include #include + namespace OpenRCT2::Ui::Windows { enum WindowSceneryScatterWidgetIdx diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index b9bd764502..8417ba037b 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -7,6 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include #include #include #include diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index c8eab3d63a..3b0bb7ec80 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -27,6 +27,8 @@ #include "../world/TileElementsView.h" #include "../world/Wall.h" +#include + using namespace OpenRCT2; FootpathPlaceAction::FootpathPlaceAction( diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index cffbbf94c9..9d46f411c2 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -12,8 +12,6 @@ #include "../common.h" #include "../util/Math.hpp" -#include - constexpr int16_t LOCATION_NULL = -32768; constexpr int32_t COORDS_XY_STEP = 32; @@ -810,9 +808,14 @@ struct MapRange : public RectRange constexpr MapRange Normalise() const { + // Don't use std::min/max, as they require , one of C++'s heaviest + // in this very common header. auto result = MapRange( - std::min(GetLeft(), GetRight()), std::min(GetTop(), GetBottom()), std::max(GetLeft(), GetRight()), - std::max(GetTop(), GetBottom())); + GetLeft() < GetRight() ? GetLeft() : GetRight(), // min + GetTop() < GetBottom() ? GetTop() : GetBottom(), // min + GetLeft() > GetRight() ? GetLeft() : GetRight(), // max + GetTop() > GetBottom() ? GetTop() : GetBottom() // max + ); return result; } };