reverted Tiler::tiles changes which introduced errors.

This commit is contained in:
rachytski 2012-10-25 17:43:19 +03:00 committed by Alex Zolotarev
parent b2ebc4e1fd
commit 7d5a4bb23e
4 changed files with 9 additions and 23 deletions

View file

@ -248,13 +248,7 @@ void ScreenCoverage::SetScreen(ScreenBase const & screen)
vector<Tiler::RectInfo> newRects;
TTileSet tiles;
#ifdef OMIM_OS_IPHONE
int cacheDepthes[] = {0, 1};
#else
int cacheDepthes[] = {0, 1, 2};
#endif
m_tiler.tiles(allRects, cacheDepthes, ARRAY_SIZE(cacheDepthes));
m_tiler.tiles(allRects, GetPlatform().PreCachingDepth());
TileCache * tileCache = &m_tileRenderer->GetTileCache();
@ -348,11 +342,7 @@ void ScreenCoverage::SetScreen(ScreenBase const & screen)
// if (m_tiler.isLeaf(nr) || (childTilesToDraw > 1))
#ifdef OMIM_OS_IPHONE
int step = 1;
#else
int step = 2;
#endif
int const step = GetPlatform().PreCachingDepth() - 1;
if ((nr.m_tileScale == m_tiler.tileScale() - step)
|| (nr.m_tileScale == m_tiler.tileScale() ))

View file

@ -89,7 +89,7 @@ void Tiler::seed(ScreenBase const & screen, m2::PointD const & centerPt, size_t
m_tileScale = getTileScale(screen, tileSize);
}
void Tiler::tiles(vector<RectInfo> & tiles, int const * depthes, unsigned count)
void Tiler::tiles(vector<RectInfo> & tiles, int depth)
{
if (m_tileScale == 0)
return;
@ -97,16 +97,12 @@ void Tiler::tiles(vector<RectInfo> & tiles, int const * depthes, unsigned count)
/// clearing previous coverage
tiles.clear();
int maxDepth = depthes[count - 1];
if (m_tileScale - depth < 0)
depth = m_tileScale;
for (int j = count - 1; j >= 0; --j)
for (unsigned i = 0; i < depth; ++i)
{
int curDepth = depthes[j];
if (m_tileScale - curDepth < 0)
curDepth = m_tileScale;
int pow = maxDepth - curDepth;
int pow = depth - 1 - i;
int scale = 1 << pow;

View file

@ -40,7 +40,7 @@ public:
/// seed tiler with new screenBase.
void seed(ScreenBase const & screenBase, m2::PointD const & centerPt, size_t tileSize);
void tiles(vector<RectInfo> & tiles, int const * depthes, unsigned count);
void tiles(vector<RectInfo> & tiles, int depth);
bool isLeaf(RectInfo const & ri) const;
int tileScale() const;

View file

@ -127,7 +127,7 @@ int Platform::VideoMemoryLimit() const
int Platform::PreCachingDepth() const
{
return 3;
return 2;
}
string Platform::DeviceName() const