 |
Cytopia
0.3
A city building simulation game
|
Go to the documentation of this file.
63 template <
typename T> T
clamp(
const T &n,
const T &lower,
const T &upper) {
return std::max(lower, std::min(n, upper)); }
std::vector< Point > getRectangleSelectionNodes(const Point &isoCoordinatesStart, const Point &isoCoordinatesEnd)
Gets all nodes in a rectangle between start and end point.
SDL_Point convertIsoToScreenCoordinates(const Point &isoCoordinates, bool calcWithoutOffset=false)
converts coordinates from isometric to screen space
T clamp(const T &n, const T &lower, const T &upper)
Clamp value.
Point calculateIsoCoordinates(const SDL_Point &screenCoordinates)
Calculates screen space coordinates to isometric space coordinates.
std::vector< Point > createBresenhamLine(const Point &isoCoordinatesStart, const Point &isoCoordinatesEnd)
Creates a line between two points using the Bresenham Line algorithm.
bool isPointWithinMapBoundaries(const std::vector< Point > &isoCoordinates)
Check if given coordinates are within map boundaries.
Point convertScreenToIsoCoordinates(const SDL_Point &screenCoordinates)
converts screen space coordinates to isometric space coordinates.