Skip to content

Commit

Permalink
Merge pull request #30509 from bdach/encode-0-01-svs
Browse files Browse the repository at this point in the history
Fix effect point scroll speeds below 0.1x not being encoded properly
  • Loading branch information
smoogipoo authored Nov 6, 2024
2 parents 5db52e1 + 23f3890 commit 8aed578
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 4 deletions.
6 changes: 3 additions & 3 deletions osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapEncoderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ static ControlPointInfo removeLegacyControlPointTypes(ControlPointInfo controlPo
private void compareBeatmaps((IBeatmap beatmap, TestLegacySkin skin) expected, (IBeatmap beatmap, TestLegacySkin skin) actual)
{
// Check all control points that are still considered to be at a global level.
Assert.That(expected.beatmap.ControlPointInfo.TimingPoints.Serialize(), Is.EqualTo(actual.beatmap.ControlPointInfo.TimingPoints.Serialize()));
Assert.That(expected.beatmap.ControlPointInfo.EffectPoints.Serialize(), Is.EqualTo(actual.beatmap.ControlPointInfo.EffectPoints.Serialize()));
Assert.That(actual.beatmap.ControlPointInfo.TimingPoints.Serialize(), Is.EqualTo(expected.beatmap.ControlPointInfo.TimingPoints.Serialize()));
Assert.That(actual.beatmap.ControlPointInfo.EffectPoints.Serialize(), Is.EqualTo(expected.beatmap.ControlPointInfo.EffectPoints.Serialize()));

// Check all hitobjects.
Assert.That(expected.beatmap.HitObjects.Serialize(), Is.EqualTo(actual.beatmap.HitObjects.Serialize()));
Assert.That(actual.beatmap.HitObjects.Serialize(), Is.EqualTo(expected.beatmap.HitObjects.Serialize()));

// Check skin.
Assert.IsTrue(areComboColoursEqual(expected.skin.Configuration, actual.skin.Configuration));
Expand Down
39 changes: 39 additions & 0 deletions osu.Game.Tests/Resources/mania-0-01-sv.osu
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
osu file format v14

[General]
SampleSet: Normal
StackLeniency: 0.7
Mode: 3

[Difficulty]
HPDrainRate:3
CircleSize:5
OverallDifficulty:8
ApproachRate:8
SliderMultiplier:3.59999990463257
SliderTickRate:2

[TimingPoints]
24,352.941176470588,4,1,1,100,1,0
6376,-10000,4,1,1,100,0,0

[HitObjects]
51,192,24,1,0,0:0:0:0:
153,192,200,1,0,0:0:0:0:
358,192,376,1,0,0:0:0:0:
460,192,553,1,0,0:0:0:0:
460,192,729,128,0,1435:0:0:0:0:
358,192,906,128,0,1612:0:0:0:0:
256,192,1082,128,0,1788:0:0:0:0:
153,192,1259,128,0,1965:0:0:0:0:
51,192,1435,128,0,2141:0:0:0:0:
51,192,2318,1,12,0:0:0:0:
153,192,2318,1,4,0:0:0:0:
256,192,2318,1,6,0:0:0:0:
358,192,2318,1,14,0:0:0:0:
460,192,2318,1,0,0:0:0:0:
51,192,2494,128,0,2582:0:0:0:0:
153,192,2494,128,14,2582:0:0:0:0:
256,192,2494,128,6,2582:0:0:0:0:
358,192,2494,128,4,2582:0:0:0:0:
460,192,2494,128,12,2582:0:0:0:0:
12 changes: 11 additions & 1 deletion osu.Game/Beatmaps/Formats/LegacyBeatmapEncoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,17 @@ private void handleControlPoints(TextWriter writer)
if (scrollSpeedEncodedAsSliderVelocity)
{
foreach (var point in legacyControlPoints.EffectPoints)
legacyControlPoints.Add(point.Time, new DifficultyControlPoint { SliderVelocity = point.ScrollSpeed });
{
legacyControlPoints.Add(point.Time, new DifficultyControlPoint
{
SliderVelocityBindable =
{
MinValue = point.ScrollSpeedBindable.MinValue,
MaxValue = point.ScrollSpeedBindable.MaxValue,
Value = point.ScrollSpeedBindable.Value,
}
});
}
}

LegacyControlPointProperties lastControlPointProperties = new LegacyControlPointProperties();
Expand Down

0 comments on commit 8aed578

Please sign in to comment.