Level editor work

This commit is contained in:
elasota
2020-01-04 01:19:01 -05:00
parent ec7e511cdd
commit a4b8db1065
29 changed files with 358 additions and 168 deletions

View File

@@ -13,6 +13,9 @@ struct Point
Point operator-(const Point &other) const;
Point operator+(const Point &other) const;
Point &operator-=(const Point &other);
Point &operator+=(const Point &other);
static Point Create(int16_t h, int16_t v);
};
@@ -117,6 +120,20 @@ inline Point Point::operator+(const Point &other) const
return Point::Create(this->h + other.h, this->v + other.v);
}
inline Point &Point::operator-=(const Point &other)
{
this->h -= other.h;
this->v -= other.v;
return *this;
}
inline Point &Point::operator+=(const Point &other)
{
this->h += other.h;
this->v += other.v;
return *this;
}
inline Point Point::Create(int16_t h, int16_t v)
{
Point p;