fix: refactor get_precision_adjusted_beat_len

This commit is contained in:
MaxOhn
2024-10-11 16:58:48 +02:00
parent 315d4b3c9e
commit 14c646d9e1
5 changed files with 20 additions and 43 deletions
+1 -12
View File
@@ -11,6 +11,7 @@ use crate::{
control_point::{DifficultyPoint, TimingPoint},
hit_object::Slider,
},
util::get_precision_adjusted_beat_len,
};
pub struct JuiceStream<'a> {
@@ -159,15 +160,3 @@ pub struct JuiceStreamBufs {
pub curve: CurveBuffers,
pub ticks: Vec<SliderEvent>,
}
fn get_precision_adjusted_beat_len(slider_velocity_multiplier: f64, beat_len: f64) -> f64 {
let slider_velocity_as_beat_len = -100.0 / slider_velocity_multiplier;
let bpm_multiplier = if slider_velocity_as_beat_len < 0.0 {
f64::from(((-slider_velocity_as_beat_len) as f32).clamp(10.0, 10_000.0)) / 100.0
} else {
1.0
};
beat_len * bpm_multiplier
}