move sound field of HitObject to Beatmap

This commit is contained in:
MaxOhn
2022-01-24 23:17:04 +01:00
parent 0989a34413
commit f689a21026
10 changed files with 111 additions and 54 deletions
-2
View File
@@ -12,8 +12,6 @@ pub struct HitObject {
pub start_time: f64,
/// The type of the object.
pub kind: HitObjectKind,
/// The hitsound of the object. Used as color in osu!taiko.
pub sound: u8,
}
impl HitObject {
+4 -1
View File
@@ -608,8 +608,8 @@ macro_rules! parse_hitobjects_body {
pos,
start_time: time,
kind,
sound,
});
$self.sounds.push(sound);
prev_time = time;
$buf.clear();
@@ -813,6 +813,9 @@ pub struct Beatmap {
pub tick_rate: f64,
/// All hitobjects of the beatmap.
pub hit_objects: Vec<HitObject>,
/// Store the sounds for all objects in their own Vec to minimize the struct size.
/// Hitsounds are only used in osu!taiko in which they represent color.
pub sounds: Vec<u8>,
#[cfg(not(feature = "sliders"))]
/// Beats per minute