From 87e1a623dda615edcee06f21edcea3025fc95162 Mon Sep 17 00:00:00 2001 From: Erik Broberg Date: Thu, 2 Jun 2016 12:29:09 -0400 Subject: [PATCH] Fix tile selection when chunk level > max dataset level --- modules/globebrowsing/other/tileprovider.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/globebrowsing/other/tileprovider.cpp b/modules/globebrowsing/other/tileprovider.cpp index 237e689a88..b7a77cc9d9 100644 --- a/modules/globebrowsing/other/tileprovider.cpp +++ b/modules/globebrowsing/other/tileprovider.cpp @@ -82,14 +82,13 @@ namespace openspace { Tile TileProvider::getHighestResolutionTile(ChunkIndex chunkIndex, int parents, TileUvTransform uvTransform) { - int maximumLevel = _asyncTextureDataProvider->getTextureDataProvider()->getMaximumLevel(); - - while(chunkIndex.level > maximumLevel){ + for (int i = 0; i < parents && chunkIndex.level > 1; i++) { transformFromParent(chunkIndex, uvTransform); chunkIndex = chunkIndex.parent(); } - for (int i = 0; i < parents && chunkIndex.level > 1; i++) { + int maximumLevel = _asyncTextureDataProvider->getTextureDataProvider()->getMaximumLevel(); + while(chunkIndex.level > maximumLevel){ transformFromParent(chunkIndex, uvTransform); chunkIndex = chunkIndex.parent(); }