diff options
author | peter1138 <peter1138@openttd.org> | 2011-11-24 12:38:48 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2011-11-24 12:38:48 +0000 |
commit | 81598273e9b6bb2ee20ebdd82f3d4646a02999ba (patch) | |
tree | 2d13cc93dc84f2d99cff6fc2bb02214d4453f033 /src/landscape.h | |
parent | 15d0a22aac6b90a2055e68d019cab4350376a8fd (diff) | |
download | openttd-81598273e9b6bb2ee20ebdd82f3d4646a02999ba.tar.xz |
(svn r23316) -Feature: Add ability to zoom in to 2x and 4x level.
Diffstat (limited to 'src/landscape.h')
-rw-r--r-- | src/landscape.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/landscape.h b/src/landscape.h index c1680d1be..7a3dc03a8 100644 --- a/src/landscape.h +++ b/src/landscape.h @@ -14,6 +14,7 @@ #include "core/geometry_type.hpp" #include "tile_cmd.h" +#include "zoom_type.h" static const uint SNOW_LINE_MONTHS = 12; ///< Number of months in the snow line table. static const uint SNOW_LINE_DAYS = 32; ///< Number of days in each month in the snow line table. @@ -83,8 +84,8 @@ static inline Slope GetFoundationPixelSlope(TileIndex tile, int *z) static inline Point RemapCoords(int x, int y, int z) { Point pt; - pt.x = (y - x) * 2; - pt.y = y + x - z; + pt.x = (y - x) * 2 * ZOOM_LVL_BASE; + pt.y = (y + x - z) * ZOOM_LVL_BASE; return pt; } @@ -111,7 +112,7 @@ static inline Point RemapCoords2(int x, int y) */ static inline Point InverseRemapCoords(int x, int y) { - Point pt = {(y * 2 - x) >> 2, (y * 2 + x) >> 2}; + Point pt = {(y * 2 - x) >> (2 + ZOOM_LVL_SHIFT), (y * 2 + x) >> (2 + ZOOM_LVL_SHIFT)}; return pt; } |