Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Cesium3DTilesSelection/src/Tileset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,16 +333,19 @@ const ViewUpdateResult& Tileset::updateViewGroupOffline(

// TODO: fix the fading for offline case
// (https://github.com/CesiumGS/cesium-native/issues/549)
this->_asyncSystem.dispatchMainThreadTasks();
this->updateViewGroup(viewGroup, frustums, 0.0f);
while (viewGroup.getPreviousLoadProgressPercentage() < 100.0f) {
this->_externals.pAssetAccessor->tick();
this->_asyncSystem.dispatchMainThreadTasks();
this->loadTiles();

// If there are no frustums, we'll never make any progress. So break here to
// avoid getting stuck in an endless loop.
if (frustums.empty())
break;

this->_asyncSystem.dispatchMainThreadTasks();
this->updateViewGroup(viewGroup, frustums, 0.0f);
}

Expand Down Expand Up @@ -371,9 +374,12 @@ const ViewUpdateResult& Tileset::updateViewGroupOffline(
}

const ViewUpdateResult&

Tileset::updateView(const std::vector<ViewState>& frustums, float deltaTime) {
this->_asyncSystem.dispatchMainThreadTasks();
const ViewUpdateResult& result =
this->updateViewGroup(this->_defaultViewGroup, frustums, deltaTime);
this->_asyncSystem.dispatchMainThreadTasks();
this->loadTiles();
return result;
}
Expand Down
8 changes: 8 additions & 0 deletions Cesium3DTilesSelection/test/TestTilesetSelectionAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,14 @@ TEST_CASE("Test replace refinement for render") {
}
}


SUBCASE(
"updateViewGroupOffline does its own dispatching of main thread tasks "
" so it doesn't get stuck") {
ViewState viewState = zoomToTileset(tileset);
tileset.updateViewGroupOffline(tileset.getDefaultViewGroup(), {viewState});
}

SUBCASE(
"updateViewGroupOffline does not get stuck in an endless loop when no "
"frustums are given") {
Expand Down
Loading