mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-03-29 16:06:44 +00:00
Do not allow different threads to compile the same composite map
This commit is contained in:
parent
cad45e96ac
commit
0e1f5f68b6
1 changed files with 5 additions and 2 deletions
|
@ -70,14 +70,17 @@ void CompositeMapRenderer::drawImplementation(osg::RenderInfo &renderInfo) const
|
||||||
while (!mCompileSet.empty() && timeLeft > 0)
|
while (!mCompileSet.empty() && timeLeft > 0)
|
||||||
{
|
{
|
||||||
osg::ref_ptr<CompositeMap> node = *mCompileSet.begin();
|
osg::ref_ptr<CompositeMap> node = *mCompileSet.begin();
|
||||||
|
mCompileSet.erase(node);
|
||||||
|
|
||||||
mMutex.unlock();
|
mMutex.unlock();
|
||||||
compile(*node, renderInfo, &timeLeft);
|
compile(*node, renderInfo, &timeLeft);
|
||||||
mMutex.lock();
|
mMutex.lock();
|
||||||
|
|
||||||
if (node->mCompiled >= node->mDrawables.size())
|
if (node->mCompiled < node->mDrawables.size())
|
||||||
{
|
{
|
||||||
mCompileSet.erase(node);
|
// We did not compile the map fully.
|
||||||
|
// Place it back to queue to continue work in the next time.
|
||||||
|
mCompileSet.insert(node);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mTimer.setStartTick();
|
mTimer.setStartTick();
|
||||||
|
|
Loading…
Reference in a new issue