summary refs log tree commit diff stats
path: root/src/vector.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2019-03-16 17:45:16 -0400
committerKelly Rauchenberger <fefferburbia@gmail.com>2019-03-16 17:45:16 -0400
commit4a03d938451763dfb95b534f9002865e72ea7ec5 (patch)
tree9f2a0f074869009760fc33af5032c6de13da897e /src/vector.h
parent57fe8f3c4124819b95164547333a33f4c45eac8d (diff)
downloaddispatcher-4a03d938451763dfb95b534f9002865e72ea7ec5.tar.gz
dispatcher-4a03d938451763dfb95b534f9002865e72ea7ec5.tar.bz2
dispatcher-4a03d938451763dfb95b534f9002865e72ea7ec5.zip
Can click to place tiles in editor now HEAD master
Diffstat (limited to 'src/vector.h')
-rw-r--r--src/vector.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h index c207dc8..ed20936 100644 --- a/src/vector.h +++ b/src/vector.h
@@ -112,11 +112,29 @@ public:
112 return vec2(x() * other.x(), y() * other.y()); 112 return vec2(x() * other.x(), y() * other.y());
113 } 113 }
114 114
115 vec2& operator/=(T s)
116 {
117 x() /= s;
118 y() /= s;
119
120 return *this;
121 }
122
123 constexpr vec2 operator/(const vec2& other) const
124 {
125 return vec2(x() / other.x(), y() / other.y());
126 }
127
115 constexpr bool operator==(const vec2& other) const 128 constexpr bool operator==(const vec2& other) const
116 { 129 {
117 return (x() == other.x()) && (y() == other.y()); 130 return (x() == other.x()) && (y() == other.y());
118 } 131 }
119 132
133 constexpr bool operator!=(const vec2& other) const
134 {
135 return !(*this == other);
136 }
137
120}; 138};
121 139
122using vec2s = vec2<size_t>; 140using vec2s = vec2<size_t>;