summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-01-31 07:23:15 +0000
committertron <tron@openttd.org>2005-01-31 07:23:15 +0000
commit7bbcf5875c2fc6a8fa80e417d65e1094947d78b8 (patch)
treec97da17a330889a788b8654dddbc7507d01b3b38 /misc.c
parente1c19367f0cebbe90596319e9f82d959fa54621c (diff)
downloadopenttd-7bbcf5875c2fc6a8fa80e417d65e1094947d78b8.tar.xz
(svn r1749) Move the functions which calculate distances to map.[ch] and give the more meaningful names
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/misc.c b/misc.c
index d8bd83b3f..f4e363585 100644
--- a/misc.c
+++ b/misc.c
@@ -533,43 +533,6 @@ void InitializeLandscapeVariables(bool only_constants)
}
}
-// distance in Manhattan metric
-uint GetTileDist(TileIndex xy1, TileIndex xy2)
-{
- return myabs(TileX(xy1) - TileX(xy2)) +
- myabs(TileY(xy1) - TileY(xy2));
-}
-
-// maximum distance in x _or_ y
-uint GetTileDist1D(TileIndex xy1, TileIndex xy2)
-{
- return max(myabs(TileX(xy1) - TileX(xy2)),
- myabs(TileY(xy1) - TileY(xy2)));
-}
-
-uint GetTileDist1Db(TileIndex xy1, TileIndex xy2)
-{
- int a = myabs(TileX(xy1) - TileX(xy2));
- int b = myabs(TileY(xy1) - TileY(xy2));
-
- if (a > b)
- return a*2+b;
- else
- return b*2+a;
-}
-
-uint GetTileDistAdv(TileIndex xy1, TileIndex xy2)
-{
- uint a = myabs(TileX(xy1) - TileX(xy2));
- uint b = myabs(TileY(xy1) - TileY(xy2));
- return a*a+b*b;
-}
-
-bool CheckDistanceFromEdge(TileIndex tile, uint distance)
-{
- return IS_INT_INSIDE(TileX(tile), distance, MapSizeX() - distance) &&
- IS_INT_INSIDE(TileY(tile), distance, MapSizeY() - distance);
-}
void OnNewDay_Train(Vehicle *v);
void OnNewDay_RoadVeh(Vehicle *v);