diff --git a/indexer/point_to_int64.cpp b/indexer/point_to_int64.cpp index 696190792d..99848dc48a 100644 --- a/indexer/point_to_int64.cpp +++ b/indexer/point_to_int64.cpp @@ -14,7 +14,7 @@ namespace { -inline double CoordSize() { return (1 << POINT_COORD_BITS); } +inline double CoordSize(uint32_t coordBits) { return (1 << coordBits); } } diff --git a/indexer/point_to_int64.hpp b/indexer/point_to_int64.hpp index 3bb7325c40..2c798c987c 100644 --- a/indexer/point_to_int64.hpp +++ b/indexer/point_to_int64.hpp @@ -5,18 +5,22 @@ #include "../std/utility.hpp" +#define COORD_BITS 30 typedef double CoordT; typedef pair CoordPointT; typedef m2::CellId<19> RectId; -m2::PointU PointD2PointU(CoordT x, CoordT y); -CoordPointT PointU2PointD(m2::PointU const & p); +m2::PointU PointD2PointU(CoordT x, CoordT y, uint32_t coordBits = COORD_BITS); +CoordPointT PointU2PointD(m2::PointU const & p, uint32_t coordBits = COORD_BITS); -int64_t PointToInt64(CoordT x, CoordT y); -inline int64_t PointToInt64(CoordPointT const & pt) { return PointToInt64(pt.first, pt.second); } -CoordPointT Int64ToPoint(int64_t v); +int64_t PointToInt64(CoordT x, CoordT y, uint32_t coordBits = COORD_BITS); +inline int64_t PointToInt64(CoordPointT const & pt, uint32_t coordBits = COORD_BITS) +{ + return PointToInt64(pt.first, pt.second, coordBits); +} +CoordPointT Int64ToPoint(int64_t v, uint32_t coordBits = COORD_BITS); -pair RectToInt64(m2::RectD const & r); -m2::RectD Int64ToRect(pair const & p); +pair RectToInt64(m2::RectD const & r, uint32_t coordBits = COORD_BITS); +m2::RectD Int64ToRect(pair const & p, uint32_t coordBits = COORD_BITS);