From a289391cec77c69f4894ecc07c5d1a619171e5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Tue, 4 May 2021 21:01:42 +0200 Subject: [PATCH] cleanup some unused functions, which were exported but never used --- world/src/sim/erosion.rs | 4 +++- world/src/sim/mod.rs | 19 +++++++++++-------- world/src/sim/util.rs | 2 ++ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/world/src/sim/erosion.rs b/world/src/sim/erosion.rs index cb21284f1e..679f9c9749 100644 --- a/world/src/sim/erosion.rs +++ b/world/src/sim/erosion.rs @@ -28,6 +28,7 @@ pub type Alt = f64; pub type Compute = f64; pub type Computex8 = [Compute; 8]; +/* code used by sharp in future /// Compute the water flux at all chunks, given a list of chunk indices sorted /// by increasing height. pub fn get_drainage( @@ -56,6 +57,7 @@ pub fn get_drainage( }); flux } +*/ /// Compute the water flux at all chunks for multiple receivers, given a list of /// chunk indices sorted by increasing height and weights for each receiver. @@ -1723,7 +1725,7 @@ fn erode( /// http://horizon.documentation.ird.fr/exl-doc/pleins_textes/pleins_textes_7/sous_copyright/010031925.pdf /// /// See https://github.com/mewo2/terrain/blob/master/terrain.js -pub fn fill_sinks( +pub(crate) fn fill_sinks( map_size_lg: MapSizeLg, h: impl Fn(usize) -> F + Sync, is_ocean: impl Fn(usize) -> bool + Sync, diff --git a/world/src/sim/mod.rs b/world/src/sim/mod.rs index d7e429e3d5..026eea738f 100644 --- a/world/src/sim/mod.rs +++ b/world/src/sim/mod.rs @@ -9,18 +9,21 @@ mod way; use self::erosion::Compute; pub use self::{ diffusion::diffusion, - erosion::{ - do_erosion, fill_sinks, get_drainage, get_lakes, get_multi_drainage, get_multi_rec, - get_rivers, mrec_downhill, Alt, RiverData, RiverKind, - }, location::Location, map::{sample_pos, sample_wpos}, - util::{ - cdf_irwin_hall, downhill, get_horizon_map, get_oceans, local_cells, map_edge_factor, - uniform_noise, uphill, InverseCdf, ScaleBias, - }, + util::get_horizon_map, way::{Cave, Path, Way}, }; +pub(crate) use self::{ + erosion::{ + do_erosion, fill_sinks, get_lakes, get_multi_drainage, get_multi_rec, get_rivers, Alt, + RiverData, RiverKind, + }, + util::{ + cdf_irwin_hall, downhill, get_oceans, local_cells, map_edge_factor, uniform_noise, uphill, + InverseCdf, + }, +}; use crate::{ all::{Environment, ForestKind, TreeAttr}, diff --git a/world/src/sim/util.rs b/world/src/sim/util.rs index c54c75a501..621ea6bfe5 100644 --- a/world/src/sim/util.rs +++ b/world/src/sim/util.rs @@ -771,6 +771,7 @@ impl NoiseFn<[f64; 4]> for HybridMulti { } } +/* code used by sharp in future /// Noise function that applies a scaling factor and a bias to the output value /// from the source function. /// @@ -810,3 +811,4 @@ impl<'a, F: NoiseFn + 'a, T> NoiseFn for ScaleBias<'a, F> { #[cfg(target_os = "emscripten")] fn get(&self, point: T) -> f64 { (self.source.get(point) * self.scale) + self.bias } } + */