diff options
author | tron <tron@openttd.org> | 2005-01-31 07:23:15 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-01-31 07:23:15 +0000 |
commit | 7bbcf5875c2fc6a8fa80e417d65e1094947d78b8 (patch) | |
tree | c97da17a330889a788b8654dddbc7507d01b3b38 /map.h | |
parent | e1c19367f0cebbe90596319e9f82d959fa54621c (diff) | |
download | openttd-7bbcf5875c2fc6a8fa80e417d65e1094947d78b8.tar.xz |
(svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names
Diffstat (limited to 'map.h')
-rw-r--r-- | map.h | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -72,6 +72,14 @@ static inline TileIndexDiff ToTileIndexDiff(TileIndexDiffC tidc) #define TILE_ADDXY(tile, x, y) TILE_ADD(tile, TILE_XY(x, y)) +// Functions to calculate distances +uint DistanceManhattan(TileIndex, TileIndex); // also known as L1-Norm +uint DistanceSquare(TileIndex, TileIndex); // euclidian- or L2-Norm squared +uint DistanceMax(TileIndex, TileIndex); // also known as L-Infinity-Norm +uint DistanceMaxPlusManhattan(TileIndex, TileIndex); // Max + Manhattan +uint DistanceFromEdge(TileIndex); // shortest distance from any edge of the map + + static inline TileIndexDiff TileOffsByDir(uint dir) { extern const TileIndexDiffC _tileoffs_by_dir[4]; |