mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-03-10 15:28:36 -05:00
Fix for crash when changing number of layers in GlobeBrowsing
This commit is contained in:
@@ -923,21 +923,6 @@ void RenderableGlobe::update(const UpdateData& data) {
|
||||
_shadowComponent.update(data);
|
||||
}
|
||||
|
||||
_layerManager.update();
|
||||
|
||||
if (_nLayersIsDirty) {
|
||||
std::array<LayerGroup*, LayerManager::NumLayerGroups> lgs =
|
||||
_layerManager.layerGroups();
|
||||
_generalProperties.nActiveLayers = std::accumulate(
|
||||
lgs.begin(),
|
||||
lgs.end(),
|
||||
0,
|
||||
[](int lhs, LayerGroup* lg) {
|
||||
return lhs + static_cast<int>(lg->activeLayers().size());
|
||||
}
|
||||
);
|
||||
_nLayersIsDirty = false;
|
||||
}
|
||||
}
|
||||
|
||||
bool RenderableGlobe::renderedWithDesiredData() const {
|
||||
@@ -970,6 +955,22 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&,
|
||||
{
|
||||
ZoneScoped
|
||||
|
||||
_layerManager.update();
|
||||
|
||||
if (_nLayersIsDirty) {
|
||||
std::array<LayerGroup*, LayerManager::NumLayerGroups> lgs =
|
||||
_layerManager.layerGroups();
|
||||
_generalProperties.nActiveLayers = std::accumulate(
|
||||
lgs.begin(),
|
||||
lgs.end(),
|
||||
0,
|
||||
[](int lhs, LayerGroup* lg) {
|
||||
return lhs + static_cast<int>(lg->activeLayers().size());
|
||||
}
|
||||
);
|
||||
_nLayersIsDirty = false;
|
||||
}
|
||||
|
||||
if (_shadersNeedRecompilation) {
|
||||
recompileShaders();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user