aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRealBadAngel <maciej.kasatkin@o2.pl>2014-11-07 21:52:43 +0100
committerRealBadAngel <maciej.kasatkin@o2.pl>2014-11-08 21:04:30 +0100
commitd0be27415eb9386b2367ab798268da6fbe8b7a68 (patch)
treed2c13ccf59f4ba92d13a86f7b8c7cb482da39fb5
parent05e7f71b330a2413e3a40658c6c7c79b5998a0db (diff)
downloadminetest-d0be27415eb9386b2367ab798268da6fbe8b7a68.tar.gz
minetest-d0be27415eb9386b2367ab798268da6fbe8b7a68.tar.bz2
minetest-d0be27415eb9386b2367ab798268da6fbe8b7a68.zip
Speed up removing a node (less block mesh updates).
-rw-r--r--src/client.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client.cpp b/src/client.cpp
index c6319d584..89bb053ae 100644
--- a/src/client.cpp
+++ b/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);
}
}