Add timer checkpoints
							parent
							
								
									3c38b5844a
								
							
						
					
					
						commit
						c1aa5b16d6
					
				
							
								
								
									
										14
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										14
									
								
								init.lua
								
								
								
								
							|  | @ -693,6 +693,8 @@ function internal.generate_caves(data, minp, maxp) | ||||||
|     -- Get cave bools |     -- Get cave bools | ||||||
|     local bools = internal.flat_from_cave_bools(bminp, bmaxp) |     local bools = internal.flat_from_cave_bools(bminp, bmaxp) | ||||||
| 
 | 
 | ||||||
|  |     timer.checkpoint("Calculate cave shape") | ||||||
|  | 
 | ||||||
|     -- Get node types |     -- Get node types | ||||||
|     local nts = internal.flat_from_node_types(bools, bminp, bmaxp) |     local nts = internal.flat_from_node_types(bools, bminp, bmaxp) | ||||||
| 
 | 
 | ||||||
|  | @ -704,6 +706,8 @@ function internal.generate_caves(data, minp, maxp) | ||||||
|         internal.humidity_noise_params(), bminp, bmaxp |         internal.humidity_noise_params(), bminp, bmaxp | ||||||
|     ) |     ) | ||||||
| 
 | 
 | ||||||
|  |     timer.checkpoint("Calculate block types & biomes") | ||||||
|  | 
 | ||||||
|     local air = minetest.get_content_id("air") |     local air = minetest.get_content_id("air") | ||||||
|     local schems = {} |     local schems = {} | ||||||
| 
 | 
 | ||||||
|  | @ -1176,10 +1180,15 @@ end | ||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||||||
| minetest.register_on_generated(function(minp, maxp, blockseed) | minetest.register_on_generated(function(minp, maxp, blockseed) | ||||||
|  |     timer.start() | ||||||
|  | 
 | ||||||
|     math.randomseed(blockseed) |     math.randomseed(blockseed) | ||||||
| 
 | 
 | ||||||
|     local vm = minetest.get_mapgen_object("voxelmanip") |     local vm = minetest.get_mapgen_object("voxelmanip") | ||||||
|     local flat, schems = internal.generate_caves(vm:get_data(), minp, maxp) |     local data = vm:get_data() | ||||||
|  | 
 | ||||||
|  |     local flat, schems = internal.generate_caves(data, minp, maxp) | ||||||
|  |     timer.checkpoint("Place caves") | ||||||
| 
 | 
 | ||||||
|     internal.place_simple_decorations(flat, schems) |     internal.place_simple_decorations(flat, schems) | ||||||
| 
 | 
 | ||||||
|  | @ -1187,6 +1196,9 @@ minetest.register_on_generated(function(minp, maxp, blockseed) | ||||||
|     vm:write_to_map() |     vm:write_to_map() | ||||||
| 
 | 
 | ||||||
|     internal.place_schematic_decorations(vm, schems) |     internal.place_schematic_decorations(vm, schems) | ||||||
|  |     timer.checkpoint("Place decorations") | ||||||
|  | 
 | ||||||
|  |     timer.stop() | ||||||
| end) | end) | ||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue