diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-13 14:45:22 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2016-06-14 11:25:45 -0700 |
commit | 6eab895bc0683881f793a3a751fa7470603ae9a0 (patch) | |
tree | 5e1b231702bb1c93e6a0c8823500a6e6980b0970 /platform/default | |
parent | 615a6685a47609310930890203f41815a5f19d48 (diff) | |
download | qtlocation-mapboxgl-6eab895bc0683881f793a3a751fa7470603ae9a0.tar.gz |
[core] Use Range<uint8_t> instead of full Tileset where possible
Diffstat (limited to 'platform/default')
-rw-r--r-- | platform/default/mbgl/storage/offline.cpp | 6 | ||||
-rw-r--r-- | platform/default/mbgl/storage/offline_download.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/platform/default/mbgl/storage/offline.cpp b/platform/default/mbgl/storage/offline.cpp index 812e427157..fd2d47819b 100644 --- a/platform/default/mbgl/storage/offline.cpp +++ b/platform/default/mbgl/storage/offline.cpp @@ -23,9 +23,9 @@ OfflineTilePyramidRegionDefinition::OfflineTilePyramidRegionDefinition( } } -std::vector<CanonicalTileID> OfflineTilePyramidRegionDefinition::tileCover(SourceType type, uint16_t tileSize, const Tileset& tileset) const { - double minZ = std::max<double>(util::coveringZoomLevel(minZoom, type, tileSize), tileset.minZoom); - double maxZ = std::min<double>(util::coveringZoomLevel(maxZoom, type, tileSize), tileset.maxZoom); +std::vector<CanonicalTileID> OfflineTilePyramidRegionDefinition::tileCover(SourceType type, uint16_t tileSize, const Range<uint8_t>& zoomRange) const { + double minZ = std::max<double>(util::coveringZoomLevel(minZoom, type, tileSize), zoomRange.min); + double maxZ = std::min<double>(util::coveringZoomLevel(maxZoom, type, tileSize), zoomRange.max); assert(minZ >= 0); assert(maxZ >= 0); diff --git a/platform/default/mbgl/storage/offline_download.cpp b/platform/default/mbgl/storage/offline_download.cpp index 11ca862925..820e1cd223 100644 --- a/platform/default/mbgl/storage/offline_download.cpp +++ b/platform/default/mbgl/storage/offline_download.cpp @@ -74,7 +74,7 @@ std::vector<Resource> OfflineDownload::glyphResources(const style::Parser& parse std::vector<Resource> OfflineDownload::tileResources(SourceType type, uint16_t tileSize, const Tileset& tileset) const { std::vector<Resource> result; - for (const auto& tile : definition.tileCover(type, tileSize, tileset)) { + for (const auto& tile : definition.tileCover(type, tileSize, tileset.zoomRange)) { result.push_back(Resource::tile(tileset.tiles[0], definition.pixelRatio, tile.x, tile.y, tile.z)); } |