fixes for osu_fast feature
This commit is contained in:
@@ -59,7 +59,8 @@ pub enum HitObjectKind {
|
||||
#[cfg(not(feature = "sliders"))]
|
||||
Slider {
|
||||
pixel_len: f32,
|
||||
repeats: usize,
|
||||
span_count: usize,
|
||||
last_control_point: Pos2,
|
||||
},
|
||||
Spinner {
|
||||
end_time: f32,
|
||||
|
||||
+23
-3
@@ -533,10 +533,30 @@ macro_rules! parse_hitobjects_body {
|
||||
|
||||
#[cfg(not(feature = "sliders"))]
|
||||
{
|
||||
let repeats = split.nth(1).next_field("repeats")?.parse()?;
|
||||
let pixel_len = split.next().next_field("pixel len")?.parse()?;
|
||||
let last_control_point = split
|
||||
.next()
|
||||
.next_field("control points")?
|
||||
.split('|')
|
||||
.next_back();
|
||||
|
||||
HitObjectKind::Slider { repeats, pixel_len }
|
||||
match last_control_point.map(|v| v.split(':').map(str::parse)) {
|
||||
Some(mut coords) => {
|
||||
let last_control_point = match (coords.next(), coords.next()) {
|
||||
(Some(Ok(x)), Some(Ok(y))) => Pos2 { x, y },
|
||||
_ => return Err(ParseError::InvalidCurvePoints),
|
||||
};
|
||||
|
||||
let span_count = split.next().next_field("repeats")?.parse()?;
|
||||
let pixel_len = split.next().next_field("pixel len")?.parse()?;
|
||||
|
||||
HitObjectKind::Slider {
|
||||
span_count,
|
||||
pixel_len,
|
||||
last_control_point,
|
||||
}
|
||||
}
|
||||
None => HitObjectKind::Circle,
|
||||
}
|
||||
}
|
||||
} else if kind & Self::SPINNER_FLAG > 0 {
|
||||
$self.n_spinners += 1;
|
||||
|
||||
Reference in New Issue
Block a user