diff options
author | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-12-10 18:48:58 +0300 |
---|---|---|
committer | r.kuznetsov <r.kuznetsov@corp.mail.ru> | 2015-12-10 18:48:58 +0300 |
commit | a8ea9f0875b4a9b11190e59730665a6f2ccfced2 (patch) | |
tree | 8081c612e281b3787702b2348d4b7db0e5b9cfa4 /drape_frontend/tile_key.cpp | |
parent | 1c21b325335a78c15575d3d8501216a3fdeba89e (diff) |
Fixed memory consumption on zooming
Diffstat (limited to 'drape_frontend/tile_key.cpp')
-rwxr-xr-x | drape_frontend/tile_key.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drape_frontend/tile_key.cpp b/drape_frontend/tile_key.cpp index 6af420cc37..16a22c5958 100755 --- a/drape_frontend/tile_key.cpp +++ b/drape_frontend/tile_key.cpp @@ -6,19 +6,24 @@ namespace df { TileKey::TileKey() - : m_x(-1), m_y(-1), m_zoomLevel(-1) -{ -} + : m_x(-1), m_y(-1), m_zoomLevel(-1), m_generation(0) +{} TileKey::TileKey(int x, int y, int zoomLevel) - : m_x(x), m_y(y), m_zoomLevel(zoomLevel) -{ -} + : m_x(x), m_y(y), m_zoomLevel(zoomLevel), m_generation(0) +{} + +TileKey::TileKey(TileKey const & key, uint64_t generation) + : m_x(key.m_x), m_y(key.m_y), + m_zoomLevel(key.m_zoomLevel), + m_generation(generation) +{} bool TileKey::operator <(TileKey const & other) const { if (m_zoomLevel != other.m_zoomLevel) return m_zoomLevel < other.m_zoomLevel; + if (m_y != other.m_y) return m_y < other.m_y; @@ -47,7 +52,8 @@ m2::RectD TileKey::GetGlobalRect() const string DebugPrint(TileKey const & key) { ostringstream out; - out << "[x = " << key.m_x << ", y = " << key.m_y << ", zoomLevel = " << key.m_zoomLevel << "]"; + out << "[x = " << key.m_x << ", y = " << key.m_y << ", zoomLevel = " + << key.m_zoomLevel << ", gen = " << key.m_generation << "]"; return out.str(); } |