summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2019-04-12 18:46:49 +0200
committerglx22 <glx22@users.noreply.github.com>2019-04-18 21:49:34 +0200
commit9195f2337a7c4f9154058877093bbb74db33cf32 (patch)
tree4b04354f9ba835623db51f961ba5c2f9c0342e47 /src/core
parent25e534f3cf42a723f97d6fc08d582329e60a0186 (diff)
downloadopenttd-9195f2337a7c4f9154058877093bbb74db33cf32.tar.xz
Codechange: use std::vector for _resolutions
Diffstat (limited to 'src/core')
-rw-r--r--src/core/geometry_type.hpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/geometry_type.hpp b/src/core/geometry_type.hpp
index d1f363127..2927cd980 100644
--- a/src/core/geometry_type.hpp
+++ b/src/core/geometry_type.hpp
@@ -29,6 +29,20 @@ struct Point {
struct Dimension {
uint width;
uint height;
+
+ Dimension(uint w = 0, uint h = 0) : width(w), height(h) {};
+
+ bool operator< (const Dimension &other) const
+ {
+ int x = (*this).width - other.width;
+ if (x != 0) return x < 0;
+ return (*this).height < other.height;
+ }
+
+ bool operator== (const Dimension &other) const
+ {
+ return (*this).width == other.width && (*this).height == other.height;
+ }
};
/** Specification of a rectangle with absolute coordinates of all edges */