mirror of
https://github.com/ppy/osu
synced 2025-03-08 20:40:12 +00:00
Apply rate multiplier outside BPM rounding
This commit is contained in:
parent
596853da8f
commit
84a3cee452
@ -168,16 +168,21 @@ namespace osu.Game.Tests.Visual.SongSelect
|
|||||||
checkDisplayedBPM($"{bpm * 2}");
|
checkDisplayedBPM($"{bpm * 2}");
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(120, 125, "120-125 (mostly 120)")]
|
[TestCase(120, 125, null, "120-125 (mostly 120)")]
|
||||||
[TestCase(120, 120.6, "120-121 (mostly 120)")]
|
[TestCase(120, 120.6, null, "120-121 (mostly 120)")]
|
||||||
[TestCase(120, 120.4, "120")]
|
[TestCase(120, 120.4, null, "120")]
|
||||||
public void TestVaryingBPM(double commonBpm, double otherBpm, string expectedDisplay)
|
[TestCase(120, 120.6, "DT", "180-182 (mostly 180)")]
|
||||||
|
[TestCase(120, 120.4, "DT", "180")]
|
||||||
|
public void TestVaryingBPM(double commonBpm, double otherBpm, string mod, string expectedDisplay)
|
||||||
{
|
{
|
||||||
IBeatmap beatmap = createTestBeatmap(new OsuRuleset().RulesetInfo);
|
IBeatmap beatmap = createTestBeatmap(new OsuRuleset().RulesetInfo);
|
||||||
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 60 * 1000 / commonBpm });
|
beatmap.ControlPointInfo.Add(0, new TimingControlPoint { BeatLength = 60 * 1000 / commonBpm });
|
||||||
beatmap.ControlPointInfo.Add(100, new TimingControlPoint { BeatLength = 60 * 1000 / otherBpm });
|
beatmap.ControlPointInfo.Add(100, new TimingControlPoint { BeatLength = 60 * 1000 / otherBpm });
|
||||||
beatmap.ControlPointInfo.Add(200, new TimingControlPoint { BeatLength = 60 * 1000 / commonBpm });
|
beatmap.ControlPointInfo.Add(200, new TimingControlPoint { BeatLength = 60 * 1000 / commonBpm });
|
||||||
|
|
||||||
|
if (mod != null)
|
||||||
|
AddStep($"select {mod}", () => SelectedMods.Value = new[] { Ruleset.Value.CreateInstance().CreateModFromAcronym(mod) });
|
||||||
|
|
||||||
selectBeatmap(beatmap);
|
selectBeatmap(beatmap);
|
||||||
checkDisplayedBPM(expectedDisplay);
|
checkDisplayedBPM(expectedDisplay);
|
||||||
}
|
}
|
||||||
|
@ -415,9 +415,9 @@ namespace osu.Game.Screens.Select
|
|||||||
foreach (var mod in mods.Value.OfType<IApplicableToRate>())
|
foreach (var mod in mods.Value.OfType<IApplicableToRate>())
|
||||||
rate = mod.ApplyToRate(0, rate);
|
rate = mod.ApplyToRate(0, rate);
|
||||||
|
|
||||||
int bpmMax = (int)Math.Round(beatmap.ControlPointInfo.BPMMaximum * rate);
|
int bpmMax = (int)Math.Round(Math.Round(beatmap.ControlPointInfo.BPMMaximum) * rate);
|
||||||
int bpmMin = (int)Math.Round(beatmap.ControlPointInfo.BPMMinimum * rate);
|
int bpmMin = (int)Math.Round(Math.Round(beatmap.ControlPointInfo.BPMMinimum) * rate);
|
||||||
int mostCommonBPM = (int)Math.Round(60000 / beatmap.GetMostCommonBeatLength() * rate);
|
int mostCommonBPM = (int)Math.Round(Math.Round(60000 / beatmap.GetMostCommonBeatLength()) * rate);
|
||||||
|
|
||||||
string labelText = bpmMin == bpmMax
|
string labelText = bpmMin == bpmMax
|
||||||
? $"{bpmMin}"
|
? $"{bpmMin}"
|
||||||
|
Loading…
Reference in New Issue
Block a user