]> git.lizzy.rs Git - minetest.git/commitdiff
Made mesh update on node addition asynchronous on client, to reduce frametime spikes
authorPerttu Ahola <celeron55@gmail.com>
Wed, 6 Apr 2011 07:28:39 +0000 (10:28 +0300)
committerPerttu Ahola <celeron55@gmail.com>
Wed, 6 Apr 2011 07:28:39 +0000 (10:28 +0300)
src/client.cpp
src/main.cpp

index ae0e027c2dea52acd81b26bc02de76f86a752fee..82e90704a67a365796342599a2ce7af585f21d90 100644 (file)
@@ -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);
        }
 }
        
index b5247b90732c781a31a7e9ac11bbb98659326fac..521a80e4f703490f533449a9926bff8cbd8d9e5b 100644 (file)
@@ -116,6 +116,11 @@ Gaming ideas:
 Game content:\r
 -------------\r
 - Glass blocks\r
+- WHen furnace is destroyed, move items to player's inventory\r
+- Growing grass, decaying leaves\r
+  - This can be done in the active blocks I guess.\r
+  - Lots of stuff can be done in the active blocks.\r
+  - Uh, is there an active block list somewhere?\r
 \r
 Documentation:\r
 --------------\r
@@ -162,7 +167,7 @@ TODO: Make fetching sector's blocks more efficient when rendering
 \r
 TODO: Flowing water animation\r
 \r
-* Combine meshes to bigger ones in ClientMap and set them EHM_STATIC\r
+SUGG: Combine meshes to bigger ones in ClientMap and set them EHM_STATIC\r
 \r
 SUGG: Draw cubes in inventory directly with 3D drawing commands, so that\r
       animating them is easier.\r
@@ -190,6 +195,10 @@ SUGG: Add a "description" field to InventoryList and show it in
       GUIInventoryMenu\r
          - If separate menus are made for everything, this is not needed\r
 \r
+TODO: See what is the main slowdown when a node is added or removed\r
+      and make it asynchronous at least for other players\r
+         - It probably is updateMeshes. How 'bout making it asynchronous?\r
+\r
 Server:\r
 -------\r
 \r