mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Move samples to LegacyControlPointInfo
This commit is contained in:
@ -44,6 +44,13 @@ namespace osu.Game.Beatmaps.Formats
|
||||
offset = FormatVersion < 5 ? 24 : 0;
|
||||
}
|
||||
|
||||
protected override Beatmap CreateTemplateObject()
|
||||
{
|
||||
var templateBeatmap = base.CreateTemplateObject();
|
||||
templateBeatmap.ControlPointInfo = new LegacyControlPointInfo();
|
||||
return templateBeatmap;
|
||||
}
|
||||
|
||||
protected override void ParseStreamInto(LineBufferedReader stream, Beatmap beatmap)
|
||||
{
|
||||
this.beatmap = beatmap;
|
||||
@ -394,8 +401,16 @@ namespace osu.Game.Beatmaps.Formats
|
||||
private readonly HashSet<Type> pendingControlPointTypes = new HashSet<Type>();
|
||||
private double pendingControlPointsTime;
|
||||
|
||||
private readonly LegacyControlPointInfo controlPointInfo = new LegacyControlPointInfo();
|
||||
|
||||
private void addControlPoint(double time, ControlPoint point, bool timingChange)
|
||||
{
|
||||
if (point is SampleControlPoint)
|
||||
{
|
||||
controlPointInfo.Add(time, point);
|
||||
return;
|
||||
}
|
||||
|
||||
if (time != pendingControlPointsTime)
|
||||
flushPendingPoints();
|
||||
|
||||
@ -430,8 +445,15 @@ namespace osu.Game.Beatmaps.Formats
|
||||
parser ??= new Rulesets.Objects.Legacy.Osu.ConvertHitObjectParser(getOffsetTime(), FormatVersion);
|
||||
|
||||
var obj = parser.Parse(line);
|
||||
|
||||
if (obj != null)
|
||||
{
|
||||
// assign legacy control points directly to hitobject
|
||||
//obj.SampleControlPoint = controlPointInfo.SamplePointAt(obj.StartTime);
|
||||
obj.ApplyDefaults(controlPointInfo, beatmap.BeatmapInfo.BaseDifficulty);
|
||||
|
||||
beatmap.HitObjects.Add(obj);
|
||||
}
|
||||
}
|
||||
|
||||
private int getOffsetTime(int time) => time + (ApplyOffsets ? offset : 0);
|
||||
|
Reference in New Issue
Block a user