mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-04 13:42:55 +01:00
use builtin min and max
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
/**
|
||||
* Common mathematical functions.
|
||||
*/
|
||||
@@ -7,17 +9,17 @@ namespace Math {
|
||||
|
||||
template<typename T>
|
||||
T Min(T a, T b) {
|
||||
return a < b ? a : b;
|
||||
return (std::min)(a, b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T Max(T a, T b) {
|
||||
return a > b ? a : b;
|
||||
return (std::max)(a, b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T Clamp(T low, T x, T high) {
|
||||
return Min(Max(low, x), high);
|
||||
return (std::min)((std::max)(low, x), high);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ extern "C" {
|
||||
}
|
||||
|
||||
#include "../core/FileStream.hpp"
|
||||
#include "../core/Math.hpp"
|
||||
#include "../core/Memory.hpp"
|
||||
#include "../core/StringBuilder.hpp"
|
||||
#include "LanguagePack.h"
|
||||
|
||||
Reference in New Issue
Block a user