diff --git a/components/terrain/compositemaprenderer.cpp b/components/terrain/compositemaprenderer.cpp index 34655a03d6..adf58162e8 100644 --- a/components/terrain/compositemaprenderer.cpp +++ b/components/terrain/compositemaprenderer.cpp @@ -43,12 +43,10 @@ namespace Terrain mImmediateCompileSet.erase(node); mMutex.unlock(); - compile(*node, renderInfo, nullptr); + compile(*node, renderInfo); mMutex.lock(); } - double timeLeft = availableTime; - const auto deadline = std::chrono::steady_clock::now() + std::chrono::duration(availableTime); while (!mCompileSet.empty() && std::chrono::steady_clock::now() < deadline) { @@ -56,7 +54,7 @@ namespace Terrain mCompileSet.erase(node); mMutex.unlock(); - compile(*node, renderInfo, &timeLeft); + compile(*node, renderInfo); mMutex.lock(); if (node->mCompiled < node->mDrawables.size()) @@ -69,7 +67,7 @@ namespace Terrain mTimer.setStartTick(); } - void CompositeMapRenderer::compile(CompositeMap& compositeMap, osg::RenderInfo& renderInfo, double* timeLeft) const + void CompositeMapRenderer::compile(CompositeMap& compositeMap, osg::RenderInfo& renderInfo) const { // if there are no more external references we can assume the texture is no longer required if (compositeMap.mTexture->referenceCount() <= 1) @@ -125,15 +123,6 @@ namespace Terrain ++compositeMap.mCompiled; compositeMap.mDrawables[i] = nullptr; - - if (timeLeft) - { - *timeLeft -= timer.time_s(); - timer.setStartTick(); - - if (*timeLeft <= 0) - break; - } } if (compositeMap.mCompiled == compositeMap.mDrawables.size()) compositeMap.mDrawables = std::vector>(); diff --git a/components/terrain/compositemaprenderer.hpp b/components/terrain/compositemaprenderer.hpp index eeecec75dc..1e33c717ec 100644 --- a/components/terrain/compositemaprenderer.hpp +++ b/components/terrain/compositemaprenderer.hpp @@ -38,7 +38,7 @@ namespace Terrain void drawImplementation(osg::RenderInfo& renderInfo) const override; - void compile(CompositeMap& compositeMap, osg::RenderInfo& renderInfo, double* timeLeft) const; + void compile(CompositeMap& compositeMap, osg::RenderInfo& renderInfo) const; /// Set the available time in seconds for compiling (non-immediate) composite maps each frame void setMinimumTimeAvailableForCompile(double time);