Most remaining level editor work

This commit is contained in:
elasota
2020-03-01 17:01:35 -05:00
parent abd4f1a978
commit 7b27d6c6b5
48 changed files with 1211 additions and 945 deletions

View File

@@ -40,7 +40,8 @@ namespace PortabilityLayer
void SetRight(int32_t i);
bool IsValid() const;
Rect2i Intersect(const Rect2i &other) const;
Rect2i Intersect(const Rect2i &other) const;
bool Contains(const Vec2i &pt) const;
Rect ToShortRect() const;
};
@@ -156,6 +157,11 @@ namespace PortabilityLayer
const int32_t right = std::min(m_bottomRight.m_x, other.m_bottomRight.m_x);
return Rect2i(top, left, bottom, right);
}
inline bool Rect2i::Contains(const Vec2i &pt) const
{
return pt.m_x >= m_topLeft.m_x && pt.m_x < m_bottomRight.m_x && pt.m_y >= m_topLeft.m_y && pt.m_y < m_bottomRight.m_y;
}
inline Rect Rect2i::ToShortRect() const