MapGen: add large map, disable log profiler
This commit is contained in:
@@ -3,6 +3,8 @@ local mathAbs, mathRound, mathMin, mathMax, id, posToString
|
|||||||
|
|
||||||
local getInstance = Class.getInstance
|
local getInstance = Class.getInstance
|
||||||
|
|
||||||
|
local LOG_PROFILE = false
|
||||||
|
|
||||||
local function calculateAverage(t)
|
local function calculateAverage(t)
|
||||||
if #t == 0 then return 0 end -- Защита от деления на ноль
|
if #t == 0 then return 0 end -- Защита от деления на ноль
|
||||||
local sum = 0
|
local sum = 0
|
||||||
@@ -893,10 +895,12 @@ function MapGen:onMapGenerated(voxelManip, minPos, maxPos, blockseed)
|
|||||||
local minPosStr, maxPosStr = posToString(minPos), posToString(maxPos)
|
local minPosStr, maxPosStr = posToString(minPos), posToString(maxPos)
|
||||||
local getLayerTime, NoiseCalcTime, GenNodeTime = {}, {}, {}
|
local getLayerTime, NoiseCalcTime, GenNodeTime = {}, {}, {}
|
||||||
|
|
||||||
mglog('Chunk run:\n'..
|
if LOG_PROFILE then
|
||||||
'min_pos: %s\n'..
|
mglog('Chunk run:\n'..
|
||||||
'max_pos: %s\n',
|
'min_pos: %s\n'..
|
||||||
minPosStr, maxPosStr)
|
'max_pos: %s\n',
|
||||||
|
minPosStr, maxPosStr)
|
||||||
|
end
|
||||||
local startTime = core.get_us_time()
|
local startTime = core.get_us_time()
|
||||||
|
|
||||||
local eMin, eMax = voxelManip:get_emerged_area()
|
local eMin, eMax = voxelManip:get_emerged_area()
|
||||||
@@ -959,13 +963,19 @@ function MapGen:onMapGenerated(voxelManip, minPos, maxPos, blockseed)
|
|||||||
voxelManip:update_liquids()
|
voxelManip:update_liquids()
|
||||||
|
|
||||||
local endTime = core.get_us_time()
|
local endTime = core.get_us_time()
|
||||||
mglog('Chunk end:\n'..
|
if LOG_PROFILE then
|
||||||
'min_pos: %s\n'..
|
mglog('Chunk end:\n'..
|
||||||
'max_pos: %s\n'..
|
'min_pos: %s\n'..
|
||||||
'time (sec): %.3f\n'..
|
'max_pos: %s\n'..
|
||||||
'GenerateHandler time (us): %.3f %.3f %.3f\n'..
|
'time (sec): %.3f\n'..
|
||||||
'---------------',
|
'GenerateHandler time (us): %.3f %.3f %.3f\n'..
|
||||||
minPosStr, maxPosStr, (endTime - startTime)/1000000,calculateAverage(getLayerTime), calculateAverage(NoiseCalcTime), calculateAverage(GenNodeTime))
|
'---------------',
|
||||||
|
minPosStr, maxPosStr,
|
||||||
|
(endTime - startTime)/1000000,
|
||||||
|
calculateAverage(getLayerTime),
|
||||||
|
calculateAverage(NoiseCalcTime),
|
||||||
|
calculateAverage(GenNodeTime))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user