mirror of https://github.com/OpenRCT2/OpenRCT2.git
Create ScreenLine struct
This commit is contained in:
parent
70e245a1c3
commit
5ce65eb7dc
|
@ -666,7 +666,7 @@ struct MapRange : public CoordsRange<CoordsXY>
|
||||||
assert(std::abs(GetLeft() - GetRight()) > 0);
|
assert(std::abs(GetLeft() - GetRight()) > 0);
|
||||||
assert(std::abs(GetTop() - GetBottom()) > 0);
|
assert(std::abs(GetTop() - GetBottom()) > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
MapRange Normalise() const
|
MapRange Normalise() const
|
||||||
{
|
{
|
||||||
auto result = MapRange(
|
auto result = MapRange(
|
||||||
|
@ -675,3 +675,17 @@ struct MapRange : public CoordsRange<CoordsXY>
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a line on the screen
|
||||||
|
*/
|
||||||
|
|
||||||
|
struct ScreenLine : public CoordsRange<ScreenCoordsXY>
|
||||||
|
{
|
||||||
|
ScreenLine(const ScreenCoordsXY& leftTop, const ScreenCoordsXY& rightBottom)
|
||||||
|
: CoordsRange<ScreenCoordsXY>(leftTop, rightBottom)
|
||||||
|
{
|
||||||
|
// Make sure one of the point coords change
|
||||||
|
assert((std::abs(GetLeft() - GetRight()) > 0) || (std::abs(GetTop() - GetBottom()) > 0));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue