diff --git a/src/gui/core/point.cpp b/src/gui/core/point.cpp index 33fcf9e07aef..dfa8307ef005 100644 --- a/src/gui/core/point.cpp +++ b/src/gui/core/point.cpp @@ -20,6 +20,10 @@ namespace gui2 { +point::operator SDL_Point() +{ + return {x, y}; +} point& point::operator+=(const point& point) { diff --git a/src/gui/core/point.hpp b/src/gui/core/point.hpp index 5e676605654d..d9652e3d9583 100644 --- a/src/gui/core/point.hpp +++ b/src/gui/core/point.hpp @@ -14,6 +14,8 @@ #pragma once +#include + #include namespace gui2 @@ -36,6 +38,9 @@ struct point /** y coordinate. */ int y; + /** Allow implicit conversion to SDL_Point. */ + operator SDL_Point(); + bool operator==(const point& point) const { return x == point.x && y == point.y;