mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Revert "Resolve all '#[allow(clippy::excessive_precision)]' error supressions"
This reverts commit 0247ae2bf6
.
This commit is contained in:
parent
516ad1c772
commit
edad38098f
@ -1,17 +1,19 @@
|
||||
use vek::{Mat3, Rgb, Rgba, Vec3};
|
||||
|
||||
#[inline(always)]
|
||||
#[allow(clippy::excessive_precision)]
|
||||
pub fn srgb_to_linear(col: Rgb<f32>) -> Rgb<f32> {
|
||||
col.map(|c| {
|
||||
if c <= 0.104 {
|
||||
c * 0.08677088
|
||||
} else {
|
||||
0.012522878 * c + 0.682_171_1 * c * c + 0.305_306_02 * c * c * c
|
||||
0.012522878 * c + 0.682171111 * c * c + 0.305306011 * c * c * c
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[allow(clippy::excessive_precision)]
|
||||
pub fn linear_to_srgb(col: Rgb<f32>) -> Rgb<f32> {
|
||||
col.map(|c| {
|
||||
if c <= 0.0060 {
|
||||
@ -20,7 +22,7 @@ pub fn linear_to_srgb(col: Rgb<f32>) -> Rgb<f32> {
|
||||
let s1 = c.sqrt();
|
||||
let s2 = s1.sqrt();
|
||||
let s3 = s2.sqrt();
|
||||
0.585_122_4 * s1 + 0.783_140_36 * s2 - 0.368_262_74 * s3
|
||||
0.585122381 * s1 + 0.783140355 * s2 - 0.368262736 * s3
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -13,8 +13,9 @@ impl FastNoise {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::excessive_precision)] // TODO: Pending review in #587
|
||||
fn noise_at(&self, pos: Vec3<i32>) -> f32 {
|
||||
(self.noise.get(pos) & 4095) as f32 * 0.000_244_140_63
|
||||
(self.noise.get(pos) & 4095) as f32 * 0.000244140625
|
||||
}
|
||||
}
|
||||
|
||||
@ -86,8 +87,9 @@ impl FastNoise2d {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(clippy::excessive_precision)] // TODO: Pending review in #587
|
||||
fn noise_at(&self, pos: Vec2<i32>) -> f32 {
|
||||
(self.noise.get(Vec3::new(pos.x, pos.y, 0)) & 4095) as f32 * 0.000_244_140_63
|
||||
(self.noise.get(Vec3::new(pos.x, pos.y, 0)) & 4095) as f32 * 0.000244140625
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user