17 const int isoX =
static_cast<int>(
18 (screenCoordinates.x + cameraOffset.x + 2.0 * (screenCoordinates.y + cameraOffset.y)) / (tileSize.x * zoomLevel) + 1);
19 const int isoY =
static_cast<int>((screenCoordinates.x + cameraOffset.x - 2.0 * (screenCoordinates.y + cameraOffset.y)) /
20 (tileSize.x * zoomLevel));
22 return {isoX, isoY, 0, 0};
27 const int heightOffset = 24;
32 int x =
static_cast<int>(std::round(
static_cast<double>((isoCoordinates.
x + isoCoordinates.
y) * tileSize.x) * zoomLevel) / 2);
33 int y =
static_cast<int>(std::round(
static_cast<double>((isoCoordinates.
x - isoCoordinates.
y) * tileSize.y) * zoomLevel) / 2);
35 if (!calcWithoutOffset)
41 if (isoCoordinates.
height > 0)
43 y -=
static_cast<int>(std::round(
static_cast<double>((tileSize.x - heightOffset) * isoCoordinates.
height) * zoomLevel));
56 if (foundCoordinates.
x == -1)
59 if (foundCoordinates.
x < 0)
61 foundCoordinates.
x = 0;
68 if (foundCoordinates.
y < 0)
70 foundCoordinates.
y = 0;
78 return foundCoordinates;
83 for (
auto p : isoCoordinates)
85 if (!(p.isWithinMapBoundaries()))