1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 20:07:25 +08:00

Set scrollspeed directly at beatmap decode

This commit is contained in:
sw1tchbl4d3 2022-10-25 15:49:14 +02:00
parent e8960ba53b
commit 242f80b8b3
3 changed files with 1 additions and 67 deletions

View File

@ -1,38 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Beatmaps.ControlPoints;
using osu.Game.Rulesets.Objects;
using osu.Game.Tests.Visual;
namespace osu.Game.Rulesets.Taiko.Tests
{
public class TestSceneControlPointConversion : OsuTestScene
{
[Test]
public void TestSceneScrollSpeedConversion()
{
const double start_time = 1000;
const double slider_velocity = 10;
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new HitObject
{
StartTime = start_time,
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = slider_velocity }
}
},
BeatmapInfo = { Ruleset = { OnlineID = 0 } },
};
var convertedBeatmap = new TaikoRuleset().CreateBeatmapConverter(beatmap).Convert();
AddAssert("effect point generated", () => convertedBeatmap.ControlPointInfo.EffectPointAt(start_time).ScrollSpeed == slider_velocity);
}
}
}

View File

@ -57,29 +57,6 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
Beatmap<TaikoHitObject> converted = base.ConvertBeatmap(original, cancellationToken);
if (original.BeatmapInfo.Ruleset.OnlineID == 0)
{
// Post processing step to transform standard slider velocity changes into scroll speed changes
double lastScrollSpeed = 1;
foreach (HitObject hitObject in original.HitObjects)
{
double nextScrollSpeed = hitObject.DifficultyControlPoint.SliderVelocity;
if (!Precision.AlmostEquals(lastScrollSpeed, nextScrollSpeed))
{
EffectControlPoint currentControlPoint = converted.ControlPointInfo.EffectPointAt(hitObject.StartTime);
if (Precision.AlmostEquals(currentControlPoint.Time, hitObject.StartTime))
currentControlPoint.ScrollSpeed = nextScrollSpeed;
else
converted.ControlPointInfo.Add(hitObject.StartTime, new EffectControlPoint { ScrollSpeed = nextScrollSpeed });
lastScrollSpeed = nextScrollSpeed;
}
}
}
if (original.BeatmapInfo.Ruleset.OnlineID == 3)
{
// Post processing step to transform mania hit objects with the same start time into strong hits

View File

@ -438,14 +438,9 @@ namespace osu.Game.Beatmaps.Formats
{
KiaiMode = kiaiMode,
OmitFirstBarLine = omitFirstBarSignature,
ScrollSpeed = speedMultiplier,
};
int onlineRulesetID = beatmap.BeatmapInfo.Ruleset.OnlineID;
// osu!taiko and osu!mania use effect points rather than difficulty points for scroll speed adjustments.
if (onlineRulesetID == 1 || onlineRulesetID == 3)
effectPoint.ScrollSpeed = speedMultiplier;
addControlPoint(time, effectPoint, timingChange);
addControlPoint(time, new LegacySampleControlPoint