mirror of https://github.com/OpenRCT2/OpenRCT2.git
Remove <algorithm> include from Location.hpp (#21993)
See #21947 for methodology 528-372=156 `#include <algorithm>`s fewer
This commit is contained in:
parent
613d60b446
commit
24a2db9fc9
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "Theme.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/Version.h>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <openrct2-ui/interface/Dropdown.h>
|
||||
#include <openrct2-ui/interface/LandTool.h>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <openrct2-ui/interface/LandTool.h>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
@ -15,6 +16,7 @@
|
|||
#include <openrct2/localisation/Formatter.h>
|
||||
#include <openrct2/localisation/Localisation.h>
|
||||
#include <openrct2/world/Scenery.h>
|
||||
|
||||
namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
enum WindowSceneryScatterWidgetIdx
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
||||
*****************************************************************************/
|
||||
|
||||
#include <algorithm>
|
||||
#include <openrct2-ui/interface/Widget.h>
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
#include <openrct2/Context.h>
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#include "../world/TileElementsView.h"
|
||||
#include "../world/Wall.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
FootpathPlaceAction::FootpathPlaceAction(
|
||||
|
|
|
@ -12,8 +12,6 @@
|
|||
#include "../common.h"
|
||||
#include "../util/Math.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
constexpr int16_t LOCATION_NULL = -32768;
|
||||
|
||||
constexpr int32_t COORDS_XY_STEP = 32;
|
||||
|
@ -810,9 +808,14 @@ struct MapRange : public RectRange<CoordsXY>
|
|||
|
||||
constexpr MapRange Normalise() const
|
||||
{
|
||||
// Don't use std::min/max, as they require <algorithm>, 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;
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue