mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:03:11 +08:00
Move check to LegacyDifficultyControlPoint
This commit is contained in:
parent
2579ed46ce
commit
338115ff6a
@ -162,14 +162,7 @@ namespace osu.Game.Rulesets.Taiko.Beatmaps
|
|||||||
#pragma warning disable 618
|
#pragma warning disable 618
|
||||||
if (difficultyPoint is LegacyBeatmapDecoder.LegacyDifficultyControlPoint legacyDifficultyPoint)
|
if (difficultyPoint is LegacyBeatmapDecoder.LegacyDifficultyControlPoint legacyDifficultyPoint)
|
||||||
#pragma warning restore 618
|
#pragma warning restore 618
|
||||||
{
|
beatLength = timingPoint.BeatLength * legacyDifficultyPoint.BpmMultiplier;
|
||||||
double bpmMultiplier;
|
|
||||||
if (beatmap.BeatmapInfo.OnlineID == 1 || beatmap.BeatmapInfo.OnlineID == 3)
|
|
||||||
bpmMultiplier = legacyDifficultyPoint.BpmMultiplierMania;
|
|
||||||
else
|
|
||||||
bpmMultiplier = legacyDifficultyPoint.BpmMultiplier;
|
|
||||||
beatLength = timingPoint.BeatLength * bpmMultiplier;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
beatLength = timingPoint.BeatLength / difficultyPoint.SliderVelocity;
|
beatLength = timingPoint.BeatLength / difficultyPoint.SliderVelocity;
|
||||||
|
|
||||||
|
@ -427,8 +427,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
addControlPoint(time, controlPoint, true);
|
addControlPoint(time, controlPoint, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int onlineRulesetID = beatmap.BeatmapInfo.Ruleset.OnlineID;
|
||||||
|
|
||||||
#pragma warning disable 618
|
#pragma warning disable 618
|
||||||
addControlPoint(time, new LegacyDifficultyControlPoint(beatLength)
|
addControlPoint(time, new LegacyDifficultyControlPoint(onlineRulesetID, beatLength)
|
||||||
#pragma warning restore 618
|
#pragma warning restore 618
|
||||||
{
|
{
|
||||||
SliderVelocity = speedMultiplier,
|
SliderVelocity = speedMultiplier,
|
||||||
@ -440,8 +442,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
OmitFirstBarLine = omitFirstBarSignature,
|
OmitFirstBarLine = omitFirstBarSignature,
|
||||||
};
|
};
|
||||||
|
|
||||||
int onlineRulesetID = beatmap.BeatmapInfo.Ruleset.OnlineID;
|
|
||||||
|
|
||||||
// osu!taiko and osu!mania use effect points rather than difficulty points for scroll speed adjustments.
|
// osu!taiko and osu!mania use effect points rather than difficulty points for scroll speed adjustments.
|
||||||
if (onlineRulesetID == 1 || onlineRulesetID == 3)
|
if (onlineRulesetID == 1 || onlineRulesetID == 3)
|
||||||
effectPoint.ScrollSpeed = speedMultiplier;
|
effectPoint.ScrollSpeed = speedMultiplier;
|
||||||
|
@ -168,25 +168,21 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double BpmMultiplier { get; private set; }
|
public double BpmMultiplier { get; private set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Legacy BPM multiplier that introduces floating-point errors for rulesets that depend on it.
|
|
||||||
/// This is to be used for taiko and mania specific beatmaps.
|
|
||||||
/// DO NOT USE THIS UNLESS 100% SURE.
|
|
||||||
/// </summary>
|
|
||||||
public double BpmMultiplierMania { get; private set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not slider ticks should be generated at this control point.
|
/// Whether or not slider ticks should be generated at this control point.
|
||||||
/// This exists for backwards compatibility with maps that abuse NaN slider velocity behavior on osu!stable (e.g. /b/2628991).
|
/// This exists for backwards compatibility with maps that abuse NaN slider velocity behavior on osu!stable (e.g. /b/2628991).
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool GenerateTicks { get; private set; } = true;
|
public bool GenerateTicks { get; private set; } = true;
|
||||||
|
|
||||||
public LegacyDifficultyControlPoint(double beatLength)
|
public LegacyDifficultyControlPoint(int rulesetId, double beatLength)
|
||||||
: this()
|
: this()
|
||||||
{
|
{
|
||||||
// Note: In stable, the division occurs on floats, but with compiler optimisations turned on actually seems to occur on doubles via some .NET black magic (possibly inlining?).
|
// Note: In stable, the division occurs on floats, but with compiler optimisations turned on actually seems to occur on doubles via some .NET black magic (possibly inlining?).
|
||||||
|
if (rulesetId == 1 || rulesetId == 3)
|
||||||
|
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 10000) / 100.0 : 1;
|
||||||
|
else
|
||||||
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 1000) / 100.0 : 1;
|
BpmMultiplier = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 1000) / 100.0 : 1;
|
||||||
BpmMultiplierMania = beatLength < 0 ? Math.Clamp((float)-beatLength, 10, 10000) / 100.0 : 1;
|
|
||||||
GenerateTicks = !double.IsNaN(beatLength);
|
GenerateTicks = !double.IsNaN(beatLength);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +200,6 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
base.CopyFrom(other);
|
base.CopyFrom(other);
|
||||||
|
|
||||||
BpmMultiplier = ((LegacyDifficultyControlPoint)other).BpmMultiplier;
|
BpmMultiplier = ((LegacyDifficultyControlPoint)other).BpmMultiplier;
|
||||||
BpmMultiplierMania = ((LegacyDifficultyControlPoint)other).BpmMultiplierMania;
|
|
||||||
GenerateTicks = ((LegacyDifficultyControlPoint)other).GenerateTicks;
|
GenerateTicks = ((LegacyDifficultyControlPoint)other).GenerateTicks;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,11 +210,10 @@ namespace osu.Game.Beatmaps.Formats
|
|||||||
public bool Equals(LegacyDifficultyControlPoint? other)
|
public bool Equals(LegacyDifficultyControlPoint? other)
|
||||||
=> base.Equals(other)
|
=> base.Equals(other)
|
||||||
&& BpmMultiplier == other.BpmMultiplier
|
&& BpmMultiplier == other.BpmMultiplier
|
||||||
&& BpmMultiplierMania == other.BpmMultiplierMania
|
|
||||||
&& GenerateTicks == other.GenerateTicks;
|
&& GenerateTicks == other.GenerateTicks;
|
||||||
|
|
||||||
// ReSharper disable twice NonReadonlyMemberInGetHashCode
|
// ReSharper disable twice NonReadonlyMemberInGetHashCode
|
||||||
public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), BpmMultiplier, BpmMultiplierMania, GenerateTicks);
|
public override int GetHashCode() => HashCode.Combine(base.GetHashCode(), BpmMultiplier, GenerateTicks);
|
||||||
}
|
}
|
||||||
|
|
||||||
internal class LegacySampleControlPoint : SampleControlPoint, IEquatable<LegacySampleControlPoint>
|
internal class LegacySampleControlPoint : SampleControlPoint, IEquatable<LegacySampleControlPoint>
|
||||||
|
Loading…
Reference in New Issue
Block a user