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