Speed up removing a node (less block mesh updates).
authorRealBadAngel <maciej.kasatkin@o2.pl>
Fri, 7 Nov 2014 20:52:43 +0000 (21:52 +0100)
committerRealBadAngel <maciej.kasatkin@o2.pl>
Sat, 8 Nov 2014 20:04:30 +0000 (21:04 +0100)
src/client.cpp

index c6319d5846e8ca1eb536620b87641d9c6eefa280..89bb053aeac4ef9ce483e2a5817620918d124a0c 100644 (file)
@@ -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);
        }
 }