osu & fruits: linear sliders with != 2 points are now bezier

This commit is contained in:
MaxOhn
2021-01-28 19:03:22 +01:00
parent d929fbcfac
commit 0e9cadffb9
4 changed files with 12 additions and 5 deletions
+3 -1
View File
@@ -87,7 +87,9 @@ pub fn stars(map: &Beatmap, mods: impl Mods, passed_objects: Option<usize>) -> S
/ 100.0;
// Ensure path type validity
let path_type = if *path_type == PathType::PerfectCurve && curve_points.len() > 3 {
let path_type = if (*path_type == PathType::PerfectCurve && curve_points.len() > 3)
|| (*path_type == PathType::Linear && curve_points.len() != 2)
{
PathType::Bezier
} else if curve_points.len() == 2 {
PathType::Linear
+3 -2
View File
@@ -447,9 +447,10 @@ mod tests {
use std::fs::File;
#[test]
// #[ignore]
#[ignore]
fn all_included_single() {
let file = match File::open("./maps/100.osu") {
// TOCHECK: 114708, 1208872
let file = match File::open("./maps/1295309.osu") {
Ok(file) => file,
Err(why) => panic!("Could not open file: {}", why),
};
+3 -1
View File
@@ -76,7 +76,9 @@ impl OsuObject {
let span_duration = duration / *repeats as f32;
// Ensure path type validity
let path_type = if *path_type == PathType::PerfectCurve && curve_points.len() > 3 {
let path_type = if (*path_type == PathType::PerfectCurve && curve_points.len() > 3)
|| (*path_type == PathType::Linear && curve_points.len() != 2)
{
PathType::Bezier
} else if curve_points.len() == 2 {
PathType::Linear
+3 -1
View File
@@ -63,7 +63,9 @@ impl OsuObject {
let span_duration = duration / *repeats as f32;
// Ensure path type validity
let path_type = if *path_type == PathType::PerfectCurve && curve_points.len() > 3 {
let path_type = if (*path_type == PathType::PerfectCurve && curve_points.len() > 3)
|| (*path_type == PathType::Linear && curve_points.len() != 2)
{
PathType::Bezier
} else if curve_points.len() == 2 {
PathType::Linear