From 5ce65eb7dceb47b54a734a5931ee90a2c96cb3a4 Mon Sep 17 00:00:00 2001 From: Tulio Leao Date: Tue, 30 Jun 2020 09:26:42 -0300 Subject: [PATCH] Create ScreenLine struct --- src/openrct2/world/Location.hpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/openrct2/world/Location.hpp b/src/openrct2/world/Location.hpp index 773ffb5bfa..af9a0b8787 100644 --- a/src/openrct2/world/Location.hpp +++ b/src/openrct2/world/Location.hpp @@ -666,7 +666,7 @@ struct MapRange : public CoordsRange assert(std::abs(GetLeft() - GetRight()) > 0); assert(std::abs(GetTop() - GetBottom()) > 0); } - + MapRange Normalise() const { auto result = MapRange( @@ -675,3 +675,17 @@ struct MapRange : public CoordsRange return result; } }; + +/** + * Represents a line on the screen + */ + +struct ScreenLine : public CoordsRange +{ + ScreenLine(const ScreenCoordsXY& leftTop, const ScreenCoordsXY& rightBottom) + : CoordsRange(leftTop, rightBottom) + { + // Make sure one of the point coords change + assert((std::abs(GetLeft() - GetRight()) > 0) || (std::abs(GetTop() - GetBottom()) > 0)); + } +};