1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 09:32:55 +08:00

Move bpm clamping to TimingControlPoint, adjust range to 1-10000bpm

In line with stable editor restrictions
This commit is contained in:
Dean Herbert 2018-02-28 22:53:16 +09:00
parent 5b4fef0180
commit 572d3b1316
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// 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
/// <summary>
/// The beat length at this control point.
/// </summary>
public double BeatLength = 1000;
public double BeatLength
{
get => beatLength;
set => beatLength = MathHelper.Clamp(value, 100, 60000);
}
private double beatLength = 1000;
}
}

View File

@ -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
});
}