From 86002b4e7045c8510b5bfce131137f30c3c4de74 Mon Sep 17 00:00:00 2001 From: "BlueRock (on discord)" <45720633+BlueRock2@users.noreply.github.com> Date: Fri, 7 Aug 2020 21:23:30 -0400 Subject: [PATCH] Remove test code --- map_gen/shared/noise_tools.lua | 38 ---------------------------------- 1 file changed, 38 deletions(-) delete mode 100644 map_gen/shared/noise_tools.lua diff --git a/map_gen/shared/noise_tools.lua b/map_gen/shared/noise_tools.lua deleted file mode 100644 index 3528eee3..00000000 --- a/map_gen/shared/noise_tools.lua +++ /dev/null @@ -1,38 +0,0 @@ - --- Noise tools that were originally developed for diggy, but I have moved to shared folder to make them available to other mods - -local Perlin = require 'map_gen.shared.perlin_noise' -local Simplex = require 'map_gen.shared.simplex_noise' - -local Noise_tools = {} - --- source of noise for resource generation --- index determines offset --- '-1' is reserved for cluster mode --- compound clusters use as many indexes as needed > 1 -local base_seed -function Noise_tools.seeded_noise(surface, x, y, index, sources) - base_seed = base_seed or surface.map_gen_settings.seed + surface.index + 4000 - local noise = 0 - for _, settings in pairs(sources) do - settings.type = settings.type or 'perlin' - settings.offset = settings.offset or 0 - if settings.type == 'zero' then - noise = noise + 0 - elseif settings.type == 'one' then - noise = noise + settings.weight * 1 - elseif settings.type == 'perlin' then - noise = noise + settings.weight * Perlin.noise(x/settings.variance, y/settings.variance, - base_seed + 2000*index + settings.offset) - elseif settings.type == 'simplex' then - noise = noise + settings.weight * Simplex.d2(x/settings.variance, y/settings.variance, - base_seed + 2000*index + settings.offset) - else - Debug.print('noise type \'' .. settings.type .. '\' not recognized') - end - - end - return noise -end - -return Noise_tools