mirror of
https://github.com/ppy/osu
synced 2024-12-27 01:12:45 +00:00
Update decoder to also extract DifficultyControlPoint
s from HitObject
s
This commit is contained in:
parent
071c56e90b
commit
4eb09ea1a9
@ -182,11 +182,19 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
beatmap.ControlPointInfo = legacyControlPoints;
|
beatmap.ControlPointInfo = legacyControlPoints;
|
||||||
|
|
||||||
SampleControlPoint lastRelevantSamplePoint = null;
|
SampleControlPoint lastRelevantSamplePoint = null;
|
||||||
|
DifficultyControlPoint lastRelevantDifficultyPoint = null;
|
||||||
|
|
||||||
// iterate over hitobjects and pull out all required sample changes
|
// iterate over hitobjects and pull out all required sample changes
|
||||||
foreach (var h in beatmap.HitObjects)
|
foreach (var h in beatmap.HitObjects)
|
||||||
{
|
{
|
||||||
var hSamplePoint = h.SampleControlPoint;
|
var hSamplePoint = h.SampleControlPoint;
|
||||||
|
var hDifficultyPoint = h.DifficultyControlPoint;
|
||||||
|
|
||||||
|
if (!hDifficultyPoint.IsRedundant(lastRelevantDifficultyPoint))
|
||||||
|
{
|
||||||
|
legacyControlPoints.Add(hDifficultyPoint.Time, hDifficultyPoint);
|
||||||
|
lastRelevantDifficultyPoint = hDifficultyPoint;
|
||||||
|
}
|
||||||
|
|
||||||
if (!hSamplePoint.IsRedundant(lastRelevantSamplePoint))
|
if (!hSamplePoint.IsRedundant(lastRelevantSamplePoint))
|
||||||
{
|
{
|
||||||
@ -209,7 +217,7 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output any remaining effects as secondary non-timing control point.
|
// Output any remaining effects as secondary non-timing control point.
|
||||||
var difficultyPoint = beatmap.ControlPointInfo.DifficultyPointAt(group.Time);
|
var difficultyPoint = ((LegacyControlPointInfo)beatmap.ControlPointInfo).DifficultyPointAt(group.Time);
|
||||||
writer.Write(FormattableString.Invariant($"{group.Time},"));
|
writer.Write(FormattableString.Invariant($"{group.Time},"));
|
||||||
writer.Write(FormattableString.Invariant($"{-100 / difficultyPoint.SpeedMultiplier},"));
|
writer.Write(FormattableString.Invariant($"{-100 / difficultyPoint.SpeedMultiplier},"));
|
||||||
outputControlPointAt(group.Time, false);
|
outputControlPointAt(group.Time, false);
|
||||||
|
Loading…
Reference in New Issue
Block a user