summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-02-06 09:30:30 +0000
committeralberth <alberth@openttd.org>2010-02-06 09:30:30 +0000
commit21c3dd11bdc0574a1ac7d7c0c7094b6ab82b8044 (patch)
treef3805380fbb15bf9954602bf9a38f6ff54efd8d3 /src
parent3f2c4d744a1b2abae15229b32a0692ed2c0033ee (diff)
downloadopenttd-21c3dd11bdc0574a1ac7d7c0c7094b6ab82b8044.tar.xz
(svn r19027) -Doc: Document RemapCoords functions.
Diffstat (limited to 'src')
-rw-r--r--src/landscape.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/landscape.h b/src/landscape.h
index cc64b0cf1..d439f9171 100644
--- a/src/landscape.h
+++ b/src/landscape.h
@@ -41,6 +41,14 @@ void GetSlopeZOnEdge(Slope tileh, DiagDirection edge, int *z1, int *z2);
int GetSlopeZInCorner(Slope tileh, Corner corner);
Slope GetFoundationSlope(TileIndex tile, uint *z);
+/**
+ * Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
+ * @param x X world or tile coordinate (runs in SW direction in the 2D view).
+ * @param y Y world or tile coordinate (runs in SE direction in the 2D view).
+ * @param z Z world or tile coordinate (runs in N direction in the 2D view).
+ * @return Equivalent coordinate in the 2D view.
+ * @see RemapCoords2
+ */
static inline Point RemapCoords(int x, int y, int z)
{
Point pt;
@@ -49,6 +57,14 @@ static inline Point RemapCoords(int x, int y, int z)
return pt;
}
+/**
+ * Map 3D world or tile coordinate to equivalent 2D coordinate as used in the viewports and smallmap.
+ * Same as #RemapCoords, except the Z coordinate is read from the map.
+ * @param x X world or tile coordinate (runs in SW direction in the 2D view).
+ * @param y Y world or tile coordinate (runs in SE direction in the 2D view).
+ * @return Equivalent coordinate in the 2D view.
+ * @see RemapCoords
+ */
static inline Point RemapCoords2(int x, int y)
{
return RemapCoords(x, y, GetSlopeZ(x, y));