simplified feature cfg's
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#![cfg(any(feature = "osu", feature = "fruits"))]
|
#![cfg(feature = "sliders")]
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
parse::{DifficultyPoint, TimingPoint},
|
parse::{DifficultyPoint, TimingPoint},
|
||||||
@@ -42,7 +42,7 @@ pub(crate) enum ControlPoint {
|
|||||||
Difficulty { time: f64, slider_velocity: f64 },
|
Difficulty { time: f64, slider_velocity: f64 },
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
impl ControlPoint {
|
impl ControlPoint {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub(crate) fn time(&self) -> f64 {
|
pub(crate) fn time(&self) -> f64 {
|
||||||
|
|||||||
+2
-2
@@ -126,10 +126,10 @@ pub use pp::{AnyPP, AttributeProvider};
|
|||||||
mod curve;
|
mod curve;
|
||||||
mod mods;
|
mod mods;
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
pub(crate) mod control_point_iter;
|
pub(crate) mod control_point_iter;
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
pub(crate) use control_point_iter::{ControlPoint, ControlPointIter};
|
pub(crate) use control_point_iter::{ControlPoint, ControlPointIter};
|
||||||
|
|
||||||
#[cfg(feature = "fruits")]
|
#[cfg(feature = "fruits")]
|
||||||
|
|||||||
+12
-11
@@ -408,12 +408,12 @@ macro_rules! parse_timingpoints {
|
|||||||
buf: &mut String,
|
buf: &mut String,
|
||||||
section: &mut Section,
|
section: &mut Section,
|
||||||
) -> ParseResult<bool> {
|
) -> ParseResult<bool> {
|
||||||
#[cfg(not(any(feature = "osu", feature = "fruits")))]
|
#[cfg(not(feature = "sliders"))]
|
||||||
{
|
{
|
||||||
parse_timingpoints_body!(short => self, reader, buf, section)
|
parse_timingpoints_body!(short => self, reader, buf, section)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
parse_timingpoints_body!(self, reader, buf, section)
|
parse_timingpoints_body!(self, reader, buf, section)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -425,12 +425,12 @@ macro_rules! parse_timingpoints {
|
|||||||
buf: &mut String,
|
buf: &mut String,
|
||||||
section: &mut Section,
|
section: &mut Section,
|
||||||
) -> ParseResult<bool> {
|
) -> ParseResult<bool> {
|
||||||
#[cfg(not(any(feature = "osu", feature = "fruits")))]
|
#[cfg(not(feature = "sliders"))]
|
||||||
{
|
{
|
||||||
parse_timingpoints_body!(short => self, reader, buf, section)
|
parse_timingpoints_body!(short => self, reader, buf, section)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
parse_timingpoints_body!(self, reader, buf, section)
|
parse_timingpoints_body!(self, reader, buf, section)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -814,14 +814,15 @@ pub struct Beatmap {
|
|||||||
/// All hitobjects of the beatmap.
|
/// All hitobjects of the beatmap.
|
||||||
pub hit_objects: Vec<HitObject>,
|
pub hit_objects: Vec<HitObject>,
|
||||||
|
|
||||||
#[cfg(not(any(feature = "osu", feature = "fruits")))]
|
#[cfg(not(feature = "sliders"))]
|
||||||
bpm: f64,
|
/// Beats per minute
|
||||||
|
pub bpm: f64,
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
/// Timing points that indicate a new timing section.
|
/// Timing points that indicate a new timing section.
|
||||||
pub timing_points: Vec<TimingPoint>,
|
pub timing_points: Vec<TimingPoint>,
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
/// Timing point for the current timing section.
|
/// Timing point for the current timing section.
|
||||||
pub difficulty_points: Vec<DifficultyPoint>,
|
pub difficulty_points: Vec<DifficultyPoint>,
|
||||||
|
|
||||||
@@ -848,7 +849,7 @@ impl Beatmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The beats per minute of the map.
|
/// The beats per minute of the map.
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn bpm(&self) -> f64 {
|
pub fn bpm(&self) -> f64 {
|
||||||
match self.timing_points.first() {
|
match self.timing_points.first() {
|
||||||
@@ -858,7 +859,7 @@ impl Beatmap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The beats per minute of the map.
|
/// The beats per minute of the map.
|
||||||
#[cfg(not(any(feature = "osu", feature = "fruits")))]
|
#[cfg(not(feature = "sliders"))]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn bpm(&self) -> f64 {
|
pub fn bpm(&self) -> f64 {
|
||||||
self.bpm
|
self.bpm
|
||||||
@@ -1184,7 +1185,7 @@ mod tests {
|
|||||||
println!("tick_rate: {}", map.tick_rate);
|
println!("tick_rate: {}", map.tick_rate);
|
||||||
println!("hit_objects: {}", map.hit_objects.len());
|
println!("hit_objects: {}", map.hit_objects.len());
|
||||||
|
|
||||||
#[cfg(any(feature = "osu", feature = "fruits"))]
|
#[cfg(feature = "sliders")]
|
||||||
{
|
{
|
||||||
#[cfg(feature = "osu")]
|
#[cfg(feature = "osu")]
|
||||||
println!("stack_leniency: {}", map.stack_leniency);
|
println!("stack_leniency: {}", map.stack_leniency);
|
||||||
|
|||||||
Reference in New Issue
Block a user