summaryrefslogtreecommitdiff
path: root/src/map_func.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-05-02 17:42:12 +0000
committerrubidium <rubidium@openttd.org>2011-05-02 17:42:12 +0000
commitfb5ecb94992e7febf4bc059cb6ec4a51f50c66b0 (patch)
tree87956636c318baa8d5d8d62f13263c4f64dbe881 /src/map_func.h
parent4d5dbf51707c42c24eeafdb65016b079c54adcf2 (diff)
downloadopenttd-fb5ecb94992e7febf4bc059cb6ec4a51f50c66b0.tar.xz
(svn r22411) -Document: another bunch of bits
Diffstat (limited to 'src/map_func.h')
-rw-r--r--src/map_func.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/map_func.h b/src/map_func.h
index a2b866483..105090fd8 100644
--- a/src/map_func.h
+++ b/src/map_func.h
@@ -187,6 +187,12 @@ static inline TileIndexDiff TileDiffXY(int x, int y)
return (y * MapSizeX()) + x;
}
+/**
+ * Get a tile from the virtual XY-coordinate.
+ * @param x The virtual x coordinate of the tile.
+ * @param y The virtual y coordinate of the tile.
+ * @return The TileIndex calculated by the coordinate.
+ */
static inline TileIndex TileVirtXY(uint x, uint y)
{
return (y >> 4 << MapLogX()) + (x >> 4);