(svn r23316) -Feature: Add ability to zoom in to 2x and 4x level.

This commit is contained in:
peter1138
2011-11-24 12:38:48 +00:00
parent 9e0e4bf639
commit b84174fd4d
29 changed files with 331 additions and 128 deletions

View File

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