From 572d3b1316a8033c42b2a0c09993ec0064ec1ded Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 28 Feb 2018 22:53:16 +0900 Subject: [PATCH] Move bpm clamping to TimingControlPoint, adjust range to 1-10000bpm In line with stable editor restrictions --- osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs | 9 ++++++++- osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs | 3 +-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs b/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs index 0592ef38c5..933eb93304 100644 --- a/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs +++ b/osu.Game/Beatmaps/ControlPoints/TimingControlPoint.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2018 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using OpenTK; using osu.Game.Beatmaps.Timing; namespace osu.Game.Beatmaps.ControlPoints @@ -15,6 +16,12 @@ namespace osu.Game.Beatmaps.ControlPoints /// /// The beat length at this control point. /// - public double BeatLength = 1000; + public double BeatLength + { + get => beatLength; + set => beatLength = MathHelper.Clamp(value, 100, 60000); + } + + private double beatLength = 1000; } } diff --git a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs index d58318994f..3e7b36f324 100644 --- a/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs +++ b/osu.Game/Beatmaps/Formats/LegacyBeatmapDecoder.cs @@ -8,7 +8,6 @@ using OpenTK.Graphics; using osu.Game.Beatmaps.Timing; using osu.Game.Rulesets.Objects.Legacy; using osu.Game.Beatmaps.ControlPoints; -using OpenTK; namespace osu.Game.Beatmaps.Formats { @@ -320,7 +319,7 @@ namespace osu.Game.Beatmaps.Formats beatmap.ControlPointInfo.TimingPoints.Add(new TimingControlPoint { Time = time, - BeatLength = MathHelper.Clamp(beatLength, 100, 60000), + BeatLength = beatLength, TimeSignature = timeSignature }); }