Skip to content

Commit

Permalink
change allow dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
kralverde committed Sep 14, 2024
1 parent 642e3ee commit 56b5d85
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion pumpkin-world/src/world_gen/noise/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(dead_code)]
mod perlin;
mod simplex;

Expand All @@ -13,7 +14,6 @@ pub fn lerp2(delta_x: f64, delta_y: f64, x0y0: f64, x1y0: f64, x0y1: f64, x1y1:
)
}

#[allow(dead_code)]
#[allow(clippy::too_many_arguments)]
pub fn lerp3(
delta_x: f64,
Expand Down
6 changes: 0 additions & 6 deletions pumpkin-world/src/world_gen/noise/perlin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ impl PerlinNoiseSampler {
}
}

#[allow(dead_code)]
pub fn sample_flat_y(&self, x: f64, y: f64, z: f64) -> f64 {
self.sample_no_fade(x, y, z, 0f64, 0f64)
}
Expand Down Expand Up @@ -154,7 +153,6 @@ impl PerlinNoiseSampler {
pub struct OctavePerlinNoiseSampler {
octave_samplers: Vec<Option<PerlinNoiseSampler>>,
amplitudes: Vec<f64>,
#[allow(dead_code)]
first_octave: i32,
persistence: f64,
lacunarity: f64,
Expand All @@ -178,7 +176,6 @@ impl OctavePerlinNoiseSampler {
value - (value / 3.3554432E7f64 + 0.5f64).floor() * 3.3554432E7f64
}

#[allow(dead_code)]
pub fn calculate_amplitudes(octaves: &[i32]) -> (i32, Vec<f64>) {
let mut octaves = Vec::from_iter(octaves);
octaves.sort();
Expand Down Expand Up @@ -293,7 +290,6 @@ pub struct DoublePerlinNoiseSampler {
first_sampler: OctavePerlinNoiseSampler,
second_sampler: OctavePerlinNoiseSampler,
amplitude: f64,
#[allow(dead_code)]
max_value: f64,
}

Expand All @@ -302,7 +298,6 @@ impl DoublePerlinNoiseSampler {
0.1f64 * (1f64 + 1f64 / (octaves + 1) as f64)
}

#[allow(dead_code)]
pub fn new(rand: &mut RandomGenerator, first_octave: i32, amplitudes: &[f64]) -> Self {
let first_sampler = OctavePerlinNoiseSampler::new(rand, first_octave, amplitudes);
let second_sampler = OctavePerlinNoiseSampler::new(rand, first_octave, amplitudes);
Expand All @@ -328,7 +323,6 @@ impl DoublePerlinNoiseSampler {
}
}

#[allow(dead_code)]
pub fn sample(&self, x: f64, y: f64, z: f64) -> f64 {
let d = x * 1.0181268882175227f64;
let e = y * 1.0181268882175227f64;
Expand Down
3 changes: 0 additions & 3 deletions pumpkin-world/src/world_gen/noise/simplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ impl SimplexNoiseSampler {
const SKEW_FACTOR_2D: f64 = 0.5f64 * (Self::SQRT_3 - 1f64);
const UNSKEW_FACTOR_2D: f64 = (3f64 - Self::SQRT_3) / 6f64;

#[allow(dead_code)]
pub fn new(random: &mut impl RandomImpl) -> Self {
let x_origin = random.next_f64() * 256f64;
let y_origin = random.next_f64() * 256f64;
Expand Down Expand Up @@ -178,7 +177,6 @@ pub struct OctaveSimplexNoiseSampler {
}

impl OctaveSimplexNoiseSampler {
#[allow(dead_code)]
pub fn new(random: &mut impl RandomImpl, octaves: &[i32]) -> Self {
let mut octaves = Vec::from_iter(octaves);
octaves.sort();
Expand Down Expand Up @@ -229,7 +227,6 @@ impl OctaveSimplexNoiseSampler {
}
}

#[allow(dead_code)]
pub fn sample(&self, x: f64, y: f64, use_origin: bool) -> f64 {
let mut d = 0f64;
let mut e = self.lacunarity;
Expand Down

0 comments on commit 56b5d85

Please sign in to comment.