Skip to content
Permalink
Browse files

Speed up removing a node (less block mesh updates).

  • Loading branch information
RealBadAngel committed Nov 8, 2014
1 parent 05e7f71 commit d0be27415eb9386b2367ab798268da6fbe8b7a68
Showing with 5 additions and 6 deletions.
  1. +5 −6 src/client.cpp
@@ -2300,20 +2300,19 @@ void Client::removeNode(v3s16 p)
{
}

// add urgent task to update the modified node
addUpdateMeshTaskForNode(p, false, true);

for(std::map<v3s16, MapBlock * >::iterator
i = modified_blocks.begin();
i != modified_blocks.end(); ++i)
{
addUpdateMeshTaskWithEdge(i->first);
addUpdateMeshTask(i->first, false, false);
}
// add urgent task to update the modified node
addUpdateMeshTaskForNode(p, false, true);
}

void Client::addNode(v3s16 p, MapNode n, bool remove_metadata)
{
TimeTaker timer1("Client::addNode()");
//TimeTaker timer1("Client::addNode()");

std::map<v3s16, MapBlock*> modified_blocks;

@@ -2329,7 +2328,7 @@ void Client::addNode(v3s16 p, MapNode n, bool remove_metadata)
i = modified_blocks.begin();
i != modified_blocks.end(); ++i)
{
addUpdateMeshTaskWithEdge(i->first);
addUpdateMeshTask(i->first, false, false);
}
}

0 comments on commit d0be274

Please sign in to comment.
You can’t perform that action at this time.