Move legacy_velocity_multiplier application to LegacyTimingInfo.

This commit is contained in:
Dean Herbert 2017-04-05 12:05:48 +09:00
parent abf6dbc307
commit 6a922da87e
No known key found for this signature in database
GPG Key ID: 46D71BF4958ABB49
4 changed files with 23 additions and 8 deletions

View File

@ -9,6 +9,7 @@ using osu.Game.Modes.Taiko.Objects;
using System;
using System.Collections.Generic;
using System.Linq;
using osu.Game.Beatmaps.Timing;
using osu.Game.Database;
namespace osu.Game.Modes.Taiko.Beatmaps
@ -41,6 +42,7 @@ namespace osu.Game.Modes.Taiko.Beatmaps
{
return new Beatmap<TaikoHitObject>(original)
{
TimingInfo = new LegacyTimingInfo(original.TimingInfo),
HitObjects = original.HitObjects.SelectMany(h => convertHitObject(h, original)).ToList()
};
}
@ -100,7 +102,6 @@ namespace osu.Game.Modes.Taiko.Beatmaps
StartTime = j,
Sample = obj.Sample,
IsStrong = strong,
VelocityMultiplier = legacy_velocity_multiplier
};
}
}
@ -113,7 +114,6 @@ namespace osu.Game.Modes.Taiko.Beatmaps
IsStrong = strong,
Distance = distance,
TickRate = beatmap.BeatmapInfo.Difficulty.SliderTickRate == 3 ? 3 : 4,
VelocityMultiplier = legacy_velocity_multiplier
};
}
}
@ -128,7 +128,6 @@ namespace osu.Game.Modes.Taiko.Beatmaps
IsStrong = strong,
EndTime = endTimeData.EndTime,
RequiredHits = (int)Math.Max(1, endTimeData.Duration / 1000 * hitMultiplier),
VelocityMultiplier = legacy_velocity_multiplier
};
}
else
@ -142,7 +141,6 @@ namespace osu.Game.Modes.Taiko.Beatmaps
StartTime = obj.StartTime,
Sample = obj.Sample,
IsStrong = strong,
VelocityMultiplier = legacy_velocity_multiplier
};
}
else
@ -152,10 +150,25 @@ namespace osu.Game.Modes.Taiko.Beatmaps
StartTime = obj.StartTime,
Sample = obj.Sample,
IsStrong = strong,
VelocityMultiplier = legacy_velocity_multiplier
};
}
}
}
private class LegacyTimingInfo : TimingInfo
{
public LegacyTimingInfo(TimingInfo original)
{
if (original is LegacyTimingInfo)
ControlPoints.AddRange(original.ControlPoints);
else
{
ControlPoints.AddRange(original.ControlPoints.Select(c => c.Clone()));
foreach (var c in ControlPoints)
c.SpeedMultiplier *= legacy_velocity_multiplier;
}
}
}
}
}

View File

@ -215,7 +215,7 @@ namespace osu.Game.Beatmaps.Formats
{
Time = double.Parse(split[0].Trim(), NumberFormatInfo.InvariantInfo),
BeatLength = beatLength > 0 ? beatLength : 0,
VelocityAdjustment = beatLength < 0 ? -beatLength / 100.0 : 1,
SpeedMultiplier = beatLength < 0 ? -beatLength / 100.0 : 1,
TimingChange = split.Length <= 6 || split[6][0] == '1',
KiaiMode = (effectFlags & 1) > 0,
OmitFirstBarLine = (effectFlags & 8) > 0,

View File

@ -14,9 +14,11 @@ namespace osu.Game.Beatmaps.Timing
public TimeSignatures TimeSignature;
public double Time;
public double BeatLength;
public double VelocityAdjustment;
public double SpeedMultiplier;
public bool TimingChange;
public bool KiaiMode;
public bool OmitFirstBarLine;
public ControlPoint Clone() => (ControlPoint)MemberwiseClone();
}
}

View File

@ -29,7 +29,7 @@ namespace osu.Game.Beatmaps.Timing
ControlPoint overridePoint;
ControlPoint timingPoint = TimingPointAt(time, out overridePoint);
return overridePoint?.VelocityAdjustment ?? timingPoint?.VelocityAdjustment ?? 1;
return overridePoint?.SpeedMultiplier ?? timingPoint?.SpeedMultiplier ?? 1;
}
/// <summary>