mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Made mesh update on node addition asynchronous on client, to reduce frametime spikes
This commit is contained in:
parent
212f34db82
commit
e56d166337
2 changed files with 13 additions and 3 deletions
|
@ -1800,14 +1800,15 @@ void Client::addNode(v3s16 p, MapNode n)
|
|||
catch(InvalidPositionException &e)
|
||||
{}
|
||||
|
||||
TimeTaker timer2("Client::addNode(): updateMeshes");
|
||||
//TimeTaker timer2("Client::addNode(): updateMeshes");
|
||||
|
||||
for(core::map<v3s16, MapBlock * >::Iterator
|
||||
i = modified_blocks.getIterator();
|
||||
i.atEnd() == false; i++)
|
||||
{
|
||||
v3s16 p = i.getNode()->getKey();
|
||||
m_env.getClientMap().updateMeshes(p, m_env.getDayNightRatio());
|
||||
//m_env.getClientMap().updateMeshes(p, m_env.getDayNightRatio());
|
||||
addUpdateMeshTaskWithEdge(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue