From 172cb747633467f0afe029b54a82e56b5e098423 Mon Sep 17 00:00:00 2001 From: bzzt Date: Wed, 20 Feb 2019 13:37:00 +0000 Subject: [PATCH] Delete composite map layers on demand --- components/terrain/compositemaprenderer.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/terrain/compositemaprenderer.cpp b/components/terrain/compositemaprenderer.cpp index 3dc0aa41c5..0ef6491977 100644 --- a/components/terrain/compositemaprenderer.cpp +++ b/components/terrain/compositemaprenderer.cpp @@ -122,6 +122,8 @@ void CompositeMapRenderer::compile(CompositeMap &compositeMap, osg::RenderInfo & ++compositeMap.mCompiled; + compositeMap.mDrawables[i] = nullptr; + if (timeLeft) { *timeLeft -= timer.time_s(); @@ -131,6 +133,8 @@ void CompositeMapRenderer::compile(CompositeMap &compositeMap, osg::RenderInfo & break; } } + if (compositeMap.mCompiled == compositeMap.mDrawables.size()) + compositeMap.mDrawables = std::vector>(); state.haveAppliedAttribute(osg::StateAttribute::VIEWPORT);