mirror of
https://github.com/ppy/osu.git
synced 2026-05-18 02:09:52 +08:00
Fix first sample point being treated as redundant
This commit is contained in:
@@ -60,18 +60,18 @@ namespace osu.Game.Tests.NonVisual
|
||||
{
|
||||
var cpi = new ControlPointInfo();
|
||||
|
||||
cpi.Add(0, new SampleControlPoint()); // is redundant
|
||||
cpi.Add(0, new SampleControlPoint()); // is *not* redundant, special exception for first sample point
|
||||
cpi.Add(1000, new SampleControlPoint()); // is redundant
|
||||
|
||||
Assert.That(cpi.Groups.Count, Is.EqualTo(0));
|
||||
Assert.That(cpi.Groups.Count, Is.EqualTo(1));
|
||||
Assert.That(cpi.TimingPoints.Count, Is.EqualTo(0));
|
||||
Assert.That(cpi.AllControlPoints.Count(), Is.EqualTo(0));
|
||||
Assert.That(cpi.AllControlPoints.Count(), Is.EqualTo(1));
|
||||
|
||||
cpi.Add(1000, new SampleControlPoint { SampleVolume = 50 }); // is not redundant
|
||||
|
||||
Assert.That(cpi.Groups.Count, Is.EqualTo(1));
|
||||
Assert.That(cpi.SamplePoints.Count, Is.EqualTo(1));
|
||||
Assert.That(cpi.AllControlPoints.Count(), Is.EqualTo(1));
|
||||
Assert.That(cpi.Groups.Count, Is.EqualTo(2));
|
||||
Assert.That(cpi.SamplePoints.Count, Is.EqualTo(2));
|
||||
Assert.That(cpi.AllControlPoints.Count(), Is.EqualTo(2));
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -239,7 +239,7 @@ namespace osu.Game.Beatmaps.ControlPoints
|
||||
break;
|
||||
|
||||
case SampleControlPoint _:
|
||||
existing = SamplePointAt(time);
|
||||
existing = binarySearch(SamplePoints, time);
|
||||
break;
|
||||
|
||||
case DifficultyControlPoint _:
|
||||
|
||||
Reference in New Issue
Block a user