MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / IsInRangeInclusive

Function IsInRangeInclusive

src/viewport.cpp:789–793  ·  view source on GitHub ↗

* Check if the parameter "check" is inside the interval between * begin and end, including both begin and end. * @note Whether \c begin or \c end is the biggest does not matter. * This method will account for that. * @param begin The begin of the interval. * @param end The end of the interval. * @param check The value to check. */

Source from the content-addressed store, hash-verified

787 * @param check The value to check.
788 */
789static bool IsInRangeInclusive(int begin, int end, int check)
790{
791 if (begin > end) std::swap(begin, end);
792 return begin <= check && check <= end;
793}
794
795/**
796 * Checks whether a point is inside the selected a diagonal rectangle given by _thd.size and _thd.pos

Callers 1

IsInsideRotatedRectangleFunction · 0.85

Calls 1

swapFunction · 0.85

Tested by

no test coverage detected