(svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names

This commit is contained in:
tron
2005-01-31 07:23:15 +00:00
parent e1c19367f0
commit 7bbcf5875c
18 changed files with 122 additions and 102 deletions

8
map.h
View File

@@ -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];