summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-06-10 08:18:40 +0000
committersmatz <smatz@openttd.org>2009-06-10 08:18:40 +0000
commitec78a39f9e242930f3f83a3cb44858d392b3786f (patch)
tree62a4f5a1227cc77847fd1d173d33cf8b15a41dd1 /src/map.cpp
parent4e2c1ef08f6544e59614b8cdacd6d67fb8092306 (diff)
downloadopenttd-ec78a39f9e242930f3f83a3cb44858d392b3786f.tar.xz
(svn r16550) -Codechange: move definition of ScaleByMapSize to header file, use shifts instead of mults
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/map.cpp b/src/map.cpp
index cdca65e00..3dfe47890 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -93,37 +93,6 @@ TileIndex TileAdd(TileIndex tile, TileIndexDiff add,
#endif
/*!
- * Scales the given value by the map size, where the given value is
- * for a 256 by 256 map.
- * @param n the value to scale
- * @return the scaled size
- */
-uint ScaleByMapSize(uint n)
-{
- /* First shift by 12 to prevent integer overflow for large values of n.
- * >>12 is safe since the min mapsize is 64x64
- * Add (1<<4)-1 to round upwards. */
- return (n * (MapSize() >> 12) + (1 << 4) - 1) >> 4;
-}
-
-
-/*!
- * Scales the given value by the maps circumference, where the given
- * value is for a 256 by 256 map
- * @param n the value to scale
- * @return the scaled size
- */
-uint ScaleByMapSize1D(uint n)
-{
- /* Normal circumference for the X+Y is 256+256 = 1<<9
- * Note, not actually taking the full circumference into account,
- * just half of it.
- * (1<<9) - 1 is there to scale upwards. */
- return (n * (MapSizeX() + MapSizeY()) + (1 << 9) - 1) >> 9;
-}
-
-
-/*!
* This function checks if we add addx/addy to tile, if we
* do wrap around the edges. For example, tile = (10,2) and
* addx = +3 and addy = -4. This function will now return